Following script will start the service "Browser"
$sb={
$service=get-service browser
if ($Service.status -eq "Stopped") {
write-Host "Starting service on $env:Computername" -foreground Green
$service | Start-service -PassThru
}
else {
$service
}
}
To run the above script type following command:
invoke-command $sb -comp remotecomputername
Result will be as follows:
Hey, nice site you have here! Keep up the excellent work!
ReplyDeleteOnline Computer Support
Thanks Sailash
ReplyDelete