Skip to content

Instantly share code, notes, and snippets.

@ddamko
Created March 23, 2016 15:43
Show Gist options
  • Save ddamko/2b7b88e167d0e18aa573 to your computer and use it in GitHub Desktop.
Save ddamko/2b7b88e167d0e18aa573 to your computer and use it in GitHub Desktop.
$computers = (gc C:\Users\winuser\scripts\computers.txt).split(",")
foreach ($computer in $computers) {
if (Test-Connection -ComputerName $computer) {
$session = New-PSSession -ComputerName $computer
Invoke-Command -Session $session -ScriptBlock {
Start-ScheduledTask "StartKiosk"
} -AsJob
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment