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:
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”.