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!

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 *