Skip to content

SPUserProfileServiceApp

Brian Farnhill edited this page Jul 3, 2017 · 20 revisions

Parameters

Parameter Attribute DataType Description Allowed Values
Name Key string The name of the user profile service
ProxyName Write string The proxy name, if not specified will be /Name of service app/ Proxy
ApplicationPool Required string The name of the application pool to run the service app in
FarmAccount Write String The farm account to use when provisioning the app
MySiteHostLocation Write string The URL of the my site host collection
ProfileDBName Write string The name of the profile database
ProfileDBServer Write string The name of the server to host the profile database
SocialDBName Write string The name of the social database
SocialDBServer Write string The name of the database server to host the social database
SyncDBName Write string The name of the sync database
SyncDBServer Write string The name of the database server to host the sync database
EnableNetBIOS Write boolean Whether Farm should resolve NetBIOS domain names
NoILMUsed Write boolean Specifies if the service application should be configured to use AD Import
Ensure Write string Present if the service app should exist, absent if it should not Present, Absent
InstallAccount Write String POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5

Description

This resource will provision an instance of the user profile service to the farm. It creates the required databases using the parameters that are passed in to it (although these are only used during the initial provisioning). The farm account is used during the provisioning of the service only (in the set method), and the install account is used in the get and test methods. This is done to ensure that the databases are created with the correct schema owners and allow the user profile sync service to operate correctly.

The default value for the Ensure parameter is Present. When not specifying this parameter, the service application is provisioned.

Examples

Example 1

This example adds a new user profile service application to the local farm

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

        [Parameter(Mandatory = $true)]
        [PSCredential]
        $FarmAccount
    )
    Import-DscResource -ModuleName SharePointDsc

    node localhost {
        SPUserProfileServiceApp UserProfileServiceApp
        {
            Name                 = "User Profile Service Application"
            ApplicationPool      = "SharePoint Service Applications"
            MySiteHostLocation   = "http://my.sharepoint.contoso.local"
            ProfileDBName        = "SP_UserProfiles"
            ProfileDBServer      = "SQL.contoso.local\SQLINSTANCE"
            SocialDBName         = "SP_Social"
            SocialDBServer       = "SQL.contoso.local\SQLINSTANCE"
            SyncDBName           = "SP_ProfileSync"
            SyncDBServer         = "SQL.contoso.local\SQLINSTANCE"
            EnableNetBIOS        = $false
            FarmAccount          = $FarmAccount
            PsDscRunAsCredential = $SetupAccount
        }
    }
}

Example 2

This example adds a new user profile service application to the local farm

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

        [Parameter(Mandatory = $true)]
        [PSCredential]
        $FarmAccount
    )
    Import-DscResource -ModuleName SharePointDsc

    node localhost {
        SPUserProfileServiceApp UserProfileServiceApp
        {
            Name                 = "User Profile Service Application"
            ApplicationPool      = "SharePoint Service Applications"
            MySiteHostLocation   = "http://my.sharepoint.contoso.local"
            ProfileDBName        = "SP_UserProfiles"
            ProfileDBServer      = "SQL.contoso.local\SQLINSTANCE"
            SocialDBName         = "SP_Social"
            SocialDBServer       = "SQL.contoso.local\SQLINSTANCE"
            SyncDBName           = "SP_ProfileSync"
            SyncDBServer         = "SQL.contoso.local\SQLINSTANCE"
            EnableNetBIOS        = $false
            NoILMUsed            = $true
            FarmAccount          = $FarmAccount
            PsDscRunAsCredential = $SetupAccount
        }
    }
}
Clone this wiki locally