{"id":16351,"date":"2010-12-01T00:01:00","date_gmt":"2010-12-01T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2010\/12\/01\/use-powershell-to-query-active-directory-from-the-console\/"},"modified":"2010-12-01T00:01:00","modified_gmt":"2010-12-01T00:01:00","slug":"use-powershell-to-query-active-directory-from-the-console","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/use-powershell-to-query-active-directory-from-the-console\/","title":{"rendered":"Use PowerShell to Query Active Directory from the Console"},"content":{"rendered":"<p><span style=\"font-size: 10pt\">&nbsp;<\/span><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><b><span style=\"font-size: 10pt\">Summary:<\/span><\/b><span style=\"font-size: 10pt\"> Learn how to query Active Directory by using Windows PowerShell without writing a script.<\/span><\/p>\n<p><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><img decoding=\"async\" height=\"34\" width=\"34\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" align=\"left\" alt=\"Hey, Scripting Guy! Question\" border=\"0\" title=\"Hey, Scripting Guy! Question\" \/><\/span><\/span><\/span>Hey, Scripting Guy! Occasionally I have to perform a quick query of Active Directory, but I do not want to write a complicated VBScript or Windows PowerShell script. Is there a way to use Windows PowerShell to query Active Directory that does not involve writing a convoluted script?<\/span><\/p>\n<p><span style=\"font-size: 10pt\">&#8212; JW<\/span><\/p>\n<p><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><img decoding=\"async\" height=\"34\" width=\"34\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" align=\"left\" alt=\"Hey, Scripting Guy! Answer\" border=\"0\" title=\"Hey, Scripting Guy! Answer\" \/><\/span><\/span><\/span>Hello JW, Microsoft Scripting Guy Ed Wilson here. There are in fact, several ways that you can query Active Directory Domain Services from Windows PowerShell that do not involve writing a convoluted script. For example, one tool that can be used is DSQuery. This is seen here where I list all users who have been inactive for 4 weeks. <\/span><\/p>\n<p class=\"CodeBlock\" style=\"padding-left: 30px\"><span style=\"font-size: 10pt\"><span style=\"font-family: Lucida Sans Typewriter\">PS C:\\&gt; dsquery user -inactive 4<\/span><\/span><\/p>\n<p class=\"Readeraidonly\"><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p class=\"Readeraidonly\"><span style=\"font-size: 10pt\">Portions of today&rsquo;s Hey, Scripting Guy! Blog post are adapted from material in my book <a href=\"http:\/\/www.amazon.com\/Windows-PowerShell-Best-Practices-Microsoft\/dp\/0735626464\/ref=sr_1_2?ie=UTF8&amp;s=books&amp;qid=1290463673&amp;sr=1-2\"><i><span style=\"color: #0000ff\">Windows PowerShell 2.0 Best Practices<\/span><\/i><\/a> that was published by Microsoft Press in December 2009. <\/span><\/p>\n<p><span style=\"font-size: 10pt\">With Windows PowerShell 1.0 if you wanted to query Active Directory, most network administrators felt they had to write a script. To a degree, this was a relic of the VBScript days, and a reliance of using the ActiveX Data Objects (ADO) technology to invoke a Lightweight Directory Access Protocol (LDAP) Dialect query against Active Directory. Although it was possible to use the <b>System.DirectoryServices.DirectorySearcher<\/b> from a Windows PowerShell line, it was not very convenient. There were third-party cmdlets and providers that did make it possible to employ command line queries against Active Directory however, many network administrators are rightfully skeptical about installing unsupported community software on production servers. With Windows PowerShell 2.0 that situation has changed somewhat. By using the techniques seen here, an IT Pro now has a supportable command line solution to the problem of performing Active Directory queries. <\/span><\/p>\n<p><span style=\"font-size: 10pt\">There are a couple of options available to you for querying Active Directory from the Windows PowerShell prompt. One is to use the <b>[ADSISearcher]<\/b> type accelerator. The <b>[ADSISearcher]<\/b> type accelerator is a shortcut to the <b>System.DirectoryServices.DirectorySearcher<\/b> class. All the <b>[ADSISearcher]<\/b> type accelerator does is save you a bit of typing. You still have to give it the appropriate constructor to create an instance of the class. If you did not use the <b>[ADSISearcher]<\/b> you would need to use the <b>New-Object<\/b> cmdlet to create the object. You can put the <b>New-Object<\/b> command inside smooth parentheses to force the creation of the object first, and then call the <b>FindAll <\/b>method from the <b>DirectorySearcher<\/b> object. The resulting collection of <b><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.directoryservices.directoryentry.aspx\"><span style=\"color: #0000ff\">DirectoryEntry<\/span><\/a><\/b> objects is pipelined to the <b>Select-Object<\/b> cmdlet where the <b>Path <\/b>property is returned.<span>&nbsp; <\/span>This is seen here.<\/span><\/p>\n<p class=\"CodeBlock\" style=\"padding-left: 30px\"><span style=\"font-size: 10pt\"><span style=\"font-family: Lucida Sans Typewriter\">PS C:\\&gt; (New-Object DirectoryServices.DirectorySearcher &#8220;ObjectClass=user&#8221;).Find<br \/>All() | Select path<\/p>\n<p>Path<br \/>&#8212;-<br \/>LDAP:\/\/CN=Administrator,CN=Users,DC=nwtraders,DC=com<br \/>LDAP:\/\/CN=Guest,CN=Users,DC=nwtraders,DC=com<br \/>LDAP:\/\/CN=BERLIN,OU=Domain Controllers,DC=nwtraders,DC=com<br \/>LDAP:\/\/CN=krbtgt,CN=Users,DC=nwtraders,DC=com<br \/>LDAP:\/\/CN=VISTA,CN=Computers,DC=nwtraders,DC=com<br \/>LDAP:\/\/CN=VistaAdmin,OU=Students,DC=nwtraders,DC=com<br \/>List Truncated &ndash;<\/span><\/span><\/p>\n<p><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size: 10pt\">To use the <b>[ADSISearcher]<\/b> type accelerator, you still need to supply it with an appropriate constructor that in many cases will be the search filter expressed in LDAP Search Filter Syntax. LDAP Search Filter Syntax is defined in RFC 2254 and is represented by Unicode strings. The search filters enable you to specify search criteria in an efficient and effective manner. Some examples of using the LDAP Search Filter Syntax are seen in Table 1.<\/span><\/p>\n<p><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p class=\"TableNum-Title\"><span style=\"font-size: 10pt\"><strong>Table 1&emsp;LDAP Search Filter Examples<\/strong><\/span><\/p>\n<table cellpadding=\"0\" cellspacing=\"0\" border=\"1\" style=\"border-collapse: collapse\">\n<tbody>\n<tr>\n<td width=\"283\" valign=\"top\" style=\"padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;padding-top: 0in;border: windowtext 1pt solid\">\n<p class=\"TableHead\"><span style=\"font-size: 10pt\"><strong>Search Filter<\/strong><\/span><\/p>\n<\/td>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: #f0f0f0;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: windowtext 1pt solid;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableHead\"><span style=\"font-size: 10pt\"><strong>Description<\/strong><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: windowtext 1pt solid;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">ObjectClass=Computer<\/span><\/p>\n<\/td>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: #f0f0f0;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">All computer objects<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: windowtext 1pt solid;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">ObjectClass=OrganizationalUnit<\/span><\/p>\n<\/td>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: #f0f0f0;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">All organizational unit objects<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: windowtext 1pt solid;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">ObjectClass=User<\/span><\/p>\n<\/td>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: #f0f0f0;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">All user objects as well as all computer objects<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: windowtext 1pt solid;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">ObjectCategory=User<\/span><\/p>\n<\/td>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: #f0f0f0;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">All User objects<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: windowtext 1pt solid;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">(&amp;(ObjectCategory=User)(ObjectClass=Person))<\/span><\/p>\n<\/td>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: #f0f0f0;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">All User objects<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: windowtext 1pt solid;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">L=Berlin<\/span><\/p>\n<\/td>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: #f0f0f0;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">All objects with the location of Berlin<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: windowtext 1pt solid;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">Name=*Berlin*<\/span><\/p>\n<\/td>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: #f0f0f0;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">All objects with a name that contains Berlin<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: windowtext 1pt solid;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">(&amp;(L=berlin)(ObjectCategory=OrganizationalUnit))<\/span><\/p>\n<\/td>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: #f0f0f0;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">All Organizational Units with the location of Berlin<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: windowtext 1pt solid;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">(&amp;(ObjectCategory=OrganizationalUnit)(Name=*Berlin*))<\/span><\/p>\n<\/td>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: #f0f0f0;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">All Organizational Units with a name that contains Berlin<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: windowtext 1pt solid;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">(&amp;(ObjectCategory=OrganizationalUnit)(Name=*Berlin*)(!L=Berlin))<\/span><\/p>\n<\/td>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: #f0f0f0;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">All Organizational Units with a name that contains Berlin, but do not have a location of Berlin<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: windowtext 1pt solid;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">(&amp;(ObjectCategory=OrganizationalUnit)(Name=*Berlin*)(!L=*))<\/span><\/p>\n<\/td>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: #f0f0f0;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">All organizational units with a name that contains Berlin, but do not have any location specified<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: windowtext 1pt solid;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">(&amp;(ObjectCategory=OrganizationalUnit)(|(L=Berlin)(L=Charlotte)))<\/span><\/p>\n<\/td>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: #f0f0f0;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">All Organizational Units with a location of either Berlin or Charlotte<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"TableText\"><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size: 10pt\">As seen in the examples in Table 1 there are two ways in which the search filter can be specified. The first method is a straight forward assignment filter. The attribute, the operator, and the value make up the filter. This is seen here. <\/span><\/p>\n<p class=\"CodeBlock\" style=\"padding-left: 30px\"><span style=\"font-size: 10pt\"><span style=\"font-family: Lucida Sans Typewriter\">PS C:\\&gt; ([ADSISearcher]&#8221;Name=Charlotte&#8221;).FindAll() | Select Path<\/p>\n<p>Path<br \/>&#8212;-<br \/>LDAP:\/\/OU=Charlotte,DC=nwtraders,DC=com<\/span><\/span><\/p>\n<p><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size: 10pt\">The second way to use the LDAP Search Filter is to combine multiple filters. The operator goes first. You will have the operator, then <i>filter A<\/i> followed by <i>filter B<\/i>. You can combine multiple filters and operators as seen in the syntax examples in Table 1. An example of a compound filter is seen here. (This is a single line command that I have broken to two lines to allow it to be displayed correctly on the blog. The backtick (or grave) character &ldquo;`&rdquo; is used for line continuation. You will not need the backtick character if you type the command on a single line. I have added it, in case you cut and paste it from the blog.)<\/span><\/p>\n<p class=\"CodeBlock\" style=\"padding-left: 30px\"><span style=\"font-size: 10pt\"><span style=\"font-family: Lucida Sans Typewriter\">PS C:\\&gt; ([ADSISearcher]&#8221;(|(Name=Charlotte)(Name=Atlanta))&#8221;).FindAll() | `<\/span><\/span><\/p>\n<p class=\"CodeBlock\" style=\"padding-left: 30px\"><span style=\"font-size: 10pt\"><span style=\"font-family: Lucida Sans Typewriter\">Select Path<\/p>\n<p>Path<br \/>&#8212;-<br \/>LDAP:\/\/OU=Atlanta,DC=nwtraders,DC=com<br \/>LDAP:\/\/OU=Charlotte,DC=nwtraders,DC=com<\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"padding-left: 30px\"><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size: 10pt\">The operators that you can use for either straight forward assignment filters, or compound search filters are listed in Table 2.<\/span><\/p>\n<p><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p class=\"TableNum-Title\"><span style=\"font-size: 10pt\"><strong>Table 2&emsp;LDAP Search Filter Logic Operators<\/strong><\/span><\/p>\n<table cellpadding=\"0\" cellspacing=\"0\" border=\"1\" class=\"MsoNormalTable\" style=\"border-collapse: collapse\">\n<tbody>\n<tr>\n<td width=\"283\" valign=\"top\" style=\"padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;padding-top: 0in;border: windowtext 1pt solid\">\n<p class=\"TableHead\"><span style=\"font-size: 10pt\"><strong>Logical operator <\/strong><\/span><\/p>\n<\/td>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: #f0f0f0;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: windowtext 1pt solid;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableHead\"><span style=\"font-size: 10pt\"><strong>Description<\/strong> <\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: windowtext 1pt solid;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">= <\/span><\/p>\n<\/td>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: #f0f0f0;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">Equal to <\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: windowtext 1pt solid;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">~= <\/span><\/p>\n<\/td>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: #f0f0f0;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">Approximately equal to <\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: windowtext 1pt solid;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">&lt;= <\/span><\/p>\n<\/td>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: #f0f0f0;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">Lexicographically less than or equal to <\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: windowtext 1pt solid;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">&gt;= <\/span><\/p>\n<\/td>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: #f0f0f0;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">Lexicographically greater than or equal to <\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: windowtext 1pt solid;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">&amp; <\/span><\/p>\n<\/td>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: #f0f0f0;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">AND <\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: windowtext 1pt solid;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">| <\/span><\/p>\n<\/td>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: #f0f0f0;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">OR <\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: windowtext 1pt solid;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">! <\/span><\/p>\n<\/td>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: #f0f0f0;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">NOT<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size: 10pt\">Table 3 lists special characters. If any of these special characters must appear in a search filter as a literal character, it must be replaced by the escape sequence. <\/span><\/p>\n<p><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p class=\"TableNum-Title\"><span style=\"font-size: 10pt\"><strong>Table 3&emsp;LDAP Search Filter Special Characters<\/strong><\/span><\/p>\n<table cellpadding=\"0\" cellspacing=\"0\" border=\"1\" class=\"MsoNormalTable\" style=\"border-collapse: collapse\">\n<tbody>\n<tr>\n<td width=\"283\" valign=\"top\" style=\"padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;padding-top: 0in;border: windowtext 1pt solid\">\n<p class=\"TableHead\"><span style=\"font-size: 10pt\"><strong>ASCII character <\/strong><\/span><\/p>\n<\/td>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: #f0f0f0;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: windowtext 1pt solid;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableHead\"><span style=\"font-size: 10pt\"><strong>Escape sequence substitute<\/strong> <\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: windowtext 1pt solid;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">* <\/span><\/p>\n<\/td>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: #f0f0f0;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">\\2a <\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: windowtext 1pt solid;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">( <\/span><\/p>\n<\/td>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: #f0f0f0;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">\\28 <\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: windowtext 1pt solid;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">) <\/span><\/p>\n<\/td>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: #f0f0f0;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">\\29 <\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: windowtext 1pt solid;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">\\ <\/span><\/p>\n<\/td>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: #f0f0f0;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">\\5c <\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: windowtext 1pt solid;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">NUL<\/span><\/p>\n<\/td>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: #f0f0f0;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\"><span>&nbsp;<\/span>\\00 <\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: windowtext 1pt solid;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">\/ <\/span><\/p>\n<\/td>\n<td width=\"283\" valign=\"top\" style=\"border-bottom: windowtext 1pt solid;border-left: #f0f0f0;padding-bottom: 0in;background-color: transparent;padding-left: 5.4pt;width: 2.95in;padding-right: 5.4pt;border-top: #f0f0f0;border-right: windowtext 1pt solid;padding-top: 0in\">\n<p class=\"TableText\"><span style=\"font-size: 10pt\">\\2f <\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size: 10pt\">As seen in the following figure, special characters are allowed in organizational unit names in Active Directory.&nbsp;<\/span><\/p>\n<p><span style=\"font-size: 10pt\"><\/span><span style=\"font-size: x-small\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/8880.HSG-12-01-10-01.jpg\" border=\"0\" \/>&nbsp;<\/span><\/p>\n<p><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size: 10pt\">As seen in the figure, there is an organizational unit with the name *Atlanta. To retrieve this particular organizational unit, you would have to use the <i>\\2a <\/i>character as seen here. <\/span><\/p>\n<p class=\"CodeBlock\" style=\"padding-left: 30px\"><span style=\"font-size: 10pt\"><span style=\"font-family: Lucida Sans Typewriter\">PS C:\\&gt; ([ADSISearcher]&#8221;name=\\2aAtlanta&#8221;).FindAll() | Select Path<\/p>\n<p>Path<br \/>&#8212;-<br \/>LDAP:\/\/OU=*Atlanta,DC=nwtraders,DC=com<\/span><\/span><\/p>\n<p><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size: 10pt\">To retrieve the organizational unit named (Berlin) you have to use the <i>\\28<\/i> and the <i>\\29 <\/i>escape sequences as documented in Table 3. This is seen here.<\/span><\/p>\n<p class=\"CodeBlock\" style=\"padding-left: 30px\"><span style=\"font-size: 10pt\"><span style=\"font-family: Lucida Sans Typewriter\">PS C:\\&gt; ([ADSISearcher]&#8221;name=\\28Berlin\\29&#8243;).FindAll() | Select Path<\/p>\n<p>Path<br \/>&#8212;-<br \/>LDAP:\/\/OU=(Berlin),DC=nwtraders,DC=com<\/span><\/span><\/p>\n<p><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size: 10pt\">There is also an organizational unit named \/Charlotte\\. The escape sequence substitute for the forward slash is <i>\\2f<\/i>. The escape sequence substitute for the backward slash is <i>\\5c<\/i>. To retrieve the organizational unit named \/Charlotte\\ using the LDAP Search Filter and the <b>[ADSISearcher]<\/b> type accelerator, you can use a query that looks like the following.<\/span><\/p>\n<p class=\"CodeBlock\" style=\"padding-left: 30px\"><span style=\"font-size: 10pt\"><span style=\"font-family: Lucida Sans Typewriter\">PS C:\\&gt; ([ADSISearcher]&#8221;name=\\2fCharlotte\\5c&#8221;).FindAll() | Select Path<\/p>\n<p>Path<br \/>&#8212;-<br \/>LDAP:\/\/OU=\\\/Charlotte\\\\,DC=nwtraders,DC=com<\/span><\/span><\/p>\n<p class=\"Readeraidonly\"><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p class=\"Readeraidonly\"><span style=\"font-size: 10pt\">I generally try to avoid using special characters in organizational unit names, user names, group names, computer names and the like. One reason is that I suspect not all applications know how to handle special characters, and I am always afraid that one might not work. Another reason is that, although you can escape the characters in searches, the process is never intuitive, and it costs time trying to figure out how to escape the special character. When you add in the fact the problem will usually occur at 2:00 AM on Saturday Morning (all network problems seem to occur at 2:00 AM on Saturday Morning) when you are likely to forget about escaping the special character, you have a recipe ripe for disaster. Just because something is permitted, does not mean that it is advisable. <\/span><\/p>\n<p><span style=\"font-size: 10pt\">The LDAP Search Filter Special Characters and their associated escape sequence substitutes are documented in Table 3 that was seen earlier. <\/span><\/p>\n<p><span style=\"font-size: 10pt\">By using the <b>Invoke-Command<\/b> cmdlet, the <b>[ADSISearcher]<\/b> can easily be used to query the Active Directory of an un-trusted forest or domain. When doing this, it is frequently important to provide the fully qualified domain name of the computer, because it is possible you may not have complete name resolution using only the NetBios name of the server. It is also best to submit the credentials in a user principal name (UPN) manner as well. When the command is run, the credential dialog box will appear and prompt for the password which must be typed in. The command is seen here (note this is a single line command that I split using the backtick character). <\/span><\/p>\n<p style=\"padding-left: 30px\"><span style=\"font-family: 'Lucida Sans Typewriter','sans-serif';font-size: 10pt;font-weight: normal\">PS C:\\&gt; Invoke-Command -ComputerName Sydney.WoodBridgeBank.Com `<\/span><\/p>\n<p style=\"padding-left: 30px\"><span style=\"font-family: 'Lucida Sans Typewriter','sans-serif';font-size: 10pt;font-weight: normal\">-Credential administrator@WoodBridgeBank.com `<\/span><\/p>\n<p style=\"padding-left: 30px\"><span style=\"font-family: 'Lucida Sans Typewriter','sans-serif';font-size: 10pt;font-weight: normal\">-ScriptBlock {([ADSISearcher]&#8221;L=Berlin&#8221;).Findall()}<\/span><\/p>\n<p style=\"padding-left: 30px\"><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p style=\"padding-left: 30px\"><span style=\"font-family: 'Lucida Sans Typewriter','sans-serif';font-size: 10pt;font-weight: normal\">PSComputerName<span>&nbsp; <\/span><span>&nbsp;&nbsp;&nbsp;<\/span>: sydney.woodbridgebank.com<\/span><\/p>\n<p style=\"padding-left: 30px\"><span style=\"font-family: 'Lucida Sans Typewriter','sans-serif';font-size: 10pt;font-weight: normal\">RunspaceId<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 112f974a-00aa-417c-8a13-9033a49354bd<\/span><\/p>\n<p style=\"padding-left: 30px\"><span style=\"font-family: 'Lucida Sans Typewriter','sans-serif';font-size: 10pt;font-weight: normal\">PSShowComputerName : True<\/span><\/p>\n<p style=\"padding-left: 30px\"><span style=\"font-family: 'Lucida Sans Typewriter','sans-serif';font-size: 10pt;font-weight: normal\">Path<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: LDAP:\/\/OU=Berlin Bank,DC=woodbridgebank,DC=com<\/span><\/p>\n<p style=\"padding-left: 30px\"><span style=\"font-family: 'Lucida Sans Typewriter','sans-serif';font-size: 10pt;font-weight: normal\">Properties<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: {ou, dscorepropagationdata, whencreated, name&#8230;} <\/span><\/p>\n<p style=\"padding-left: 30px\"><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size: 10pt\">JW, that is all there is to using Windows PowerShell to query Active Directory from the console. To Script or Not to Script week will continue tomorrow when I will talk more about Active Directory. <\/span><\/p>\n<p><span style=\"font-size: 10pt\">I invite you to follow me on <a target=\"_blank\" href=\"http:\/\/bit.ly\/scriptingguystwitter\"><span style=\"color: #0000ff\">Twitter<\/span><\/a> or <a href=\"http:\/\/bit.ly\/scriptingguysfacebook\"><span style=\"color: #0000ff\">Facebook<\/span><\/a>. If you have any questions, send email to me at <a target=\"_blank\" href=\"mailto:scripter@microsoft.com\"><span style=\"color: #0000ff\">scripter@microsoft.com<\/span><\/a> or post them on the <a href=\"http:\/\/social.technet.microsoft.com\/Forums\/en\/ITCG\/threads\/\"><span style=\"color: #0000ff\">Official Scripting Guys Forum<\/span><\/a>. See you tomorrow. Until then, peace.<\/span><\/p>\n<p><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><b><span style=\"font-size: 10pt\">Ed Wilson, Microsoft Scripting Guy<\/span><\/b><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;&nbsp; Summary: Learn how to query Active Directory by using Windows PowerShell without writing a script. &nbsp; Hey, Scripting Guy! Occasionally I have to perform a quick query of Active Directory, but I do not want to write a complicated VBScript or Windows PowerShell script. Is there a way to use Windows PowerShell to query [&hellip;]<\/p>\n","protected":false},"author":595,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[7,51,3,4,8,45],"class_list":["post-16351","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-active-directory","tag-getting-started","tag-scripting-guy","tag-scripting-techniques","tag-searching-active-directory","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>&nbsp;&nbsp; Summary: Learn how to query Active Directory by using Windows PowerShell without writing a script. &nbsp; Hey, Scripting Guy! Occasionally I have to perform a quick query of Active Directory, but I do not want to write a complicated VBScript or Windows PowerShell script. Is there a way to use Windows PowerShell to query [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/16351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/595"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=16351"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/16351\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=16351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=16351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=16351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}