Skip to content

SPServiceIdentity

Yorick Kuijs edited this page Feb 19, 2019 · 13 revisions

SPServiceIdentity

Parameters

Parameter Attribute DataType Description Allowed Values
Name Key string The name of the service instance to manage
ManagedAccount Required string The user name of a managed account, LocalService, LocalSystem or NetworkService that will be used to run the service
InstallAccount Write PSCredential POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5

Description

Type: Distributed Requires CredSSP: No

This resource is used to specify a managed account to be used to run a service instance. You can also specify LocalService, LocalSystem or NetworkService as ManagedAccount. The name is the typename of the service as shown in the Central Admin website. This resource only needs to be run on one server in the farm, as the process identity update method will apply the settings to all instances of the service.

Examples

Example 1

This example shows how to set the SandBox Code Service to run under a specifed service account. The account must already be registered as a managed account.

Configuration Example 
    {
        param(
            [Parameter(Mandatory = $true)]
            [PSCredential]
            $SetupAccount
        )

 Import-DscResource -ModuleName SharePointDsc

        node localhost {
 
            SPServiceIdentity SandBoxUserAccount
            {
                Name           = "Microsoft SharePoint Foundation Sandboxed Code Service"
                ManagedAccount = "CONTOSO\SPUserCode"
                PsDscRunAsCredential = $SetupAccount
            }
        }
    }
Clone this wiki locally