Get list of all userprofiles with an image
Hello,
we would like to extract all userprofiles with an image from a moss2007 installation.
How can this be done?
I think i should use some powershell?
Or maybe the search engine can do it?Jakob Olsen
February 24th, 2011 9:30am
Your question is not clear..
Does any of these solve your purpose ?
1. use contact details webpart that diplays all users and their images
2. query user profiles using UserProfileManager object
3. query people search scope using web service search.asmx
Free Windows Admin Tool Kit Click here and download it now
February 25th, 2011 2:17am
Hello,
1: How do I do that ? I can find the contact details, but i can only select one person.
2: An option, but how do I loop users?
3: Could also be an option.Jakob Olsen
February 25th, 2011 4:12am
Nailed it with powershell:
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server")
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.UserProfiles")
Function Get-UserProfilesWithImage($SSPName)
{
$ServerContext = [Microsoft.Office.Server.ServerContext]::GetContext($SSPName)
$profileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($ServerContext)
$profiles = $profileManager.GetEnumerator()
$file = "C:\images.html"
foreach($userProfile in $profiles){
if($userProfile["PictureUrl"] -ne ''){
$img = $userProfile["PictureUrl"]
$name = $userProfile["PreferredName"]
"<img src='$img' alt='$name' /><br />" | Out-File -filepath $file -append
break
}
}
}
Get-UserProfilesWithImage("SharedService1");Jakob Olsen
Free Windows Admin Tool Kit Click here and download it now
February 25th, 2011 3:57pm