forEach ($computer in $computers) {
if (!(test-Connection -Cn $computer -quiet)) {
psexec.exe “\”%$computer% net localgroup users’
} else {
Write-Host $computer is not online
}
}
and I would also like each computer name to be in a text file >> c:%cn%.txt
One of the reason I am not using powershell remoting is because the company I work for does not understand the power of powershell so I have to use workarounds.