Tuesday, July 26, 2011

Change Service Account Username & Password–PowerShell Script

This PowerShell script can be used to change the service account credentials remotely. 

Input – The input file (input.csv) contains server/computer name in the following format: 




Output – You will see the status on the screen as shown in the following screenshot:


Download – You can download this script from the following locations:

  1. www.sivarajan.com - http://www.sivarajan.com/scripts/Change_Service_Credentials.txt
  2. Microsoft TechNet Gallery - http://gallery.technet.microsoft.com/scriptcenter/79644be9-b5e1-4d9e-9cb5-eab1ad866eaf

More Scripts - http://portal.sivarajan.com/search?q=script+powershell&max-results=20


Is there a way for it to prompt for the password and then report the results in a csv file?

Sure. You can use Get-Credential cmdlet. See the logic from this script:


Hello Santhosh, Very Good Your Blog congratulations, could help me, I'm trying to heighten the credential for multiple services, it would be possible?

Thanks for the feedback Herbert Viana. What do you mean by "heighten the credential". Please provide more information here.

Change method is not working

Method invocation failed because [Selected.System.ServiceProcess.ServiceController] does not contain a method named 'change'.
At line:3 char:1
+ $sachin.change($null,$null,$null,$null,$null,$null,"sqldba/test","welcome@123",$ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (change:String) [], RuntimeException
+ FullyQualifiedErrorId : MethodNotFound

Post a Comment

Popular Posts


Twitter Delicious Facebook Digg Stumbleupon Favorites More