Find all users who have not added a picture to their Mysite Profile

All,

The default picture for a Mysite profile is found here - _layouts/images/O14_person_placeHolder_192.png

All uploaded pictures are loaded to here - MySite>User Photos>Profile Pictures>All Pictures.

Is there a simple way I can marry up a "User Name" to each picture?

Or more importantly how can I find out which users only have the default picture and haven't updated their profile picture?

Thanks

W

July 4th, 2013 6:25am

Hi,

You can use the following PowerShell to enumerate all the profiles looking for profiles that don't have the pictureUrl set.

*you'll need to change the url to that of your central admin site

[void][reflection.assembly]::Loadwithpartialname("Microsoft.Office.Server") | out-null
$site=new-object Microsoft.SharePoint.SPSite("https://c05470sp10:7443") #Central Admin site
$servercontext=[Microsoft.Office.Server.ServerContext]::GetContext($site)
$site.Dispose() # clean up
$upm = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($servercontext)
$pc = $upm.GetEnumerator()
foreach($p in $pc){$v = $p["PictureUrl"].Value;if($v -eq $null){Write-Host $p["AccountName"].ToString()"doesn's have a picture set."}}

#Optional, display all the Picture URL's
$pc = $upm.GetEnumerator();
foreach($p in $pc){$p["PictureUrl"].Value}

Free Windows Admin Tool Kit Click here and download it now
July 4th, 2013 6:49am

Ive used the same powershell script you provided before and it worked like a charm! Apologies if you provided this to me and  didnt say thanks!
July 4th, 2013 6:55am

Thanks TechieMark! Glad it helped!

Free Windows Admin Tool Kit Click here and download it now
July 4th, 2013 6:59am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics