Unable to update service password remotely

Welcome Forums General PowerShell Q&A Unable to update service password remotely

This topic contains 0 replies, has 1 voice, and was last updated by  Forums Archives 7 years ago.

  • Author
  • #5706

    Points: 0
    Rank: Member

    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
    __RELPATH :
    __DERIVATION : {}
    __SERVER :
    __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.

The topic ‘Unable to update service password remotely’ is closed to new replies.