Link to home
Start Free TrialLog in
Avatar of Dan
DanFlag for United States of America

asked on

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.
Avatar of Dan
Dan
Flag of United States of America image

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of Peter Hutchison
Peter Hutchison
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dan

ASKER

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
Just change the following line from:
strFolderName = "C:\WINDOWS\system32\LogFiles"
to
strFolderName = "C:\inetpub\logs\LogFiles"
Avatar of Dan

ASKER

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?
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
Avatar of Dan

ASKER

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?
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'
Avatar of Dan

ASKER

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.