Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
With this powershell script you will be able to change the user name and password of any Windows service. It can work against 1 or more services at the same time. The process will stop the service before changing the credentials and it will start it aftet. If the service is not running before the change, the service will not be started neither.
All parameters are mandatory. If you don’t provide them, powershell will ask you to provide them.
This is an output example:
This was an attempt to change the user and password of all Windows services starting by MSSQL.
Changing the user and pasword of all BizTalk host instances:
.\changeUser.ps1 -UserName .\Administrator -Password admPwd -Service 'BTSSVC%' –ServerN ServerA -SecondsToWait 2
Changing the user and pasword of the SQL Server Agent:
.\changeUser.ps1 -UserName .\Administrator -Password admPwd –Service ' SQLSERVERAGENT' –ServerN ServerA –SecondsToWait 2
You can download the code here, at MSDN Code Gallery.
Please sign in to use this experience.
Sign in