0

I'd like to have a list of all users with all of their user profile properties. How can this be done with PowerShell?

1 Answer 1

2

This works for me. Also, you can check this post.

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue;
cls
$url = "http://sharepointsite/sites/dev"
$site = Get-SPSite $url
$context = Get-SPServiceContext $site
$profileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($context)
$profiles = $profileManager.GetEnumerator()

while ($profiles.MoveNext()) {

  $userProfile = $profiles.Current 
  foreach($property in $userProfile.Properties)
  {
    Write-Host $property.Name --> $userProfile[$property.Name]
  }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.