PowerShell script to auto approve WSUS updates for pilot and standard groups.

Recently there has been a need for me to create script that will cover auto approval work for WSUS.

So the idea was tu approve certain patches to pilot group, and after 2 weeks apply these on standard target group and do another pilot group approval for latest time span.

Important! WSUS target groups need to have “Standard” and “Pilot” in their names.

Lines of code that are worth mentioning:

## 64th LINE
## Specify time span between pilot and standard approvals, below is 14 days
$Next_Approval_Date_Raw = (Get-Date).AddDays(14)
...
## 106 - 108 LINE
## Specify the report file name and path
$CSVFileName = $range+"UpdateTimes.csv"
$CSVPath = 'c:\'
$CSVFile = "$CSVPath$CSVFileName"

So after specifying what period we like we just need to specify the file name and path and we are ready to go!

If we would like to show it on diagram it would look like:

przechwytywanie

Of course we may add many things to it’s functionality and this is just the very early version of the script. Worth adding might be – and probably will be added in future – a list of updates that were approved to particular target group – it s already there in “verbose” mode, adding possibility to choose the target groups by name other than “Server” or “Workstation”.

Script can be found on TechNet and GitHub.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s