I want to reboot specific servers, I am using findstr to find specific servers in the list of 1000's of servers, however, is there any way I can hardcode servernames in a script so the script only run on a particular set of remote servers? Also, how to use for each against array variable. For e.g is below method correct?
$serverlist = "server1,server2,server3"
for each ($server in $serverlist){ $serverboot= gwmi win32_operatingsystem -comp $server
$serverboot.Reboot
}