{"id":1624,"date":"2016-02-16T08:16:39","date_gmt":"2016-02-15T21:16:39","guid":{"rendered":"https:\/\/itgroove.net\/mmman\/?p=1624"},"modified":"2023-02-24T21:39:36","modified_gmt":"2023-02-24T21:39:36","slug":"how-to-determine-which-sharepoint-users-have-a-profile-picture","status":"publish","type":"post","link":"https:\/\/regroove.ca\/archive\/2016\/02\/16\/how-to-determine-which-sharepoint-users-have-a-profile-picture\/","title":{"rendered":"How to Determine Which SharePoint Users Have a Profile Picture"},"content":{"rendered":"<p>I recently needed a means of getting a list of all users who had a profile picture associated with their SharePoint account (well, the client was actually more interested in knowing who didn&#8217;t have a profile picture, but this result below worked for them).  Below is a simple PowerShell script for being able to get a list of the user names, and the URL of their profile picture (if they had one).  In the case of users who did not have a profile picture, their &#8220;PictureURL&#8221; value was empty, and these were ultimately the values the client was after (to encourage all users to upload a profile picture).\n<\/p>\n<p><span style=\"font-family:Courier New;font-size:10pt\">[void][System.Reflection.Assembly]::LoadWithPartialName(&#8220;Microsoft.Office.Server&#8221;)<br \/>[void][System.Reflection.Assembly]::LoadWithPartialName(&#8220;Microsoft.Office.Server.UserProfiles&#8221;)<br \/>[void][System.Reflection.Assembly]::LoadWithPartialName(&#8220;Microsoft.SharePoint&#8221;)<br \/>\n<\/span><\/p>\n<p><span style=\"font-family:Courier New;font-size:10pt\"># Change your URL below<br \/>$spsite = new-object Microsoft.SharePoint.SPSite(&#8220;https:\/\/<span style=\"background-color:red;color:white\">[sharepoint.company.com]<\/span>&#8220;);<br \/>$spsc = [Microsoft.SharePoint.SPServiceContext]::GetContext($spsite);<br \/>$sppm = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($spsc)<br \/>$profiles = $sppm.GetEnumerator()<br \/>\n<\/span><\/p>\n<p><span style=\"font-family:Courier New;font-size:10pt\">write-host &#8220;Display Name ; Account Pic&#8221;<br \/>\n<\/span><\/p>\n<p><span style=\"font-family:Courier New;font-size:10pt\">foreach ($profile in $profiles)<br \/>{<br \/>\u00a0\u00a0\u00a0\u00a0$DisplayName = $profile.DisplayName\u00a0\u00a0\u00a0\u00a0 <br \/>\u00a0\u00a0\u00a0\u00a0$AccountPic = $profile[[Microsoft.Office.Server.UserProfiles.PropertyConstants]::PictureURL].Value<br \/>\n<\/span><\/p>\n<p><span style=\"font-family:Courier New;font-size:10pt\">\u00a0\u00a0\u00a0\u00a0if ($AccountPic -ne &#8220;&#8221; -AND $AccountPic -ne &#8221; &#8221; -AND $AccountPic -ne $NULL)<br \/>\u00a0\u00a0\u00a0\u00a0{<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0write-host $DisplayName, &#8220;; [&#8220;, $AccountPic, &#8220;];&#8221;<br \/>\u00a0\u00a0\u00a0\u00a0}<br \/>}<br \/>\n<\/span><\/p>\n<p><span style=\"font-family:Courier New;font-size:10pt\">$spsite.Dispose()<br \/>\n<\/span><\/p>\n<p>Enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently needed a means of getting a list of all users who had a profile picture associated with their SharePoint account (well, the client was actually more interested in knowing who didn&#8217;t have a profile picture, but this result below worked for them). Below is a simple PowerShell script for being able to get &hellip; <a href=\"https:\/\/regroove.ca\/archive\/2016\/02\/16\/how-to-determine-which-sharepoint-users-have-a-profile-picture\/\"><\/a><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[31,7],"tags":[],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Determine Which SharePoint Users Have a Profile Picture - Archive<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/regroove.ca\/archive\/2016\/02\/16\/how-to-determine-which-sharepoint-users-have-a-profile-picture\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Determine Which SharePoint Users Have a Profile Picture - Archive\" \/>\n<meta property=\"og:description\" content=\"I recently needed a means of getting a list of all users who had a profile picture associated with their SharePoint account (well, the client was actually more interested in knowing who didn&#8217;t have a profile picture, but this result below worked for them). Below is a simple PowerShell script for being able to get &hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/regroove.ca\/archive\/2016\/02\/16\/how-to-determine-which-sharepoint-users-have-a-profile-picture\/\" \/>\n<meta property=\"og:site_name\" content=\"Archive\" \/>\n<meta property=\"article:published_time\" content=\"2016-02-15T21:16:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-24T21:39:36+00:00\" \/>\n<meta name=\"author\" content=\"Colin Phillips (Alumni)\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Colin Phillips (Alumni)\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/regroove.ca\/archive\/2016\/02\/16\/how-to-determine-which-sharepoint-users-have-a-profile-picture\/\",\"url\":\"https:\/\/regroove.ca\/archive\/2016\/02\/16\/how-to-determine-which-sharepoint-users-have-a-profile-picture\/\",\"name\":\"How to Determine Which SharePoint Users Have a Profile Picture - Archive\",\"isPartOf\":{\"@id\":\"https:\/\/regroove.ca\/archive\/#website\"},\"datePublished\":\"2016-02-15T21:16:39+00:00\",\"dateModified\":\"2023-02-24T21:39:36+00:00\",\"author\":{\"@id\":\"https:\/\/regroove.ca\/archive\/#\/schema\/person\/adeb0df1cc7a862160be620ca7eace1b\"},\"breadcrumb\":{\"@id\":\"https:\/\/regroove.ca\/archive\/2016\/02\/16\/how-to-determine-which-sharepoint-users-have-a-profile-picture\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/regroove.ca\/archive\/2016\/02\/16\/how-to-determine-which-sharepoint-users-have-a-profile-picture\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/regroove.ca\/archive\/2016\/02\/16\/how-to-determine-which-sharepoint-users-have-a-profile-picture\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog Archive\",\"item\":\"https:\/\/regroove.ca\/archive\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Determine Which SharePoint Users Have a Profile Picture\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/regroove.ca\/archive\/#website\",\"url\":\"https:\/\/regroove.ca\/archive\/\",\"name\":\"Archive\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/regroove.ca\/archive\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/regroove.ca\/archive\/#\/schema\/person\/adeb0df1cc7a862160be620ca7eace1b\",\"name\":\"Colin Phillips (Alumni)\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/regroove.ca\/archive\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/14eeab0d377e9630e0983d9c08911979?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/14eeab0d377e9630e0983d9c08911979?s=96&d=mm&r=g\",\"caption\":\"Colin Phillips (Alumni)\"},\"url\":\"https:\/\/regroove.ca\/archive\/author\/cphillips\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Determine Which SharePoint Users Have a Profile Picture - Archive","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/regroove.ca\/archive\/2016\/02\/16\/how-to-determine-which-sharepoint-users-have-a-profile-picture\/","og_locale":"en_US","og_type":"article","og_title":"How to Determine Which SharePoint Users Have a Profile Picture - Archive","og_description":"I recently needed a means of getting a list of all users who had a profile picture associated with their SharePoint account (well, the client was actually more interested in knowing who didn&#8217;t have a profile picture, but this result below worked for them). Below is a simple PowerShell script for being able to get &hellip;","og_url":"https:\/\/regroove.ca\/archive\/2016\/02\/16\/how-to-determine-which-sharepoint-users-have-a-profile-picture\/","og_site_name":"Archive","article_published_time":"2016-02-15T21:16:39+00:00","article_modified_time":"2023-02-24T21:39:36+00:00","author":"Colin Phillips (Alumni)","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Colin Phillips (Alumni)","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/regroove.ca\/archive\/2016\/02\/16\/how-to-determine-which-sharepoint-users-have-a-profile-picture\/","url":"https:\/\/regroove.ca\/archive\/2016\/02\/16\/how-to-determine-which-sharepoint-users-have-a-profile-picture\/","name":"How to Determine Which SharePoint Users Have a Profile Picture - Archive","isPartOf":{"@id":"https:\/\/regroove.ca\/archive\/#website"},"datePublished":"2016-02-15T21:16:39+00:00","dateModified":"2023-02-24T21:39:36+00:00","author":{"@id":"https:\/\/regroove.ca\/archive\/#\/schema\/person\/adeb0df1cc7a862160be620ca7eace1b"},"breadcrumb":{"@id":"https:\/\/regroove.ca\/archive\/2016\/02\/16\/how-to-determine-which-sharepoint-users-have-a-profile-picture\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/regroove.ca\/archive\/2016\/02\/16\/how-to-determine-which-sharepoint-users-have-a-profile-picture\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/regroove.ca\/archive\/2016\/02\/16\/how-to-determine-which-sharepoint-users-have-a-profile-picture\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Archive","item":"https:\/\/regroove.ca\/archive\/"},{"@type":"ListItem","position":2,"name":"How to Determine Which SharePoint Users Have a Profile Picture"}]},{"@type":"WebSite","@id":"https:\/\/regroove.ca\/archive\/#website","url":"https:\/\/regroove.ca\/archive\/","name":"Archive","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/regroove.ca\/archive\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/regroove.ca\/archive\/#\/schema\/person\/adeb0df1cc7a862160be620ca7eace1b","name":"Colin Phillips (Alumni)","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/regroove.ca\/archive\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/14eeab0d377e9630e0983d9c08911979?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/14eeab0d377e9630e0983d9c08911979?s=96&d=mm&r=g","caption":"Colin Phillips (Alumni)"},"url":"https:\/\/regroove.ca\/archive\/author\/cphillips\/"}]}},"_links":{"self":[{"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/posts\/1624"}],"collection":[{"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/comments?post=1624"}],"version-history":[{"count":1,"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/posts\/1624\/revisions"}],"predecessor-version":[{"id":1825,"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/posts\/1624\/revisions\/1825"}],"wp:attachment":[{"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/media?parent=1624"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/categories?post=1624"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/tags?post=1624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}