How to set the identity of a SharePoint Windows Service, e.g. “SharePoint Server Search”

I have had the problem to set the SharePoint Sevice Account of "SharePoint Server Search" to a special user account during a automatic setup.

In other words: I want to automate this step:

Central Administration -> Security -> Configure Service Accounts

blog-201011030017

There is no PowerShell command as far as I can see.

You can use this script for this job:

  

$farm =(Get-SPFarm)

$farm.get_Services() | ? { $_.typename -ieq "SharePoint Server Search" } | % {

  $searchservice=$_

  $i = $searchservice.get_ProcessIdentity()

  $i.set_CurrentIdentityType(3)

  $i.set_Username($searchUser)

  $i.Update()

  $i.Deploy()

}

One thought on “How to set the identity of a SharePoint Windows Service, e.g. “SharePoint Server Search”

Leave a Reply

Your email address will not be published. Required fields are marked *

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