Powershell set username/pwd for windows services

enthuguy used Ask the Experts™
Hi Powershell experts,

Using Powershell, would like to set username/password for a list of services (service1, service2, service3, etc) in Windows 2016 servers.
Since, I will be invoking this from AWS CloudFormation, Is there a better way to handle the password pls?
after setting credentials on these services, we need to ensure it is running as well.  :)

please help

Thanks in advance
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
kevinhsiehNetwork Engineer

You should be using Managed Service Accounts or Group Managed Service Accounts for handling credentials of services.

Technical Specialist
Awarded 2017
Distinguished Expert 2018

$svc=gwmi win32_service -filter $service

Open in new window



Thanks kevinhsieh, yes it is a service account.

Thanks Shaun, will try this.

Is there a better way to handle/implement this pls?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial