Unable to update service password remotely

by mukkollu at 2013-03-21 15:11:13

I wrote the below script to change password for "test" service on windows 2003 64-bit server "server1". I am running this script on windows 7 64-bit machine. It always throws the below error status.

[code2=powershell]$newPass = Read-Host "Enter Password"
$sn = "test"
$fl = 'Name=' + "'" + $sn + "'" + ''
$service = Get-WMIObject -ComputerName "server1" -class Win32_Service -Filter $fl

__GENUS : 2
__PATH :
ReturnValue : 22

I am able to remotely start and stop the same service.

by ps_gregg at 2013-03-21 21:22:18
Hi SM,

A Return Value 22 equals "Status Invalid Service Account". So the first thing I would check your is the $Acct variable. Is it populated with a valid service account? Does the variable contain the domain like "DOMAIN\ServiceAcct".

by mukkollu at 2013-03-22 08:53:45
So silly, I missed the domain part. Thanks Gregg.