How to change OSearch14 account (user)?

How to change search service account using SharePoint Central Administration

The simplest way to change the account of a service in SharePoint is to:

  1. Run Central Administrator
  2. Go to Security > Configure service accounts
  3. Select “Windows Service – SharePoint Server Search”
  4. In “Select an account for this component” select the account that you want and if it is not in the list, click “Register new managed account” and add it easily.

How to change search service account using PowerShell

But sometimes it’s not as easy as above to change a service account in SharePoint. For example you have installed SharePoint on a server for development whiout adding “Active Directory Domain Services” server role. In that case you can only add Managed Accounts through PowerShell and even though it won’t be displayed on managed account list in Central Administration and you can only use PowerShell to assign them to different services.

Step1 – Here is how to add a managed account in PowerShell:

First, go to the Start menu, then “Microsoft SharePoint 2010 Products” and run SharePoint 2010 Management Shell” which will run PowerShell and adds SharePoint Snapin so you can run SharePoit’s cmdlets. Now you can type the following commands:

$cred = Get-Credential  "Username"
New-SPManagedAccount -Credential $cred

Step 2 – How to assign it to OSearch14 (Enterprise Search):

$account = Get-SPManagedAccount -Identity "Username"
$procId = (Get-SPEnterpriseSearchService).get_ProcessIdentity()
$procId.CurrentIdentityType = "SpecificUser"
$procId.ManagedAccount = $account

Remember that the last line is important beacuse you won’t see any changes until this step. It actually restarts the service with the recently assigned account.


One response to “How to change OSearch14 account (user)?”

Leave a Reply

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

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

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: