About
Pricing
Community
Teams
Start Free Trial
Log in
Scotch Tech
asked on
3/24/2017
Exchange 2013 - Scheduled task to clear IIS logs
I've seen several different ways to do this. I just want a simple script to clear out logs older than 30days to run daily.
I don't see an option with the Remove-Item cmdlet.
Exchange
Powershell
2
1
Last Comment
Scotch Tech
8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Chris Dent
3/24/2017
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Scotch Tech
3/24/2017
ASKER
awesome, I actually found this as well and tested:
Get-ChildItem -Path "C:\inetpub\logs\LogFiles\
W3SVC1" -File | Where CreationTime -lt (Get-Date).AddDays(-30) | Remove-Item -Force
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Get-ChildItem -Path "C:\inetpub\logs\LogFiles\