#RestartComputersbyOU.ps1 Import-Module ActiveDirectory $ou = “CN=Computers,DC=domain,DC=local” $computers = Get-ADComputer -Filter * -SearchBase $ou ForEach ( $c in $computers ) { Restart-Computer -ComputerName $c.name -Force }
Category: Computers
Dec 24 2014
Restart Computers in Sequential Order
Restarting servers is a necessary evil in a Windows administrator’s world. Unfortunately, you cannot not always just restart servers during maintenance as they may have a service dependent on another server. Due to this, you may need to restart your servers in sequential order. Luckily, powershell 3.0 makes this quite easy using the restart-computer commandlet. …