How do I set the OSearch14 Service Account via PowerShell
-
09-12-2019 - |
Question
I'm in the process of Scripting a deployment of SharePoint 2010 and FAST.
Normally to set the Service Account of a SharePoint service one would use the ProcessIdentity property, like so:
$procId = (Get-SPSearchService).ProcessIdentity
$procId.CurrentIdentityType = "SpecificUser"
$procId.ManagedAccount = $myManagedAcount
$procId.Update()
This works a treat for the SearchService
object returned by Get-SPSearchService
, however the SearchService
object returned by Get-SPEnterpriseSearchService
has an additional ScriptProperty
that hides the ProcessIdentity
property, and returns it as a string, rather than an SPProcessIdentity
, which can't be updated.
So, The question:
Can I remove this ScriptProperty
? OR
Can I change the service account via PowerShell without access to the ProcessIdentity
Property?
Solution 3
You Need to Set the Managed Account Information and then Deploy for it to take affect.
$myManagedAccount = Get-SpManagedAccount -Identity "<Name of Account Here>"
$procId = (Get-SPEnterpriseSearchService).get_ProcessIdentity()
$procId.CurrentIdentityType = "SpecificUser"
$procId.ManagedAccount = $myManagedAcount
$procId.Update()
$procID.Deply()
Then this can be done after the Service has started :-)
OTHER TIPS
You should use .Deploy()
after .Update()
Seems to be tricky
according to this article :
there appear to be missing one key piece: setting the default content access account to some service account other than the SharePoint farm account.