Skip to content

SPUserProfileSection

Yorick Kuijs edited this page Nov 13, 2020 · 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
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 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