Creating or Re-Creating Managed Accounts (w/ Powershell)

When creating a farm using powershell, you need to create the managed accounts that your service applications will use.  Here’s a script written by Stephen Swinney, Rackspace Senior SharePoint Engineer that does just that!

 

Note: you could also use this script to re-create the managed accounts in a situation where they had been deleted.

 

This approach is much easier and cleaner than entering, New-SPManagedAccount, then manually having to type in the cryptic password and user account with domain\ prefix.