Modify a Service Account Password

Changes the service account password for any services running under the Netsvc account.

 
 
 
 
 
(0)
Add to favorites
Operating System
8/10/2009
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Service password change
    1 Posts | Last post August 30, 2010
    • The script to change the password for a running service does not seem to work. 
      
      strComputer = "."
      Set objWMIService = GetObject("winmgmts:" _
          & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
      
      Set colServiceList = objWMIService.ExecQuery _
          ("Select * from Win32_Service Where StartName = '.\\netsvc'")
      
      For Each objService in colServiceList
          errReturn = objService.Change( , , , , , , , "password")  
      Next
      
      
      
      In the above code what is netsvc? Is this the name of the service ot the service account logon name? I have tried both. It does not work. Can someone Clarify or help me?