SharePoint SMTP logs

Trying to diagnose incoming email issue and I wonder if Sharepoint has its own SMTP logs. I was told by email admin that I have to look at sharepoint SMTP logs for he could not see any logs from MAIN SMTP server. I am new to this and I thought logging is
only done in the main smtp server. Can sharepoint be configured as SMTP server as well for incoming email. Where can I find SMTP logs? Thanks in advance.
Hubble

Yes its the default logs location.
You can install SMTP on SharePoint server but again you will need a Mail server (e.g. exchange) where these message will be forwarded and thus it will be used to deliver email to end user.
Make sure the Mail server admin has add exception to receive and forward email from SharePoint server.
If you feel the answer is right, please make is answered.

Similar Messages

  • No SMTP log after upgrade to Server 4.0.3

    I just updated my server to 4.0.3 and I initially had an error message saying that a script was not owned by postfix repeated in the SMTP log file.
    First I tried to fix it with disk utility but it didn't work.
    So in Terminal I did: sudo chown _postfix /Library/Server/Mail/Data/mta/./guid_device_maps.plist
    Now I have no SMTP log showing in the server menu any ideas on how to get it back is very welcome.
    Kind regards
    Peter

    Okay I reinstalled the Server from App Store and we're back to square one with the message:
    postfix/postfix-script[2941]: warning: not owned by _postfix: /Library/Server/Mail/Data/mta/./guid_device_maps.plist
    However, http://topicdesk.com/faqs/os-x-server-mail-services-faq/166-what-is-virtual-mail -hosting-or-are-virtual-mail-domains say the message doesn't matter.
    So I apologise for the false alarm.
    Kind regards
    Peter

  • Error in the SMTP log of the mail service regarding "master.lock"

    I am getting the following error in the SMTP log of the mail service, Anybody might have any suggestions:
    postfix/master[87670]: fatal: open lock file /var/lib/postfix/master.lock: cannot open file: Permission denied.
    The permissions of the master.lock file are as follows:
    -rw-------  1 _postfix  mail  33 Jul  7 10:25 master.lock
    The Mail service stops after a few minutes from starting it
    I appreciate your feedback

    I found the problem.. the executable job was referring to a none existing batch file..
    I have refreshed the database from production some time ago and the jobs I have setup are referring to production scripts and paths (which we didnt have on dev)..
    This is now resolved.
    Thanks

  • Repetitive error in SMTP log: illegal address syntax

    Hello I keep getting this error message in the SMTP log:
    Dec 17 22:33:36 chucklepunt postfix/smtpd[2909]: connect from
    unknown[10.0.0.12]
    Dec 17 22:33:36 chucklepunt postfix/smtpd[2909]: warning: Illegal address
    syntax from unknown[10.0.0.12] in MAIL command: <W Server>
    Dec 17 22:33:36 chucklepunt postfix/smtpd[2909]: disconnect from
    unknown[10.0.0.12]
    my mail server has this IP listed above, so it obviusoly looks like some kind of internet connection, but I don't know why it keeps happining, and I have 10.0.0.12 listed in the local hosts alias.
    Thanks

    I thought my problem was solved once I added 10.0.0/24 to my relay and 10.0.0.12 to local hosts in the mail setup but I am getting the error again.
    You say is it in my /etc/main.cf?
    Should I have that config file, because I do not, at least not in that path.
    suggestions please
    Thanks!

  • Smtp log/email tracking on iphone?

    Is that possible to get an SMTP log on iphone? Basically we get an issue that sent email was disppeared nowhere, not in the sent folder on the iphone, on the server side nothing was recorded, and that only happened when the iphone is on 3G, never happened when connected on WIFI. If there is a local SMTP log on the iphone we can pull out, I can get the log and check with my telco company.
    any other suggestion to troubleshoot this issue is welcome.

    No

  • Smtp log entry, bounces, or does the mail server send bounce backscatter?

    Today, I received two bounces from mail I did not send, and they reference a subdomain of a virtual domain on my machine that doesn't exist...
    server is set up with domain:  server.domain.com
    web and mail services are available for virtual domain:  service.com
    So, I got what I at first thought were phishing bounces, but then when I looked in my mail logs today, I found my first ever SMTP log entries:
    Feb 16 07:33:42 server.domain.com postfix/smtpd[----]: warning: hostname #.#.#.#.reverse.someone.net does not resolve to address #.#.#.#: nodename nor servname provided, or not known
    I have four of those at various times this morning.
    I've checked the mail logs and seen that there are connection attempts, particularly people trying plain text.  I have used mxtoolbox and a few other relay checkers to be sure there is not an open smtp relay.  none.
    I have one site on the service.com and it has its own malware checking (wordpress install).  It reports that it is clean and feeling good.
    The default sites are unaccessible without http authentication.
    Do those SMTP log entires mean someone has gained access?  or was my server trying to process backscatter spam?  I'm lost on how this could happen.

    What do the bounce messages say? Was the mail rejected by a remote server? If so, which one? What are some of the other log entries in the mail log? Does MX Toolbox say your email server is or is not an open relay? Are the IP addresses in your log post an internal or external address? Someone might be using your domain to send spam email but they may not be using your email server and when the messages bounce they get returned to your server.

  • UCCX SMTP Logs

    Anyone have any ideas which logs I should be searching to find outbound smtp logs?  Looking for logging from a UCCX Script when an email is sent.  Looked through a number of logs but not seen anything I could id as smtp.
    Thanks
    Nathan

    Hi
    This step should be logged in the MIVR logs like any other step. If there's no failure, then you might not see anything on the default logging levels. Try turning up the traces...
    Do you have some kind of failure?
    Aaron

  • SMTP log

    Hi
    When I'm looking at the SMTP logs
    “C:\program files\Microsoft\Exchange Server\V15\TransportRoles\Logs\Hub\ProtocolLog\SmtpReceive”
    Reason complete SMTP session
    - user does not exist.
    How to obtain information that the
    user does not exist?

    Hi
    could you elaborate little bit more about your issue?
    protocol logs in the mentioned location you specified will have logs of all users who have sent and received emails internally as well as externally.
    Remember to mark as helpful if you find my contribution useful or as an answer if it does answer your question.That will encourage me - and others - to take time out to help you Check out my latest blog posts on http://exchangequery.com

  • SMTP Log detail level 'Stuck' on Debug

    Hi,
    I have a G5 XServe running 10.4.8 Server. The smtp log level seems to be stuck on 'Debug'. If I try to reduce it to a low level (eg. Error) via Server Admin, it flips back to debug as soon as I hit save.
    I have tried the following command:-
    sudo serveradmin settings mail:postfix:log_level = "err"
    but the server just responds with: -
    mail:postfix:log_level = "debug"
    The problem existed prior to upgrading the server to 10.4.8 so that is not a factor.
    Is this normal behaviour? If possible I would like to get rid of all the spam in syslog that the smtp service is creating. Any help would be appreciated!
    Codeus
    G5 Xserve   Mac OS X (10.4.8)  

    There seems to be a bug in server admin where
    sometimes it just can't get the settings right.
    You can always edit /etc/syslog.conf manually
    See "man syslog.conf"
    Thanks for the pointer although I can't see what is wrong with my Syslog.conf - it seems to be only directing Critical mail messages to the syslog, this is what I have: -
    .err;kern.;auth.notice;authpriv,remoteauth,install.none;mail.crit /dev/console
    *.notice;authpriv,remoteauth,ftp,install.none;kern.debug;mail.crit /var/log/system.log
    #. /var/log/system.log
    # Send messages normally sent to the console also to the serial port.
    # To stop messages from being sent out the serial port, comment out this line.
    #.err;kern.;auth.notice;authpriv,remoteauth.none;mail.crit /dev/tty.serial
    # The authpriv log file should be restricted access; these
    # messages shouldn't go to terminals or publically-readable
    # files.
    authpriv.*;remoteauth.crit /var/log/secure.log
    lpr.info /var/log/lpr.log
    mail.crit /var/log/mail.log
    ftp.* /var/log/ftp.log
    netinfo.err /var/log/netinfo.log
    install.* /var/log/install.log
    install.* @127.0.0.1:32376
    local0.* /var/log/ipfw.log
    *.emerg *
    local6.err /var/log/mailaccess.log
    and yet my syslog looks like this: -
    Nov 21 14:30:47 mail imap[9141]: login: CommsIT-01-eMac1.25G [172.18.10.200] bert CRAM-MD5 User logged in
    Nov 21 14:30:52 mail imap[8994]: login: CommsIT-01-eMac1.25G [172.18.10.200] bert CRAM-MD5 User logged in
    Nov 21 14:34:06 mail imap[9561]: login: [172.18.10.105] ernie CRAM-MD5 User logged in
    Nov 21 14:34:18 mail imap[9562]: login: [172.18.10.49] fred plaintext User logged in
    Nov 21 14:35:34 mail imap[9592]: login: [172.18.10.26] sandy CRAM-MD5 User logged in
    Nov 21 14:35:35 mail imap[9144]: login: [172.18.10.34] stanley plaintext User logged in
    Nov 21 14:39:18 mail imap[9698]: login: [172.18.10.49] fred plaintext User logged in
    Is it because these messages are not handled under the 'mail' selector for some reason or have I got something else wrong in the syslog.conf?
    Thanks again,
    Codeus

  • Help on smtp log

    exch2003server (10.141.10.17) is an Exchange 2003 frontend server; 10.141.10.1 is one domain controller's IP
    here is the SMTP log on the exch2003server.  we tried to take down the exch2003server, but 10.141.10.1 (
    domain controller) seems to use exch2003server.  from the SMTP log (only two lines in the log):
    can anyone help to see whether 10.141.10.1 still uses exch2003server?  why 10.141.10.1 (
    domain controller) shows up in the SMTP log?
    Line 22084: 2014-06-02 13:21:15 10.141.10.1 xyz.com SMTPSVC1 exch2003server 10.141.10.17 0 HELO - +xyz.com 250 0 46 13 0 SMTP - - - -
    Line 22085: 2014-06-02 13:21:15 10.141.10.1 xyz.com SMTPSVC1 exch2003server  10.141.10.17 0 QUIT - xyz.com 240 0 68 4 0 SMTP - - - -
    Thank you.

    Hi Rich,
    Thanks for your reply.
    I checked DC and checked any app or scheduled tasks that could cause in the SMTP log.  No app or scheduled task.
    BTw, only teo lines are in the SMTP log:
    Line 22084: 2014-06-02 13:21:15 10.141.10.1 xyz.com SMTPSVC1 exch2003server 10.141.10.17 0 HELO - +xyz.com 250 0 46 13 0 SMTP - - - -
     Line 22085: 2014-06-02 13:21:15 10.141.10.1 xyz.com SMTPSVC1 exch2003server  10.141.10.17 0 QUIT - xyz.com 240 0 68 4 0 SMTP - - - -
    xyz.com (i used fake one) and xyz.com in the log is not smtp domain.  checked whois and it registered in Korea.
    I just want to find out why two lines are in the SMTP log from our DC?
    Thank you.

  • I keep getting this error in the SMTP logs, What's wrong?

    I keep getting this error in SMTP, and for some reason the server is unable to send messages. It's a fresh setup, so i'm not sure what i'm missing..
    fatal: file /etc/postfix/main.cf: parameter myhostname: bad parameter value: mini.socialgraphics.com.
    Any advice would help, Thanks!

    From the server's webmail interface i can log in and send messages to outside accounts.
    But i can't recieve any messages on the server, everything i send to the server gets a error of:
    Delivery to the following recipient failed permanently:
        [email protected]
    Technical details of permanent failure:
    Google tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other email provider for further information about the cause of this error. The error that the other server returned was: 554 554 5.7.1 <[email protected]>: Relay access denied (state 14).

  • Not seeing STARTTLS advertised in EHLO but SMTP logs show it?

    Exchange 2010 SP3ur8 on 2008R2 SP1 fully patched, single server, static IP address, default settings with self-signed SMTP certificate and Internet receive connector setup for TLS.  Email, OWA, Activesync all working fine, ESET mail security 4.5.  Sorry
    if this is long, I tried everything I could think of...
    I was fixing an issue with Reverse DNS Mismatch (had the ISP change it) and noticed a "Warning - Does not support TLS."  with the mxtoolbox SMTP test which I thought odd as it showed that we weren't advertising STARTTLS after receiving an EHLO:
    220 remote.DOMAINNAME Microsoft ESMTP MAIL Service ready at Thu, 15 Jan 2015 09:42:10 -0700 [718 ms]
    EHLO MXTB-PWS3.mxtoolbox.com
    250-remote.DOMAINNAME Hello [64.20.227.133]
    250-SIZE 10485760
    250-DSN
    250 AUTH [780 ms]
    MAIL FROM: <[email protected]>
    I checked the SmtpReceive logs (which I set to verbose for this test) and they showed it was sending STARTTLS (along with a bunch of other stuff):
    SERVERNAME,08D1FEF1B5FADEE4,2,10.0.0.1:25,64.20.227.133:57925,>,"220 remote.DOMAINNAME Microsoft ESMTP MAIL Service ready at Thu, 15 Jan 2015 09:42:10 -0700",
    2015-01-15T16:42:11.826Z,SERVERNAME\Internet Receive SERVERNAME,08D1FEF1B5FADEE4,3,10.0.0.1:25,64.20.227.133:57925,<,EHLO MXTB-PWS3.mxtoolbox.com,
    2015-01-15T16:42:11.826Z,SERVERNAME\Internet Receive SERVERNAME,08D1FEF1B5FADEE4,4,10.0.0.1:25,64.20.227.133:57925,>,250-remote.DOMAINNAME Hello [64.20.227.133],
    2015-01-15T16:42:11.826Z,SERVERNAME\Internet Receive SERVERNAME,08D1FEF1B5FADEE4,5,10.0.0.1:25,64.20.227.133:57925,>,250-SIZE 10485760,
    2015-01-15T16:42:11.826Z,SERVERNAME\Internet Receive SERVERNAME,08D1FEF1B5FADEE4,6,10.0.0.1:25,64.20.227.133:57925,>,250-PIPELINING,
    2015-01-15T16:42:11.826Z,SERVERNAME\Internet Receive SERVERNAME,08D1FEF1B5FADEE4,7,10.0.0.1:25,64.20.227.133:57925,>,250-DSN,
    2015-01-15T16:42:11.826Z,SERVERNAME\Internet Receive SERVERNAME,08D1FEF1B5FADEE4,8,10.0.0.1:25,64.20.227.133:57925,>,250-ENHANCEDSTATUSCODES,
    2015-01-15T16:42:11.826Z,SERVERNAME\Internet Receive SERVERNAME,08D1FEF1B5FADEE4,9,10.0.0.1:25,64.20.227.133:57925,>,250-STARTTLS,
    2015-01-15T16:42:11.826Z,SERVERNAME\Internet Receive SERVERNAME,08D1FEF1B5FADEE4,10,10.0.0.1:25,64.20.227.133:57925,>,250-AUTH,
    2015-01-15T16:42:11.826Z,SERVERNAME\Internet Receive SERVERNAME,08D1FEF1B5FADEE4,11,10.0.0.1:25,64.20.227.133:57925,>,250-8BITMIME,
    2015-01-15T16:42:11.826Z,SERVERNAME\Internet Receive SERVERNAME,08D1FEF1B5FADEE4,12,10.0.0.1:25,64.20.227.133:57925,>,250-BINARYMIME,
    2015-01-15T16:42:11.826Z,SERVERNAME\Internet Receive SERVERNAME,08D1FEF1B5FADEE4,13,10.0.0.1:25,64.20.227.133:57925,>,250 CHUNKING,
    2015-01-15T16:42:12.609Z,SERVERNAME\Internet Receive SERVERNAME,08D1FEF1B5FADEE4,14,10.0.0.1:25,64.20.227.133:57925,<,MAIL FROM:<[email protected]>,
    To make sure I was talking to the expected receive connector I disabled the others and doubled my maximum message size.  I then tried checktls.com, same result:
    Trying TLS on mail.DOMAINNAME[184.69.225.118] (5):
    seconds test stage and result
    [000.206] Connected to server
    [000.322] <--
    220 remote.DOMAINNAME Microsoft ESMTP MAIL Service ready at Thu, 15 Jan 2015 09:45:17 -0700
    [000.322] We are allowed to connect
    [000.323] -->
    EHLO checktls.com
    [000.436] <--
    250-remote.DOMAINNAME Hello [69.61.187.232]
    250-SIZE 20971520
    250-DSN
    250 AUTH
    [000.437] We can use this server
    [000.437] TLS is not an option on this server
    [000.438] -->
    MAIL FROM:<[email protected]>
    As you can see it shows the new SIZE but the SmtpReceive logs again show it was sending STARTTLS: 
    2015-01-15T16:45:18.167Z,SERVERNAME\Internet Receive SERVERNAME,08D1FEF1B5FADEED,2,10.0.0.1:25,69.61.187.232:47498,>,"220 remote.DOMAINNAME Microsoft ESMTP MAIL Service ready at Thu, 15 Jan 2015 09:45:17 -0700",
    2015-01-15T16:45:18.390Z,SERVERNAME\Internet Receive SERVERNAME,08D1FEF1B5FADEED,3,10.0.0.1:25,69.61.187.232:47498,<,EHLO checktls.com,
    2015-01-15T16:45:18.390Z,SERVERNAME\Internet Receive SERVERNAME,08D1FEF1B5FADEED,4,10.0.0.1:25,69.61.187.232:47498,>,250-remote.DOMAINNAME Hello [69.61.187.232],
    2015-01-15T16:45:18.390Z,SERVERNAME\Internet Receive SERVERNAME,08D1FEF1B5FADEED,5,10.0.0.1:25,69.61.187.232:47498,>,250-SIZE 20971520,
    2015-01-15T16:45:18.390Z,SERVERNAME\Internet Receive SERVERNAME,08D1FEF1B5FADEED,6,10.0.0.1:25,69.61.187.232:47498,>,250-PIPELINING,
    2015-01-15T16:45:18.390Z,SERVERNAME\Internet Receive SERVERNAME,08D1FEF1B5FADEED,7,10.0.0.1:25,69.61.187.232:47498,>,250-DSN,
    2015-01-15T16:45:18.390Z,SERVERNAME\Internet Receive SERVERNAME,08D1FEF1B5FADEED,8,10.0.0.1:25,69.61.187.232:47498,>,250-ENHANCEDSTATUSCODES,
    2015-01-15T16:45:18.390Z,SERVERNAME\Internet Receive SERVERNAME,08D1FEF1B5FADEED,9,10.0.0.1:25,69.61.187.232:47498,>,250-STARTTLS,
    2015-01-15T16:45:18.390Z,SERVERNAME\Internet Receive SERVERNAME,08D1FEF1B5FADEED,10,10.0.0.1:25,69.61.187.232:47498,>,250-AUTH,
    2015-01-15T16:45:18.390Z,SERVERNAME\Internet Receive SERVERNAME,08D1FEF1B5FADEED,11,10.0.0.1:25,69.61.187.232:47498,>,250-8BITMIME,
    2015-01-15T16:45:18.390Z,SERVERNAME\Internet Receive SERVERNAME,08D1FEF1B5FADEED,12,10.0.0.1:25,69.61.187.232:47498,>,250-BINARYMIME,
    2015-01-15T16:45:18.390Z,SERVERNAME\Internet Receive SERVERNAME,08D1FEF1B5FADEED,13,10.0.0.1:25,69.61.187.232:47498,>,250 CHUNKING,
    2015-01-15T16:45:18.502Z,SERVERNAME\Internet Receive SERVERNAME,08D1FEF1B5FADEED,14,10.0.0.1:25,69.61.187.232:47498,<,MAIL FROM:<[email protected]>,
    I even tried a telnet session and it did the exact same thing.  Only thing that is different between the logs (other than the missing 250- entries is the "250-AUTH" has no dash in the telnet (and the other test sites) output which apprently is
    only done for the last line - not sure how that could change?? (or am I not looking at the right log?)
    Very confused as to how this can happen.  I have:
    - verified the certificates are OK, not expired, have the correct remote.DOMAINNAME name
    - checked the event logs, nothing
    - checked my firewall and it is setup to pass SMTP through for our server. 
    - tried disabling ESET for a bit and repeated tests - same result.
    - looks like TLS is working when we send emails based on SmtpSend logs, maybe with the self signed cert this is normal on receive?
    Anyone have any other ideas?  Thanks
    -- Al

    Figured it out, it was my firewall settings.  Its an older Untangle box that didn't support TLS, probably need to upgrade it but disabling SMTP filtering fixed the issue.
    Thanks
    -- Al

  • SharePoint 2013 Log in Pop up is coming randomly.

    The log-in pop up window is coming some time in the SharePoint 2013 Publishing site template although it has been configured as window authentication with NTLM. The user is able to see the site after cancel it. But main problem is why it is coming for domain
    user.
    The site has been added to local intranet zone in the Browser.
    Kindly refer to the below screen shot.
    Regards
    Anil thakur

    Is the URL the same as the .local address in the authentication prompt?  If it is not, you most likely have something on the page that is not using relative paths.  You could work around this by adding the address in the authentication prompt
    as an AAM to the site.
    MCITP-EA | "Never test how deep the water is with both feet"

  • Random mail arrival failure. SMTP log reports arrival, user never gets it

    Our 10.5.4 Mail server has become progressively less and less reliable over a period of months. I can reproduce repeatable (but inconsistent) instances of mails sent to us and failing to arrive. The weirdness even extends to emails sent from outside to multiple recipients on our server *in the same email*, and where some of the recipients get it and the others don't (while the non-recipients are randomly receiving other mails OK). Or, an external sender sending an email while I'm on the phone with him, it failing to arrive (and never does), and then a resend half an hour later arrives immediately.
    Needless to say, confidence in our mail server is plummeting.
    The OS-X Server mail log *actually records a mail arrival event* even when the user never gets the email, thus:
    Aug 6 13:15:42 dreadnought postfix/smtpd[14462]: connect from sonar.wycliffe.nsw.edu.au[192.168.9.100]
    Aug 6 13:15:42 dreadnought postfix/smtpd[14462]: 39D248C515F: client=sonar.wycliffe.nsw.edu.au[192.168.9.100]
    Aug 6 13:15:42 dreadnought postfix/cleanup[14464]: 39D248C515F: message-id=<[email protected].l ocal>
    Aug 6 13:15:42 dreadnought postfix/qmgr[100]: 39D248C515F: from=<[email protected]>, size=29520, nrcpt=1 (queue active)
    Aug 6 13:15:42 dreadnought postfix/smtpd[14462]: disconnect from sonar.wycliffe.nsw.edu.au[192.168.9.100]
    Aug 6 13:15:43 dreadnought postfix/smtpd[14471]: connect from localhost[127.0.0.1]
    Aug 6 13:15:43 dreadnought postfix/smtpd[14471]: 0BBFE8C5170: client=localhost[127.0.0.1]
    Aug 6 13:15:43 dreadnought postfix/cleanup[14465]: 0BBFE8C5170: message-id=<[email protected].l ocal>
    Aug 6 13:15:43 dreadnought postfix/qmgr[100]: 0BBFE8C5170: from=<[email protected]>, size=29969, nrcpt=1 (queue active)
    Aug 6 13:15:43 dreadnought postfix/smtpd[14471]: disconnect from localhost[127.0.0.1]
    Aug 6 13:15:43 dreadnought postfix/smtp[14466]: 39D248C515F: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.85, delays=0.01/0/0.01/0.83, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 0BBFE8C5170)
    Aug 6 13:15:43 dreadnought postfix/qmgr[100]: 39D248C515F: removed
    Aug 6 13:15:43 dreadnought postfix/pipe[14473]: 0BBFE8C5170: to=<[email protected]>, relay=cyrus, delay=0.23, delays=0.01/0/0/0.21, dsn=2.0.0, status=sent (delivered via cyrus service)
    Aug 6 13:15:43 dreadnought postfix/qmgr[100]: 0BBFE8C5170: removed
    ...and the upstream mail filter (sonar in this case, our virus and spam filter) corroborates that an email arrived as well. But, as I said, the user (me) +never got this email+. Numerous other users report the same experience. Some mails arriving at our mail server simply never get put into inboxes and disappear. Poof.
    The only lead I have is multiple instances of the following message in the console at (roughly) the same time as the mail arrival failure:
    *6/08/08 1:15:00 PM com.apple.launchd[1] (0x11a220.cron[14553]) Could not setup Mach task special port 9: (os/kern) no access.*
    I have taken to rebooting the server twice daily to reduce the frequency of these occurrences. The machine is a G5 XServe hosting 700 accounts in a School.

    In the log example quoted above, ignore all the http:// references. Apple's discussions software is assuming the square brackets in the log mean "insert URL"

  • How to delete Sharepoint Diagnostic log older than 5 months

    Hello , 
    How can I automate Sharepoint log deletion older than 5 months using powershell or C# code ?

    I ran across this code (frankly forgot where) a few years ago, originally to delete IIS logs, but I use if for everything.  It simply goes through each item in a folder and deletes by date.  I save the code below to a ps script, then call it with
    a batch file and schedule a task to run the batch file (reasoning is it is easier to schedule a task to run as a .bat file than .ps1.  Don't forget about changing the execution policy if you decide to use it on non-SharePoint servers as well.
    get-childitem -Path C:\inetpub\logs\LogFiles -recurse |
    where-object {$_.lastwritetime -lt (get-date).addDays(-7)} |
    Foreach-Object { del $_.FullName }

Maybe you are looking for