Salaudeen Rajack

Salaudeen Rajack - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time 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

Your email address will not be published. Required fields are marked *