Wednesday, 24 February 2016

Testing purpose


$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

Powershell function to get theremote server IP details,Subnetmask,Gateway,DHCP Enabled status,DNS Servers,Wins and Macaddress

#Powershell function to get theremote server IP details,Subnetmask,Gateway,DHCP Enabled status,DNS Servers,Wins and Macaddress # use...