Quantcast
Channel: SharePoint Diary
Viewing all articles
Browse latest Browse all 1058

Create New Managed Account in SharePoint 2013 Using Powershell

$
0
0
Managed accounts are active directory accounts for SharePoint's whose credentials are managed by SharePoint. Managed accounts in SharePoint 2013 is explained in my another article: Configuring Managed Accounts in SharePoint 2013.
Important: Before creating a managed account, They must be already created in your Active directory.
To register new managed account in SharePoint 2013, here are the steps:
  1. Open Central administration.
  2. Go Security >> Click on Configure Managed Accounts.
  3. Click the Register Managed Account link to create a new managed account.
  4. Enter the account’s AD username in domain\username format. Specify the account's password.
  5. Optionally, You can enable the automatic password reset.
  6. Click "OK" to to create managed account in SharePoint 2013.
    create managed account sharepoint 2013 powershell
Important: To register managed account SharePoint 2013, You must be a member of Farm Administrators SharePoint group.

To create a managed account using PowerShell: use the New-SPManagedAccount cmdlet. Here is how:
$cred = Get-Credential
New-SPManagedAccount –Credential $cred
This prompts to enter credentials and register managed account in SharePoint 2010/2013.

Register new managed accounts SharePoint 2013 in Bulk:
Lets create multiple Managed accounts in SharePoint 2013 in bulk:
Add-PSSnapin microsoft.sharepoint.powershell -ea SilentlyContinue

#Define a common password for all service accounts
$password = "Password1"
$securePassword = ConvertTo-SecureString -String $password -AsPlainText -Force

#List of Service accounts
$ServiceAccounts = "SP-Farm","SP_Services","SP_Search","SP_UserProfile"

ForEach ($Account in $ServiceAccounts)
{
#Get the account in Domain\UserName format
$userName = $env:USERDOMAIN + "\" + $Account
#Set the Credentials
$cred = New-Object System.Management.Automation.PSCredential -ArgumentList $username, $securePassword
#Create Managed Account
New-SPManagedAccount -Credential $cred
}
Here, I've specified a common password for all managed account. However, you  can specify different passwords for different service accounts.

Troubleshooting: 

Whiletrying to add managed account in SharePoint 2010 or in SharePoint 2013, You may encounter the below issues:

SharePoint register managed account access denied: unable to register managed account 
You may get access denied error when you try to register a managed account via Central Administration, You'll get this error: >> Security >> Configure Managed Account >> Register Managed Account.
  • Make sure either you are running SharePoint Management shell as administrator or UAC is disabled prior executing PowerShell cmdlets. 
  • Verify that your service account is allowed to change password from its properties -  “User cannot change password” !
  • if "Automatic Password reset" property is already enabled for your managed account, you may get "Access denied" error! Remove that existing account and crate a new one.
  • Use PowerShell to register new managed account!
SharePoint managed account requested registry access is not allowed:
Fix: Your Central administration App pool Identity must be a Farm Admin account also a LOCAL Administrator account

The given key was not present in the dictionary when register managed account in SharePoint 2013
Fix - KB: http://support.microsoft.com/kb/2463865/en-us

Viewing all articles
Browse latest Browse all 1058

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>