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!

13 thoughts on “Get and Export User Profile Properties using PowerShell in SharePoint Server

  • For my particular problem, we need to do a mass email update. We have a spreadsheet with old emails and new emails. However, our script is not working, so we then decided to use your script just to see what we get. I ran your script and the console output a bunch of “1’s”, also, the UserProfiles.csv file is empty. Any suggestions?

    Reply
  • Thanks for this. Another question How can I show empty value in double quotes? Currently it shows comma separated by no quotes.

    Reply
  • Hi, I am new to powershell – can you please advise how can I add an exclusion filter to this script? e.g. If I want to exclude results that have no employee numbers in their user profile.

    Reply
    • In Line#19, Just Replace: foreach ($Profile in $UserProfiles) with foreach ($Profile in $UserProfiles | Where {$_[“EmployeeNumber”] -ne $NULL}) – as a note, the EmployeeNumber field must be mapped to import from AD!

      Reply
  • I just tried to run this on my on-prem 2013 farm. The Total Number of Profiles found output as 1 1 1 1 1 1 1 1 1 1…

    It created the CSV file but didn’t populate it with any profile information. Any ideas?

    Reply
    • I have the same issue

      Reply
    • Same for me. Was there any solution

      Reply
      • In my case the code section counting the profiles didn’t work for me. I commented it out:

        #Get All User Profiles
        $UserProfiles = $UPM.GetEnumerator()
        # Write-host “Total Number of User Profiles found:”$UserProfiles.Count

        Reply
  • How to get list of “User Profiles Missing from Import”

    Reply
  • Should this work in SP2016? I have run the script and am getting a blank CSV

    Reply
  • if i want the output in a sharepoint list with 5 columns (firstname, lastname, workemail, jobtitle, workphone), where i need to make changes

    Reply
    • Replace the below lines between Line#: 23 to 27.
      $ProfileData | Add-Member -MemberType NoteProperty -name “Account” -value $Profile[“FirstName”]
      $ProfileData | Add-Member -MemberType NoteProperty -name “Display Name” -value $Profile[“LastName”]
      $ProfileData | Add-Member -MemberType NoteProperty -name “E-Mail” -value $Profile[“WorkEmail”]
      $ProfileData | Add-Member -MemberType NoteProperty -name “Manager” -value $Profile[“Title”]
      $ProfileData | Add-Member -MemberType NoteProperty -name “Department” -value $Profile[“Department”]

      Reply

Leave a Reply

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