0

I wanted to edit the Account Name (login) for a single user in our on-premises farm, so I went to User Profile Properties in SharePoint central admin, found the Account Name property and in Edit settings I set "Allow users to edit values for this property"

I was able to make the update fine. I then changed the Account Name edit setting back to "Do not allow users to edit values for this property", but found that I was still able to update the Account Names for users (to begin with I wasn't able to, changing the edit settings was necessary).

With the following script I was able to determine that the IsAdminEditable property of AccountName was still true. IsUserEditable is false.

    $site = Get-SPSite http://mycentraladmin:port
    $serviceContext = Get-SPServiceContext $site
    $upm = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($serviceContext)
    $accountNameProperty = $upm.Properties | where { $_.Name -eq "AccountName" } 
    $accountNameProperty.IsAdminEditable
    $accountNameProperty.IsUserEditable

IsAdminEditable is readonly here. My question is how can I set it back to false and make Account Name uneditable for both admins and users.

1

There's no supported way to change this, so my suggestion would be just to use T-SQL to make the modification.

USE [ProfileDB]
UPDATE dbo.ProfileSubtypePropertyAttributes SET IsAdminEditOnly = 0, IsEditable = 0 WHERE PropertyId = 3;
  • Does editing the ProfileDB put SharePoint in an unsupported state for Microsoft,, as for Content Databases? – VB Did Nothing Wrong Jul 6 '16 at 19:41
  • Technically, yes. The other way to go about this is Reflection, also unsupported and more complicated. What I would suggest is opening up a PSS case. They can then "approve" any otherwise unsupported methods, such as direct T-SQL edits/Reflection. – Trevor Seward Jul 6 '16 at 19:42

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.