Files
Intune/dump/WSUS_Scripts/Old-Scripts/old-Patch-WSUSGroup.ps1

10 lines
602 B
PowerShell

$ErrorActionPreference = "Ignore"
$WSUSGroup = Read-Host "Enter Target Group Name"
$servers = Get-WsusComputer -ComputerTargetGroups "$WSUSGroup" -IncludeSubgroups|select Fulldomainname -ExpandProperty Fulldomainname
Foreach ($server in $servers) {Install-WindowsUpdate -ComputerName $server -AsJob}
#Function Restart {# Force Reboot of Group (when auto failed) un-rem and run line below.
#Foreach ($server in $servers) {Restart-Computer -ComputerName $server -Force}}
#Write-Host "Type Restart and press enter to reboot the $WSUSGroup WSUS Computer Group"
Read-Host -Prompt "Press Enter to exit"