Scheduling Windows Tasks remotely

My company is switching from using Symantec Antivirus over to F-Secure, and we needed a way to silently uninstall the existing Symantec installation before rolling out the new solution to avoid a sneakernet installation procedure. Our initial thought was to add the uninstall procedure to the existing logon script, but that would cause a fair bit of problems as the uninstall required a reboot. I know my users would get very cranky if they logged on and the computer immediately rebooted. Another issue would be that the same logon script is executed when the users login to our Citrix servers, but I could work around that by checking the computername that the script ran on. We ended up with the following solution:
  • 1. Create a share on the fileserver for uninstall logs
  • 2. Create a batch file that silently uninstalls Symantec Antivirus and reboots the computer
  • 3. Schedule the batch file to run, on the client computer, after hours
The command to uninstall our version of Symantec Antivirus would be: %windir%\system32\msiexec.exe /q/x {848AC794-8B81-440A-81AE-6474337DB527} /Lv+ \\fileserver\share\%computername%-savuninstall.log This performs a silent uninstall of the application identified by the GUID, and logs the process to a logfile named after the computer it was ran on. The second part of this was scheduling this batch file to be run on our XP clients remotely. A small utility called schtasks, included in Windows XP, enables you to add scheduled tasks remotely and fit the bill perfectly. The command we ended up running was: schtasks /create /tn "Symantec Uninstall" /ru domain\administrator /rp password /tr \\fileserver\share\uninstall.bat /s computername /sc once /sd 29/01/2007 /st 22:00 This adds the batch file created earlier as a once-off scheduled task, on the client, that runs as the domain administrator. The log files enables us to track the progress of client uninstall, and provides us with a list of computers ready for F-Secure deployment. All in all a no-fuzz silent removal of Symantec Antivirus, without sneakernet intervention.

Posted by Christian Mohn aka h0bbel

Post metadata


Published January 30, 2007 13:00
0 comments

Tagged with , , , , , , , and


0 Responses to Scheduling Windows Tasks remotely:

  • There are currently no comments.

0 Pingbacks to Scheduling Windows Tasks remotely:

  • There are currently no pingbacks.

Leave a Reply


Contact me

Lets talk!
Get in touch