Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

2 thoughts on “Update User Profile Properties in SharePoint using PowerShell

  • Hello, Thanks ! This is the only!!! scripts that works within 1 million scripts I found in the net
    To be exact Im looking for a script to change a property for all user, but none seems to work 🙁
    Any suggestions?

    Reply
    • Simple! Here is how to iterate through all user profiles:

      #Parameter
      $SiteURL = "https://portal.crescent.com"
       
      #Get Objects
      $ServiceContext  = Get-SPServiceContext -site $SiteURL
      $UPM = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($ServiceContext)
       
      #Get All User Profiles
      $UserProfiles = $UPM.GetEnumerator()
      Write-host "Total Number of User Profiles found:"$UserProfiles.Count
       
      #Iterate through each profile
      foreach ($Profile in $UserProfiles)
      {
          #Do Something
      }
      
      Reply

Leave a Reply