Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the 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

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