Skip to content

SPUserProfileProperty

Yorick Kuijs edited this page Jun 13, 2018 · 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
MappingConnectionName Write string The name of the UPS connect to map this property to
MappingPropertyName Write string The name of the property from the UPS connection to map to
MappingDirection Write string The direction of the mapping, either Import or Export
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
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
InstallAccount Write PSCredential POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5

Description

Type: Distributed

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".

This Resource doesn't currently support removing existing user profile

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"
                MappingConnectionName = "contoso.com"
                MappingPropertyName = "mail"
                MappingDirection = "Import"
                Length = 10
                DisplayOrder =25 
                IsEventLog =$false
                IsVisibleOnEditor=$true
                IsVisibleOnViewer = $true
                IsUserEditable = $true
                IsAlias = $false 
                IsSearchable = $false 
                TermStore = ""
                TermGroup = ""
                TermSet = "" 
                UserOverridePrivacy = $false
                PsDscRunAsCredential = $SetupAccount
            }
        }
    }
Clone this wiki locally