Skip to content

SPServiceIdentity

dscbot edited this page Mar 17, 2023 · 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

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