Skip to content

Expiscornovus

Discover the new

Follow @Expiscornovus


My name is Dennis. I am Dutch and I live and work in the UK as an IT consultant. Currently I work a lot with SharePoint online, Microsoft Teams and all the other products of the Office 365 platform. I also like my share of Dynamics 365 and Azure. I try to blog about everything I come across in my daily job. All the content in my blogs are my personal views and experiences.

Tag: PowerShell

SharePoint 2010: How to Register Managed Accounts via PowerShell

Title

Register Managed Accounts in SharePoint 2010 via PowerShell

Business Goal

In SharePoint 2010 there is a concept called Managed Accounts. You are able to register Active Directory accounts which you can manage via the SharePoint 2010 interface (via Security > General Security > Configure Managed Accounts).

A managed account can have different advantages:
– Credentials are managed and maintained by SharePoint
– When you use a managed account when registering a new Service Application you don’t need to know the credentials

This article describes how to register managed accounts in bulk.

Technical Overview

The solution is just one PowerShell script that uses new-SPManagedAccount cmdlet of SharePoint 2010 Management Shell. It uses the Import-CSV cmdlet to import a csv file in bulk.

Prerequisites

To complete this how-to, you must have the following prerequisites must be met:
– A domain account that can log on to one of the SharePoint 2010 servers
– A domain account that has privileges to manage SharePoint 2010 via PowerShell (SPShellAdmin role)

Steps

1. Create a csv file with two columns, UserName and Password
2. Run the Powershell script in SharePoint 2010 Management Shell via the following command .\new_managedaccounts.ps1

new_managedaccounts.ps1
PowerShell
1
2
3
4
5
6
Import-CSV .\managedaccounts.csv | ForEach-Object {
$username = $_.UserName
$password = $_.Password | ConvertTo-SecureString -asPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential($username,$password)
new-SPManagedAccount -Credential $credential
}

Additional resources

Bill Baer – Managed Accounts
Gallery Technet – Create New Managed Accounts
Technet – Configure automatic password change (SharePoint Server 2010)
Technet – Get-SPShellAdmin
Technet – New-SPManagedAccount
Technet – Import-CSV

Applies to

SharePoint 2010

Change History

23-06-2014 – 1.0

Posted on July 11, 2014March 28, 2015Categories PowerShell, SharePoint 2010Tags Codesnippet, Csv, Managed Account, Password, PowerShell, SharePoint 20101 Comment on SharePoint 2010: How to Register Managed Accounts via PowerShell

Posts navigation

Previous page Page 1 Page 2
Proudly powered by WordPress