Domanda

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

È stato utile?

Soluzione

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]
  }
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top