Saturday, May 28, 2016

Automate WSUS clenup in Windows Server 2012 R2

You should run WSUS cleanup regulary to keep the WSUS database healthy.
There is a script available to run WSUS cleanup as scheduled task available here https://gallery.technet.microsoft.com/scriptcenter/WSUS-Server-Cleanup-f33d2658.

Unfortunately it doesn't work as expected on Windows Server 2012 R2.
To make it work on Windows Server 2012 R2 you should use follwoing command line:

PowerShell.exe -Command "& {Start-Process PowerShell.exe -ArgumentList '-ExecutionPolicy Bypass -File ""path-to-script\Start-WsusServerCleanup.ps1""' -Verb RunAs}"

No comments:

Post a Comment