Link to home
Start Free TrialLog in
Avatar of MSSC_support
MSSC_supportFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Schedule an exchange shell task to clear log files

I have a exchange shell script that I run manually to clear out a bunch of log files that are created by exchange which eats up storage space on our environment.

Unfortunately, I cannot get this to work as a scheduled task as it keeps failing. Can anyone guide me to help automate this?
Avatar of Colin McDonald
Colin McDonald

Can you provide details of the error received when running the scheduled task?

Can you provide screen shots of task settings
Avatar of MSSC_support

ASKER

Ok.  At the moment I have it configured to run whether user is logged on or not and with highest privileges.

The program/script is set to:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

and argument:

-NonInteractive -WindowStyle Hidden -command ". 'C:\Program Files\Microsoft\Exchange Server\V15\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto; 'C:\Purge Logs\Purge-LogFiles keep 7 days.ps1'"

The error message i get is 0x0.

Hope this helps.
Avatar of David Johnson, CD
a return of 0 normally means success, non zero means failure. Have you tried circular logging or getting an exchange aware backup
ASKER CERTIFIED SOLUTION
Avatar of VB ITS
VB ITS
Flag of Australia 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
This works but is slightly more risky.