Skip to content

SPUserProfileSection

dscbot edited this page Mar 17, 2023 · 17 revisions

SPUserProfileSection

Parameters

Parameter Attribute DataType Description Allowed Values
Name Key String The internal name of the user profile section
Ensure Write String Present if the section should exist, absent if it should be removed Present, Absent
UserProfileService Required String The name of the user profile service application this section exists in
DisplayName Write String The display name of the section
DisplayOrder Write UInt32 A number used to sort sections by

Description

Type: Distributed Requires CredSSP: No

This resource will create a section in a user profile service application. It creates, update or delete a section using the parameters that are passed in to it.

If no DisplayOrder is added then SharePoint will automatically assigned an ID

The default value for the Ensure parameter is Present. When not specifying this parameter, the user profile section is created.

Examples

Example 1

This example adds a new section for profile properties to the specified user profile service app

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

    Import-DscResource -ModuleName SharePointDsc

    node localhost
    {
        SPUserProfileSection PersonalInformationSection
        {
            Name                 = "PersonalInformationSection"
            UserProfileService   = "User Profile Service Application"
            DisplayName          = "Personal Information"
            DisplayOrder         = 5000
            Ensure               = "Present"
            PsDscRunAsCredential = $SetupAccount
        }
    }
}
Clone this wiki locally