1

I need to Rename, make editable, and show the existing userprofile property in User's Profile page by using PowerShell scripts, I tried this:

if ((Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null)
    {
        Add-PsSnapin Microsoft.SharePoint.PowerShell
    }


    $siteUrl = "http://Test/"

    $site = Get-SPSite $siteUrl
    $context = Get-SPServiceContext($site)


    $profileConfigMgr = New-Object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager($context) 
    $profilePropMgr = $profileConfigMgr.ProfilePropertyManager
    $subtypePropMgr = $profilePropMgr.GetProfileSubtypeProperties("UserProfile")
    $subtypeProp = $subtypePropMgr.GetPropertyByName("Department")
    $coreProp = $subtypeProp.CoreProperty
    $typeProp = $subtypeProp.TypeProperty
    $subtypeProp.IsUserEditable = $true
    $subtypeProp.IsVisibleOnViewer = $true

    $subtypeProp.Commit()

but I can't.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.