Thursday, February 4, 2010

1:01 AM
1
$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
  $name = $userProfile.DisplayName
  $myprop= $userProfile["MypropertyName"]
  Write-Host "$name;$myprop"
}

1 comments:

  1. Nice way!
    But there is something I'm messing up with...

    How to get a value with type "string (Multi Value)"

    ReplyDelete