Enabling Enable-PSRemoting on Powershell 1.0 -
this in relation http://www.computerperformance.co.uk/powershell/powershell_remote.htm . currently, of machines in test environment on powershell 1.0. under such scenario, there way can still manage make remote calls via powershell 1 machine another. ultimate motive start/stop/restart windows service remotely using powershell.
you're not going able use powershell remoting in 1.0, can use wmi or .net servicecontroller task.
$s = get-wmiobject -computer $server -class win32_service -filter "name='$servicename'" $s.stopservice() $s.startservice()
in fact, if have 2.0 on client you're on, can skip couple of steps versus way it's written on either of posts using invoke-wmimethod:
invoke-wmimethod -name stopservice -computer $server -class win32_service -filter "name='$servicename'" invoke-wmimethod -name startservice -computer $server -class win32_service -filter "name='$servicename'"
note: general remoting, set ssh server on each box , remote in way (and set powershell default shell), /n software has pre-built solution around that.
Comments
Post a Comment