creating managed accounts with powershell

A Basic script that allows you to create the Managed Account with PowerShell.

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$AllAccounts = @("Contoso\Svc_SPFarm","Contoso\Svc_SPSearch","Contoso\svc_SPSvcApp","Contoso\Svc_SPWebApp", "Contoso\Svc_SPUsrProf", "Contoso\Svc_SPSecStor")
foreach($anAccount in $AllAccounts)
{
    $account = New-Object System.Management.Automation.PSCredential $anAccount, (ConvertTo-SecureString “P’@’$’$word” –AsPlainText –Force)
    $managedAccount = New-SPManagedAccount $account
}
Get-SPManagedAccount | Select UserName
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s