{"id":4795,"date":"2013-02-26T12:00:21","date_gmt":"2013-02-26T12:00:21","guid":{"rendered":"http:\/\/www.markwilson.co.uk\/blog\/?p=4795"},"modified":"2013-02-25T19:18:36","modified_gmt":"2013-02-25T19:18:36","slug":"searching-active-directory-with-powershell-and-a-users-phone-number","status":"publish","type":"post","link":"https:\/\/www.markwilson.co.uk\/blog\/2013\/02\/searching-active-directory-with-powershell-and-a-users-phone-number.htm","title":{"rendered":"Searching Active Directory with PowerShell and a user&#8217;s phone number"},"content":{"rendered":"<p>I have a guilty secret: I screen my incoming phone calls. I no longer answer blocked numbers on my work phone &#8211; it&#8217;s always PPI spam &#8211; and I recognise the numbers of those I work closely with, so I can prioritise my response (i.e. do I want to be interrupted by that person, or can I respond to voicemail later?). To be honest, it&#8217;s just the same with email &#8211; some people will get an immediate response, others will need more thought and I&#8217;ll respond when I have more time (or not, in some cases). Is it unprofessional? I don&#8217;t think so &#8211; it&#8217;s about time management.<\/p>\n<p>Recently, I had a missed call on my mobile from a number I didn&#8217;t recognise. I could see it was internal (all of our mobile phones have the same first few digits) so I thought I&#8217;d search the Global Address List in Outlook.\u00a0Unfortunately\u00a0though, Outlook doesn&#8217;t let me search the GAL on phone numbers&#8230;<\/p>\n<blockquote class=\"twitter-tweet\"><p>Using PowerShell to search Active Directory and see who a missed call is from&#8230; maybe I should just pick up the phone&#8230; nah, geek away&#8230;<\/p>\n<p>\u2014 Mark Wilson (@markwilsonit) <a href=\"https:\/\/twitter.com\/markwilsonit\/status\/304656803101290497\">February 21, 2013<\/a><\/p><\/blockquote>\n<p>I could have just called them back (actually, I did!) but the geek in me had the bit between the teeth&#8230; could I script up some kind of reverse lookup for phone numbers? And, in true Barack Obama (or Bob the Builder if you&#8217;re on this side of the Atlantic) style, the answer turns out to be:<\/p>\n<p>&#8220;Yes, we can!&#8221;<\/p>\n<p>So, if you use a Windows PC and you like scripting, read on. If you don&#8217;t, probably best just call the number back and see who answers!<\/p>\n<h3>Getting ready to query Active Directory with PowerShell<\/h3>\n<p>The first hurdle was that, in order to query Active Directory from PowerShell, I needed to have the Remote Server Administration Tools (RSAT) component installed on my Windows 7 workstation in order to do this, but it&#8217;s actually a two-step installation process.<\/p>\n<ol>\n<li>Firstly, <a href=\"http:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=7887\">download and install the RSATs<\/a>\u00a0to the workstation.<\/li>\n<li><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignright\" alt=\"\" src=\"https:\/\/i0.wp.com\/www.markwilson.co.uk\/blog\/images\/rsat-ad-psh.png?resize=257%2C225&#038;ssl=1\" width=\"257\" height=\"225\" \/>In Control Panel, Programs, Programs and Features, Turn Windows features on or off, make sure that the Active Directory Module for Windows PowerShell is available under Role Administration Tools, AD DS and AD LDS Tools.<\/li>\n<\/ol>\n<p>Once the RSATs were installed and the Active Directory Module for Windows PowerShell was enabled, I could fire up Windows PowerShell and issue the command to <a href=\"http:\/\/stackoverflow.com\/questions\/6493844\/get-an-error-with-powershell-2-0-but-dont-know-why\/6494261#6494261\">load the Active Directory management cmdlets<\/a>:<\/p>\n<p><code>Import-Module ActiveDirectory<\/code><\/p>\n<h3>Finding the available attributes to search against<\/h3>\n<p>Next up, I needed to know which properties are available for an Active Directory User object. <a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/ee617241.aspx\">I used my own email address as a filter to Get-User<\/a>, which retrieved the details for the given AD User object, then <a href=\"http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2012\/10\/31\/powertip-use-powershell-get-member-to-see-properties-of-active-directory-users.aspx\">selected all properties and piped the resulting output into Get-Member<\/a> (which gets the properties and methods of objects):<\/p>\n<p><code>Get-ADUser -Filter {EmailAddress -like \"user@domain.com\"} -Properties * |<br \/>\n<\/code><code>Get-Member -MemberType\u00a0property<\/code><\/p>\n<p>Building up confidence, I started to play around and query individual attributes for the selected object:<\/p>\n<p><code>$user = Get-ADUser -Filter {EmailAddress -like \"user@domain.com\"} -Properties *<br \/>\n$user.Title<br \/>\n$user.OfficePhone<br \/>\n$user.SAMAccountName<\/code><\/p>\n<p>I found that each of these returned the information I would expect for my own user account in Active Directory.<\/p>\n<h3>Constructing the query<\/h3>\n<p>The next step was to <a href=\"http:\/\/www.techrepublic.com\/blog\/networking\/two-powershell-scripts-for-retrieving-user-info-from-active-directory\/3028\">search the whole directory<\/a> but this time to filter the properties returned and to <a href=\"http:\/\/www.computerperformance.co.uk\/ezine\/ezine178.htm\">pipe through <code>Where-Object<\/code> to match certain criteria<\/a>, then\u00a0pipe the resulting output from that query into a table:<\/p>\n<p><code>Get-AdUser -Filter * -Properties OfficePhone |<br \/>\nWhere-Object {$_.UserPrincipalName -match \"Wilson\"} |<br \/>\nFormat-Table OfficePhone,UserPrincipalName<\/code><\/p>\n<p>This returns the office phone number for everyone whose user name contains the string <code>Wilson<\/code>. \u00a0That tested the principle but was not the query I was trying to create, so I edited the query to match a number against a number of phone number properties (making sure that all the properties that need to be displayed are in the filter) and also <a href=\"http:\/\/stackoverflow.com\/questions\/8184167\/how-to-prompt-for-input-in-powershell\/8184861#8184861\">prompted for the search string<\/a>, storing it in a variable:<\/p>\n<p><code>$Search = Read-Host 'What number would you like to search for?'<br \/>\nGet-AdUser -Filter * -Properties OfficePhone,MobilePhone,TelephoneNumber |<br \/>\nWhere-Object {$_.OfficePhone -match $Search -or $_.MobilePhone -match<br \/>\n$Search -or $_.TelephoneNumber -match $Search} |<br \/>\nFormat-Table GivenName,Surname,OfficePhone,MobilePhone,TelephoneNumber<\/code><\/p>\n<p>This time, the resulting output was exactly what I was after &#8211; a single entry matching the partial phone number I&#8217;d asked it to match (<code>824753<\/code> in the example below):<\/p>\n<pre>GivenName  Surname  OfficePhone  MobilePhone    TelephoneNumber\r\n---------  -------  -----------  -----------    ---------------\r\nMark       Wilson   73824753     +447xxx824753  73824753<\/pre>\n<p>Finally, I wrapped the whole thing up in a script and, <a href=\"http:\/\/stackoverflow.com\/questions\/10635\/why-are-my-powershell-scripts-not-running\/10638#10638\">as long as I&#8217;ve done the usual <code>Set-ExecutionPolicy remotesigned<\/code> stuff<\/a>, I can perform reverse lookups on phone numbers to my heart&#8217;s content&#8230; now, if only I could have an iPhone app to do this for me when the calls come in&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have a guilty secret: I screen my incoming phone calls. I no longer answer blocked numbers on my work phone &#8211; it&#8217;s always PPI spam &#8211; and I recognise the numbers of those I work closely with, so I can prioritise my response (i.e. do I want to be interrupted by that person, or &hellip; <a href=\"https:\/\/www.markwilson.co.uk\/blog\/2013\/02\/searching-active-directory-with-powershell-and-a-users-phone-number.htm\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Searching Active Directory with PowerShell and a user&#8217;s phone number<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[218],"tags":[102,350,78],"class_list":["post-4795","post","type-post","status-publish","format-standard","hentry","category-technology","tag-active-directory","tag-powershell","tag-telephony"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Searching Active Directory with PowerShell and a user&#039;s phone number - markwilson.it<\/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:\/\/www.markwilson.co.uk\/blog\/2013\/02\/searching-active-directory-with-powershell-and-a-users-phone-number.htm\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Searching Active Directory with PowerShell and a user&#039;s phone number - markwilson.it\" \/>\n<meta property=\"og:description\" content=\"I have a guilty secret: I screen my incoming phone calls. I no longer answer blocked numbers on my work phone &#8211; it&#8217;s always PPI spam &#8211; and I recognise the numbers of those I work closely with, so I can prioritise my response (i.e. do I want to be interrupted by that person, or &hellip; Continue reading Searching Active Directory with PowerShell and a user&#8217;s phone number\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.markwilson.co.uk\/blog\/2013\/02\/searching-active-directory-with-powershell-and-a-users-phone-number.htm\" \/>\n<meta property=\"og:site_name\" content=\"markwilson.it\" \/>\n<meta property=\"article:published_time\" content=\"2013-02-26T12:00:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.markwilson.co.uk\/blog\/images\/rsat-ad-psh.png\" \/>\n<meta name=\"author\" content=\"Mark Wilson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@markwilsonit\" \/>\n<meta name=\"twitter:site\" content=\"@markwilsonit\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mark Wilson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2013\\\/02\\\/searching-active-directory-with-powershell-and-a-users-phone-number.htm#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2013\\\/02\\\/searching-active-directory-with-powershell-and-a-users-phone-number.htm\"},\"author\":{\"name\":\"Mark Wilson\",\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/#\\\/schema\\\/person\\\/98f61365e7c39d6be942174b8c4de468\"},\"headline\":\"Searching Active Directory with PowerShell and a user&#8217;s phone number\",\"datePublished\":\"2013-02-26T12:00:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2013\\\/02\\\/searching-active-directory-with-powershell-and-a-users-phone-number.htm\"},\"wordCount\":718,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/#\\\/schema\\\/person\\\/98f61365e7c39d6be942174b8c4de468\"},\"image\":{\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2013\\\/02\\\/searching-active-directory-with-powershell-and-a-users-phone-number.htm#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/images\\\/rsat-ad-psh.png\",\"keywords\":[\"Microsoft Active Directory\",\"Microsoft PowerShell\",\"Telephony\"],\"articleSection\":[\"Technology\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2013\\\/02\\\/searching-active-directory-with-powershell-and-a-users-phone-number.htm#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2013\\\/02\\\/searching-active-directory-with-powershell-and-a-users-phone-number.htm\",\"url\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2013\\\/02\\\/searching-active-directory-with-powershell-and-a-users-phone-number.htm\",\"name\":\"Searching Active Directory with PowerShell and a user's phone number - markwilson.it\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2013\\\/02\\\/searching-active-directory-with-powershell-and-a-users-phone-number.htm#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2013\\\/02\\\/searching-active-directory-with-powershell-and-a-users-phone-number.htm#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/images\\\/rsat-ad-psh.png\",\"datePublished\":\"2013-02-26T12:00:21+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2013\\\/02\\\/searching-active-directory-with-powershell-and-a-users-phone-number.htm#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2013\\\/02\\\/searching-active-directory-with-powershell-and-a-users-phone-number.htm\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2013\\\/02\\\/searching-active-directory-with-powershell-and-a-users-phone-number.htm#primaryimage\",\"url\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/images\\\/rsat-ad-psh.png\",\"contentUrl\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/images\\\/rsat-ad-psh.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/2013\\\/02\\\/searching-active-directory-with-powershell-and-a-users-phone-number.htm#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Searching Active Directory with PowerShell and a user&#8217;s phone number\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/\",\"name\":\"markwilson.it\",\"description\":\"get-info -class technology | write-output &gt; \\\/dev\\\/web\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/#\\\/schema\\\/person\\\/98f61365e7c39d6be942174b8c4de468\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/#\\\/schema\\\/person\\\/98f61365e7c39d6be942174b8c4de468\",\"name\":\"Mark Wilson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/i0.wp.com\\\/www.markwilson.co.uk\\\/blog\\\/uploads\\\/image-4.png?fit=800%2C800&ssl=1\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.markwilson.co.uk\\\/blog\\\/uploads\\\/image-4.png?fit=800%2C800&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/www.markwilson.co.uk\\\/blog\\\/uploads\\\/image-4.png?fit=800%2C800&ssl=1\",\"width\":800,\"height\":800,\"caption\":\"Mark Wilson\"},\"logo\":{\"@id\":\"https:\\\/\\\/i0.wp.com\\\/www.markwilson.co.uk\\\/blog\\\/uploads\\\/image-4.png?fit=800%2C800&ssl=1\"},\"description\":\"A Chartered IT Professional, with recent experience in technology leadership, IT strategy and practice management roles, Mark Wilson is an Enterprise Architect in the Advisory and Management Group at risual. During a career spanning more than two decades, Mark has gained widespread recognition as an expert in his field including both industry and national press exposure. In addition to certifications from Microsoft, VMware, Red Hat, The Open Group and Axelos, Mark held a Microsoft Most Valuable Professional (MVP) award for three years and is now part of the MVP Reconnect programme. Mark is also well-known on social media and maintains an award-winning blog.\",\"sameAs\":[\"http:\\\/\\\/www.markwilson.co.uk\\\/\",\"https:\\\/\\\/www.instagram.com\\\/markwilsonuk\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/markawilson\\\/\",\"https:\\\/\\\/x.com\\\/markwilsonit\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCWHlZCoHRTocdvtrOJ2IL4A\"],\"url\":\"https:\\\/\\\/www.markwilson.co.uk\\\/blog\\\/author\\\/mark-wilson\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Searching Active Directory with PowerShell and a user's phone number - markwilson.it","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:\/\/www.markwilson.co.uk\/blog\/2013\/02\/searching-active-directory-with-powershell-and-a-users-phone-number.htm","og_locale":"en_GB","og_type":"article","og_title":"Searching Active Directory with PowerShell and a user's phone number - markwilson.it","og_description":"I have a guilty secret: I screen my incoming phone calls. I no longer answer blocked numbers on my work phone &#8211; it&#8217;s always PPI spam &#8211; and I recognise the numbers of those I work closely with, so I can prioritise my response (i.e. do I want to be interrupted by that person, or &hellip; Continue reading Searching Active Directory with PowerShell and a user&#8217;s phone number","og_url":"https:\/\/www.markwilson.co.uk\/blog\/2013\/02\/searching-active-directory-with-powershell-and-a-users-phone-number.htm","og_site_name":"markwilson.it","article_published_time":"2013-02-26T12:00:21+00:00","og_image":[{"url":"https:\/\/www.markwilson.co.uk\/blog\/images\/rsat-ad-psh.png","type":"","width":"","height":""}],"author":"Mark Wilson","twitter_card":"summary_large_image","twitter_creator":"@markwilsonit","twitter_site":"@markwilsonit","twitter_misc":{"Written by":"Mark Wilson","Estimated reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.markwilson.co.uk\/blog\/2013\/02\/searching-active-directory-with-powershell-and-a-users-phone-number.htm#article","isPartOf":{"@id":"https:\/\/www.markwilson.co.uk\/blog\/2013\/02\/searching-active-directory-with-powershell-and-a-users-phone-number.htm"},"author":{"name":"Mark Wilson","@id":"https:\/\/www.markwilson.co.uk\/blog\/#\/schema\/person\/98f61365e7c39d6be942174b8c4de468"},"headline":"Searching Active Directory with PowerShell and a user&#8217;s phone number","datePublished":"2013-02-26T12:00:21+00:00","mainEntityOfPage":{"@id":"https:\/\/www.markwilson.co.uk\/blog\/2013\/02\/searching-active-directory-with-powershell-and-a-users-phone-number.htm"},"wordCount":718,"commentCount":2,"publisher":{"@id":"https:\/\/www.markwilson.co.uk\/blog\/#\/schema\/person\/98f61365e7c39d6be942174b8c4de468"},"image":{"@id":"https:\/\/www.markwilson.co.uk\/blog\/2013\/02\/searching-active-directory-with-powershell-and-a-users-phone-number.htm#primaryimage"},"thumbnailUrl":"https:\/\/www.markwilson.co.uk\/blog\/images\/rsat-ad-psh.png","keywords":["Microsoft Active Directory","Microsoft PowerShell","Telephony"],"articleSection":["Technology"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.markwilson.co.uk\/blog\/2013\/02\/searching-active-directory-with-powershell-and-a-users-phone-number.htm#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.markwilson.co.uk\/blog\/2013\/02\/searching-active-directory-with-powershell-and-a-users-phone-number.htm","url":"https:\/\/www.markwilson.co.uk\/blog\/2013\/02\/searching-active-directory-with-powershell-and-a-users-phone-number.htm","name":"Searching Active Directory with PowerShell and a user's phone number - markwilson.it","isPartOf":{"@id":"https:\/\/www.markwilson.co.uk\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.markwilson.co.uk\/blog\/2013\/02\/searching-active-directory-with-powershell-and-a-users-phone-number.htm#primaryimage"},"image":{"@id":"https:\/\/www.markwilson.co.uk\/blog\/2013\/02\/searching-active-directory-with-powershell-and-a-users-phone-number.htm#primaryimage"},"thumbnailUrl":"https:\/\/www.markwilson.co.uk\/blog\/images\/rsat-ad-psh.png","datePublished":"2013-02-26T12:00:21+00:00","breadcrumb":{"@id":"https:\/\/www.markwilson.co.uk\/blog\/2013\/02\/searching-active-directory-with-powershell-and-a-users-phone-number.htm#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.markwilson.co.uk\/blog\/2013\/02\/searching-active-directory-with-powershell-and-a-users-phone-number.htm"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.markwilson.co.uk\/blog\/2013\/02\/searching-active-directory-with-powershell-and-a-users-phone-number.htm#primaryimage","url":"https:\/\/www.markwilson.co.uk\/blog\/images\/rsat-ad-psh.png","contentUrl":"https:\/\/www.markwilson.co.uk\/blog\/images\/rsat-ad-psh.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.markwilson.co.uk\/blog\/2013\/02\/searching-active-directory-with-powershell-and-a-users-phone-number.htm#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.markwilson.co.uk\/blog"},{"@type":"ListItem","position":2,"name":"Searching Active Directory with PowerShell and a user&#8217;s phone number"}]},{"@type":"WebSite","@id":"https:\/\/www.markwilson.co.uk\/blog\/#website","url":"https:\/\/www.markwilson.co.uk\/blog\/","name":"markwilson.it","description":"get-info -class technology | write-output &gt; \/dev\/web","publisher":{"@id":"https:\/\/www.markwilson.co.uk\/blog\/#\/schema\/person\/98f61365e7c39d6be942174b8c4de468"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.markwilson.co.uk\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":["Person","Organization"],"@id":"https:\/\/www.markwilson.co.uk\/blog\/#\/schema\/person\/98f61365e7c39d6be942174b8c4de468","name":"Mark Wilson","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/i0.wp.com\/www.markwilson.co.uk\/blog\/uploads\/image-4.png?fit=800%2C800&ssl=1","url":"https:\/\/i0.wp.com\/www.markwilson.co.uk\/blog\/uploads\/image-4.png?fit=800%2C800&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.markwilson.co.uk\/blog\/uploads\/image-4.png?fit=800%2C800&ssl=1","width":800,"height":800,"caption":"Mark Wilson"},"logo":{"@id":"https:\/\/i0.wp.com\/www.markwilson.co.uk\/blog\/uploads\/image-4.png?fit=800%2C800&ssl=1"},"description":"A Chartered IT Professional, with recent experience in technology leadership, IT strategy and practice management roles, Mark Wilson is an Enterprise Architect in the Advisory and Management Group at risual. During a career spanning more than two decades, Mark has gained widespread recognition as an expert in his field including both industry and national press exposure. In addition to certifications from Microsoft, VMware, Red Hat, The Open Group and Axelos, Mark held a Microsoft Most Valuable Professional (MVP) award for three years and is now part of the MVP Reconnect programme. Mark is also well-known on social media and maintains an award-winning blog.","sameAs":["http:\/\/www.markwilson.co.uk\/","https:\/\/www.instagram.com\/markwilsonuk\/","https:\/\/www.linkedin.com\/in\/markawilson\/","https:\/\/x.com\/markwilsonit","https:\/\/www.youtube.com\/channel\/UCWHlZCoHRTocdvtrOJ2IL4A"],"url":"https:\/\/www.markwilson.co.uk\/blog\/author\/mark-wilson"}]}},"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":5309,"url":"https:\/\/www.markwilson.co.uk\/blog\/2014\/08\/administering-office-365-using-powershell-updated-information-on-the-required-components.htm","url_meta":{"origin":4795,"position":0},"title":"Administering Office 365 using PowerShell: updated information on the required components","author":"Mark Wilson","date":"Monday 18 August 2014","format":false,"excerpt":"I've written before about\u00a0administering Office 365 from PowerShell but the process has changed slightly over the years. \u00a0There are various articles out there on the web with methods and links but the key information (as at August 2014) is in a TechNet article titled Manage Azure AD using Windows PowerShell.\u2026","rel":"","context":"In &quot;Technology&quot;","block_context":{"text":"Technology","link":"https:\/\/www.markwilson.co.uk\/blog\/topic\/technology"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1496,"url":"https:\/\/www.markwilson.co.uk\/blog\/2009\/08\/learn-about-managing-ad-using-powershell-and-agpm-with-the-active-directory-uk-user-group.htm","url_meta":{"origin":4795,"position":1},"title":"Learn about managing AD using PowerShell and AGPM with the Active Directory UK user group","author":"Mark Wilson","date":"Monday 3 August 2009","format":false,"excerpt":"Mark Parris is organising another meeting of the Active Directory UK User Group for 16 September 2009 and this time the topics will be: An introduction to PowerShell, demo-heavy and presented by Richard Siddaway. In this session Richard will looking specifically at the new AD provider and cmdlets in PowerShell\u2026","rel":"","context":"In \"Microsoft Active Directory\"","block_context":{"text":"Microsoft Active Directory","link":"https:\/\/www.markwilson.co.uk\/blog\/tag\/active-directory"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6099,"url":"https:\/\/www.markwilson.co.uk\/blog\/2015\/10\/unable-to-set-the-default-powershell-font-to-lucida-console.htm","url_meta":{"origin":4795,"position":2},"title":"Unable to set the default PowerShell font to Lucida Console","author":"Mark Wilson","date":"Tuesday 6 October 2015","format":false,"excerpt":"For the last few months, I've been getting more and more infuriated with my PowerShell sessions opening in a tiny raster font (4x6). On a high resolution display like the one on the Surface Pro 3, that's a complete pain\u00a0and, whilst I could change the font in the properties for\u2026","rel":"","context":"In &quot;Technology&quot;","block_context":{"text":"Technology","link":"https:\/\/www.markwilson.co.uk\/blog\/topic\/technology"},"img":{"alt_text":"Windows PowerShell with a tiny raster font","src":"https:\/\/i0.wp.com\/www.markwilson.co.uk\/blog\/images\/tiny-powershell.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":3218,"url":"https:\/\/www.markwilson.co.uk\/blog\/2011\/11\/office-365-password-resets-and-disabling-password-expiry.htm","url_meta":{"origin":4795,"position":3},"title":"Office 365 password resets&#8230; and disabling password expiry","author":"Mark Wilson","date":"Thursday 10 November 2011","format":false,"excerpt":"My Office 365 account password expired today and, somewhere in the midst of the password reset I managed to lock myself out. \u00a0As I only have one mailbox on the account (i.e. I am the administrator), that's a bit of a problem... I tried creating a service request to reset\u2026","rel":"","context":"In &quot;Technology&quot;","block_context":{"text":"Technology","link":"https:\/\/www.markwilson.co.uk\/blog\/topic\/technology"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1386,"url":"https:\/\/www.markwilson.co.uk\/blog\/2009\/03\/microsoft-powershell-vbscript-and-jscript-bible.htm","url_meta":{"origin":4795,"position":4},"title":"Microsoft PowerShell, VBScript and JScript Bible","author":"Mark Wilson","date":"Thursday 12 March 2009","format":false,"excerpt":"At last night's joint user group meeting for the Windows Server UK User Group and the Active Directory UK User Group, James O'Neill mentioned that the book he has co-authored (Microsoft PowerShell, VBScript and JScript Bible, published by John Wiley and sons) goes on sale today. I haven't had the\u2026","rel":"","context":"In \"Scripting\"","block_context":{"text":"Scripting","link":"https:\/\/www.markwilson.co.uk\/blog\/tag\/scripting"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5735,"url":"https:\/\/www.markwilson.co.uk\/blog\/2015\/07\/short-takes-reading-azure-ad-tenant-ids-in-powershell-and-a-script-to-retrieve-basic-tenant-details.htm","url_meta":{"origin":4795,"position":5},"title":"Short takes: PowerShell to examine Azure AD tenants; check which Office 365 datacentre you&#8217;re using","author":"Mark Wilson","date":"Friday 17 July 2015","format":false,"excerpt":"More snippets from my ever-growing browser full of tabs... PowerShell to get your Azure Active Directory tenant ID Whilst researching Office 365 tenant names and their significance, I stumbled across some potentially useful PowerShell to read your Azure Active Directory tenant ID. Get-AzureAccount I'm not sure how to map that\u2026","rel":"","context":"In &quot;Technology&quot;","block_context":{"text":"Technology","link":"https:\/\/www.markwilson.co.uk\/blog\/topic\/technology"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/posts\/4795","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=4795"}],"version-history":[{"count":6,"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/posts\/4795\/revisions"}],"predecessor-version":[{"id":4802,"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/posts\/4795\/revisions\/4802"}],"wp:attachment":[{"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=4795"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=4795"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.markwilson.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=4795"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}