SharePoint 2013 – Delete User Profile Property using Powershell
SharePoint 2013 – Delete User Profile Property using Powershell
In case you need to delete multiple User Profile properties in SharePoint at once or if you can’t delete an property via GUI Central Administration then you can use the following Powershell code:
Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue $site = Get-SPSite "http://<server>:<port>" $context = Get-SPServiceContext($site) $upcm = New-Object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager($context) $cm = $upcm.ConnectionManager $pdtc = $upcm.GetPropertyDataTypes() $ppm = $upcm.ProfilePropertyManager $cpm = $ppm.GetCoreProperties() $ptpm = $ppm.GetProfileTypeProperties([Microsoft.Office.Server.UserProfiles.ProfileType]::User) $psm = [Microsoft.Office.Server.UserProfiles.ProfileSubTypeManager]::Get($context) $ps = $psm.GetProfileSubtype([Microsoft.Office.Server.UserProfiles.ProfileSubtypeManager]::GetDefaultProfileName([Microsoft.Office.Server.UserProfiles.ProfileType]::User)) $pspm = $ps.Properties # Remove User Profile Property by Name $cpm.RemovePropertyByName("PropertyName")