I have the following code which sucessfully stops a service on remote computer when run from the powershell console.
$Computer = "192.168.24.23"
$service = "Credential Checking LIVE"
Get-Service -ComputerName $Computer -name $service | Stop-Service
When i run this through a SQL Agent job the -ComputerName parameter is ignored.
Any ideas on why this would be and what i can do to rectify the problem?