Skip to content

SPUserProfileProperty

dscbot edited this page Mar 17, 2023 · 18 revisions

SPUserProfileProperty

Parameters

Parameter Attribute DataType Description Allowed Values
Name Key String The internal name of the user profile property
Ensure Write String Present if the property should exist, absent if it should be removed Present, Absent
UserProfileService Required String The name of the user profile service application
DisplayName Write String The display name of the property
Type Write String The type of the property Big Integer, Binary, Boolean, Date, DateNoYear, Date Time, Email, Float, HTML, Integer, Person, String (Single Value), String (Multi Value), TimeZone, Unique Identifier, URL
Description Write String The description of the property
PolicySetting Write String The policy setting to apply to the property Mandatory, Optin, Optout, Disabled
PrivacySetting Write String The privacy setting for the property Public, Contacts, Organization, Manager, Private
PropertyMappings Write MSFT_SPUserProfilePropertyMapping[] The details about the property mapping
Length Write UInt32 The length of the field
DisplayOrder Write UInt32 The display order to put the property in to the list at
IsEventLog Write Boolean Is this field used for event logging
IsVisibleOnEditor Write Boolean Is this field visible when editing a users profile, or hidden from editing
IsVisibleOnViewer Write Boolean Is this field visible when viewing a users profile
IsUserEditable Write Boolean Is this field able to be edited by a user, or only an administrator
IsAlias Write Boolean Is this field an alias that can be used to refer to a user by
IsSearchable Write Boolean Is this field able to be searched upon
IsReplicable Write Boolean Is this field replicated to Microsoft SharePoint Foundation 2010 sites
UserOverridePrivacy Write Boolean Can users override the default privacy policy
TermStore Write String The name of the term store to look up managed terms from
TermGroup Write String The name of the term store group that terms are in for this field
TermSet Write String The name of the term set to allow values to be selected from

MSFT_SPUserProfilePropertyMapping

Parameters

Parameter Attribute DataType Description Allowed Values
ConnectionName Required String The name of the UPS connect to map this property to
PropertyName Required String The name of the property from the UPS connection to map to
Direction Required String The direction of the mapping, either Import or Export Import, Export

Description

Type: Distributed Requires CredSSP: No

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

The parameter DisplayOrder is absolute. ie.: If you want it to be placed as the 5th field of section Bla, which has propertyName value of 5000 then your DisplayOrder needs to be 5005. If no DisplayOrder is added then SharePoint adds it as the last property of section X.

Length is only relevant if Field type is "String".

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

Examples

Example 1

This example deploys/updates the WorkEmail2 property in the user profile service app

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

    Import-DscResource -ModuleName SharePointDsc

    node localhost
    {
        SPUserProfileProperty WorkEmailProperty
        {
            Name                 = "WorkEmail2"
            Ensure               = "Present"
            UserProfileService   = "User Profile Service Application"
            DisplayName          = "Work Email"
            type                 = "Email"
            Description          = "" #implementation isn't using it yet
            PolicySetting        = "Mandatory"
            PrivacySetting       = "Public"
            PropertyMappings     = @(
                MSFT_SPUserProfilePropertyMapping {
                    ConnectionName = "contoso.com"
                    PropertyName   = "mail"
                    Direction      = "Import"
                }
            )
            Length               = 10
            DisplayOrder         = 25
            IsEventLog           = $false
            IsVisibleOnEditor    = $true
            IsVisibleOnViewer    = $true
            IsUserEditable       = $true
            IsAlias              = $false
            IsSearchable         = $false
            IsReplicable         = $false
            TermStore            = ""
            TermGroup            = ""
            TermSet              = ""
            UserOverridePrivacy  = $false
            PsDscRunAsCredential = $SetupAccount
        }
    }
}
Clone this wiki locally