Skip to content

Commit

Permalink
Create Patch-Servers-Windows-Updates.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
rswio authored Jan 26, 2025
1 parent d3a34d0 commit 54271e2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions System Management/Patch-Servers-Windows-Updates.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
$Servers = @("Server1", "Server2") # Replace with your server names

foreach ($Server in $Servers) {
Invoke-Command -ComputerName $Server -ScriptBlock {
Install-WindowsUpdate -AcceptAll -AutoReboot # Requires PSWindowsUpdate module
}
Write-Output "Patches installed on $Server"
}

0 comments on commit 54271e2

Please sign in to comment.