exchange 2013 log files

I'm running exchange 2013 and on my OS drive, my C drive, I'm running out of space.
After doing some digging, I came across this folder that has like 15GB of files.

C:\inetpub\logs\LogFiles\W3SVC2

Are these files needed?  Can I delete them?  Can they be deleted on a monthly basis?
They look like IIS logs, so I'm trying to think why I would need them?
Do they provide assistance if let's say someone can't log in to OWA or something?

Thanks.
DanNetwork EngineerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DanNetwork EngineerAuthor Commented:
Also, how about this location, can they be safely deleted, perhaps anything older than 1 month?

C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Temp
0
Peter HutchisonSenior Network Systems SpecialistCommented:
Yes, any log file can be deleted in c:\inetpub\logs. Also, try running a script monthly to clear ouut old logs, say older than 30 days:

For example use and modify this script and schedule it to run every week or so:
http://community.spiceworks.com/scripts/show/884-iis-log-cleanup-script
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DanNetwork EngineerAuthor Commented:
I'll just create a batch file, because I've never worked with vbscript, and not sure exactly what to change in the script.
Thanks
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Peter HutchisonSenior Network Systems SpecialistCommented:
Just change the following line from:
strFolderName = "C:\WINDOWS\system32\LogFiles"
to
strFolderName = "C:\inetpub\logs\LogFiles"
0
DanNetwork EngineerAuthor Commented:
So that's it, there's nothing else in the script that needs changing?

Also, how do I run it?  Do I just use task scheduler to schedule the script to run?
Does this script actually delete anything older than 1 month, where can I make changes to the script in that regards?
0
Peter HutchisonSenior Network Systems SpecialistCommented:
Yes, just copy the file as a vbs file to a script folder on the server then set up a Scheduled Task and run it under a local administrator account which will have rights over the folder. If you want to change the number of days to keep, just change the following line:
Const MaxDays = 30
0
DanNetwork EngineerAuthor Commented:
ok, got it, so if i double click on the file, it runs fine, and deletes the files, but when I schedule it using the task scheduler, it says it's running, but it's not, because it doesn't do anything for minutes.

If I double click on it, in a second, it deletes the files.

So how do I get the task scheduler to actually run the file?
0
Peter HutchisonSenior Network Systems SpecialistCommented:
A couple of things:
1. Make sure task is set to 'Run where user is logged on or not'
2. Make sure task is set to 'Run with highest privileges'
0
DanNetwork EngineerAuthor Commented:
Thanks Peter for your help.  Since that didn't work, I couldn't get the task scheduler to automatically start the script, I just used a batch file I had, modified it to my location and it does the job.

Thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.