$process= Get-Process -Name notepad -ComputerName server1
if($process)
{
schtasks /run /s dc.superdc.com /TN Service
}
else
{
Restart-Computer -Force -ComputerName server1
}
$process= Get-Process -Name notepad -ComputerName server2
if($process)
{
schtasks /run /s dc.superdc.com /TN Service
}
else
{
Restart-Computer -Force -ComputerName server2
}
No comments:
Post a Comment