Service.SetLogon
Top  Previous  Next


Changes service account / password

Category
Service

Script section
All

Service.SetLogon ServiceName, ServiceAccount, ServicePassword

ServiceName
Name of service to manage  

ServiceAccount
Service account name - Format: DomainName\UserName, use "LocalSystem" to select "System Account"  

ServicePassword
Service password (ignored when "LocalSystem" is specified above)  

Other parameters
This command is executed on the current machine in the [Machines] section.  

Important
·If you change service account, remember to give the new account that you are using sufficient permissions and rights (file permissions, right "Log on as a service" etc.).  
·Before using this command, make sure that you know the account name and password of the old service account - if anything goes wrong you will need it.  

Tip
Also have a look at the NTreport example List all services that uses a service account.

Example
Set service account to "steve" in domain "d26" and password to "asji399sd-X" for the schedule service on machine \\edu12.

Put "\\edu12" in the [machines] section

Add this line to the [batch] section:

Service.SetLogon Schedule,d26\steve,asji399sd-X

Full example
Change service password on many machines at once