mikedopp

REstartMultiple

Jul 17th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. restart-computer (get-content c:\work\computers.txt)
  2. Start-Sleep -Seconds 300
  3. get-content c:\work\computers.txt | ForEach-Object
  4.     {
  5.     if(Test-Path "\\$($_)\`$ADMIN\win.ini")
  6.         {
  7.             Write-Output "$($_) Online"
  8.         }
  9.         else
  10.         {
  11.             Write-Output "$($_) Offline"
  12.         }
  13.     } |export-csv "C:\temp\results.csv"
Add Comment
Please, Sign In to add comment