{"id":51423,"date":"2010-02-02T00:01:00","date_gmt":"2010-02-02T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2010\/02\/02\/hey-scripting-guy-can-i-query-active-directory-for-users-whose-passwords-dont-expire\/"},"modified":"2010-02-02T00:01:00","modified_gmt":"2010-02-02T00:01:00","slug":"hey-scripting-guy-can-i-query-active-directory-for-users-whose-passwords-dont-expire","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/hey-scripting-guy-can-i-query-active-directory-for-users-whose-passwords-dont-expire\/","title":{"rendered":"Hey, Scripting Guy! Can I Query Active Directory for Users Whose Passwords Don&#039;t Expire?"},"content":{"rendered":"<p class=\"MsoNormal\">&nbsp;<a class=\"addthis_button\" href=\"http:\/\/www.addthis.com\/bookmark.php?v=250&amp;pub=scriptingguys\"><img decoding=\"async\" alt=\"Bookmark and Share\" src=\"http:\/\/s7.addthis.com\/static\/btn\/v2\/lg-share-en.gif\" width=\"125\" height=\"16\"><\/a><\/p>\n<p class=\"MsoNormal\">&nbsp;<\/p>\n<p><img decoding=\"async\" title=\"Hey, Scripting Guy! Question\" border=\"0\" alt=\"Hey, Scripting Guy! Question\" align=\"left\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" width=\"34\" height=\"34\"><\/p>\n<p class=\"MsoNormal\">Hey, Scripting Guy! I am interested in using Windows PowerShell to query Active Directory. We have deployed Windows Server 2008 R2 on our domain, and upgraded one of our domain controllers. I would like to be able to query for a list of all users whose passwords do not expire. When I did a Bing search, I was able to find an <a href=\"http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2005\/08\/29\/how-can-i-get-a-list-of-all-the-users-whose-passwords-never-expire.aspx\"><font face=\"Segoe\">old Hey, Scripting Guy! post<\/font><\/a> that talks about finding users without expiring passwords, but it was written in VBScript and appears pretty complicated. Is there an easy way to migrate this script to Windows PowerShell 2.0?<\/p>\n<p class=\"MsoNormal\">&#8212; VN<\/p>\n<p class=\"MsoNormal\">\n<p>&nbsp;<\/p>\n<p class=\"MsoNormal\"><img decoding=\"async\" title=\"Hey, Scripting Guy! Answer\" border=\"0\" alt=\"Hey, Scripting Guy! Answer\" align=\"left\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" width=\"34\" height=\"34\">Hello VN, <\/p>\n<p class=\"MsoNormal\">Microsoft Scripting Guy Ed Wilson here. The Scripting Wife bought me a new stainless steel teapot. I, um, kept breaking the previous teapots she bought. Whoops. I decided to test my new tea pot in preparation for a meeting with the people from PoshCode.org about hosting the 2010 Scripting Games. I made a nice green tea with cinnamon stick and lemon grass. It worked out well, and the meeting went smoothly. We have already begun to announce the 2010 Scripting Games, and registration for the games will be open soon. We are returning the competitive aspect to the games, because it seems scripters are a bloodthirsty lot and want to know who is the best. There will be all kinds of cool prizes and a grand prize for the best scripter who enters the games. We will have certificates, and a script-off if the games are tied at the end. Our partnership with the Microsoft MVPs at PoshCode.org is really beginning to pay off. Stay tuned for more details. If you are on <a href=\"http:\/\/bit.ly\/scriptingguystwitter\">Twitter<\/a>, create a filter for #2010sg to quickly find the 2010 Scripting Games details when they become available. <\/p>\n<p class=\"MsoNormal\">To find all of the users in an Organizational Unit (OU) as well as all of the users in child OUs, you need to specify the <b>searchbase<\/b>. A VBScript that will list all of the users in an OU and in all of the child OUs was the feature of a <a href=\"http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2005\/10\/13\/how-can-i-get-a-list-of-all-the-users-in-an-ou-and-its-sub-ous.aspx\"><font face=\"Segoe\">Hey, Scripting Guy! post several years ago<\/font><\/a>. That script required 17 lines of code to perform the query. In Windows PowerShell 2.0, using the Active Directory module from the <a href=\"http:\/\/www.microsoft.com\/downloads\/details.aspx?displaylang=en&amp;FamilyID=7d2f6ad7-656b-4313-a005-4e344e43997d\">Windows Server 2008 R2 Remote Server Admin Tools<\/a> (RSAT), it is a single line of code. After you have imported the <b>ActiveDirectory<\/b> module by using the <b>Import-Module<\/b> cmdlet, you can use the <b>Get-ADUser<\/b> cmdlet to search and retrieve all of the users from a specific organizational unit (OU). <\/p>\n<p class=\"Readeraidonly\">For more information about installing the RSAT tools on Windows 7 and using the <b>ActiveDirectory<\/b> module, refer to <a href=\"http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2010\/01\/25\/hey-scripting-guy-january-25-2010.aspx\">last Monday&rsquo;s Hey Scripting Guy! post<\/a>.<\/p>\n<p class=\"MsoNormal\">To retrieve all of the users from a specific location, supply the wild card character (&ldquo;*&rdquo;) to the <b>-filter<\/b> parameter. To search recursively beginning at a particular location in Active Directory, use the <b>&ndash;searchbase<\/b> parameter. The beginning search location must be supplied to the <b>&ndash;searchbase<\/b> parameter as a distinguished name value. If you are unsure about what the distinguished name of a particular OU is, you can look it up in the ADSI Edit utility. Most of the time, you will find a link to ADSI Edit in the administrative tools folder. If, for some reason, the shortcut is unavailable, you can always create a custom Microsoft Management Console (MMC) that contains it. To open a blank MMC this, click <b>Start<\/b>, type <span>mmc<\/span> in the Search box, and then press ENTER. Or click <b>Start<\/b>, click <b>Run<\/b>, type <span>mmc<\/span>, and click <b>OK<\/b>. <\/p>\n<p class=\"MsoNormal\">After you have an empty MMC, you can click <b>Add\/Remove Snap-in<\/b> on the <b>File<\/b> menu, select <b>ADSI Edit<\/b> on the Available Snap-ins list, click <b>Add<\/b>, and then click <b>OK<\/b>. After you have ADSI Edit added to your MMC, right-click <b>ADSI Edit<\/b>, click <b>Connect-To<\/b>, and choose the <b>Default Naming Context<\/b>. Use the arrows on the left to navigate to the OU you are interested in querying. After you have found the OU you want to query, right-click it and then click <b>Properties<\/b> in the shortcut menu. The dialog box appears that is shown in the following image. <\/p>\n<p class=\"Fig-Graphic\"><img decoding=\"async\" title=\"Image of Properties dialog box\" alt=\"Image of Properties dialog box\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/february\/hey0202\/hsg-02-2-10-01.jpg\" width=\"414\" height=\"461\"><\/p>\n<p class=\"Fig-Graphic\">When you have access to all the attributes associated with the <b>organizationalunit<\/b> object in AD, you can double-click the <b>distinguishedName<\/b> attribute to get a better look at the value. The dialog shown in the following image appears. <\/p>\n<p class=\"Fig-Graphic\"><img decoding=\"async\" title=\"Image of string attribute editor for distinguishedName\" alt=\"Image of string attribute editor for distinguishedName\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/february\/hey0202\/hsg-02-2-10-02.jpg\" width=\"423\" height=\"152\"><a href=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcent\ner\/qanda\/hsg\/2010\/february\/hey0202\/hsg-02-2-10-02.jpg\"><\/a><\/p>\n<p class=\"Fig-Graphic\">To avoid typing a long and convoluted <b>distinguishedname<\/b> (DN), I will often copy the DN value directly from the dialog box and paste it into the Windows PowerShell console by right-clicking. The completed command is seen here:<\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">PS C:&gt; Get-ADUser -Filter * -SearchBase &#8220;ou=hsg_TestOU,DC=nwtraders,dc=com&#8221;<\/p>\n<p>DistinguishedName : CN=HSG_TestChild,OU=HSG_TestOU1,OU=HSG_TestOU,DC=NWTraders,DC=Com<br \/>Enabled<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: False<br \/>GivenName<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<br \/>Name<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: HSG_TestChild<br \/>ObjectClass<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: user<br \/>ObjectGUID<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 4ffd4a5a-74f3-41ee-ae89-bbb8bd1bd915<br \/>SamAccountName<span>&nbsp;&nbsp;&nbsp; <\/span>: HSG_TestChild<br \/>SID<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: S-1-5-21-3746122405-834892460-3960030898-1161<br \/>Surname<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<br \/>UserPrincipalName :<\/p>\n<p>DistinguishedName : CN=hsgUserGroupTest,OU=HSG_TestOU,DC=NWTraders,DC=Com<br \/>Enabled<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: False<br \/>GivenName<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<br \/>Name<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: hsgUserGroupTest<br \/>ObjectClass<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: user<br \/>ObjectGUID<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: b18e4543-36d5-48e3-b477-389a84ef2d1e<br \/>SamAccountName<span>&nbsp;&nbsp;&nbsp; <\/span>: hsgUserGroupTest<br \/>SID<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: S-1-5-21-3746122405-834892460-3960030898-1193<br \/>Surname<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<br \/>UserPrincipalName :<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\">By default, the <b>Get-ADUser<\/b> cmdlet will automatically recurse through all of the child OUs. If you do not want to recurse through the child OUs because you are only interested in users from a specific OU, you need to modify the <b>&ndash;searchScope<\/b> parameter. There are actually three values you can supply for the <b>searchscope<\/b> parameter: <b>base<\/b>, <b>onelevel<\/b>, and <b>subtree<\/b>. By default, the <b>Get-ADUser<\/b> cmdlet will use the <b>searchscope<\/b> of <b>subtree<\/b> (which means to recurse); therefore, there is no need to supply that value. A base <b>searchscope<\/b> means the query will not enter the <b>searchBase<\/b>, and in this example does not return any users. A <b>searchScope<\/b> of <b>onelevel<\/b> means the search will go into the <b>SearchBase<\/b> OU, and in this example, one user is returned:<\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">PS C:&gt; Get-ADUser -Filter * -SearchBase &#8220;ou=hsg_TestOU,DC=nwtraders,dc=com&#8221; -searchscope onelevel<\/p>\n<p>DistinguishedName : CN=hsgUserGroupTest,OU=HSG_TestOU,DC=NWTraders,DC=Com<br \/>Enabled<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: False<br \/>GivenName<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<br \/>Name<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: hsgUserGroupTest<br \/>ObjectClass<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: user<br \/>ObjectGUID<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: b18e4543-36d5-48e3-b477-389a84ef2d1e<br \/>SamAccountName<span>&nbsp;&nbsp;&nbsp; <\/span>: hsgUserGroupTest<br \/>SID<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: S-1-5-21-3746122405-834892460-3960030898-1193<br \/>Surname<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<br \/>UserPrincipalName :<\/p>\n<p>PS C:&gt;<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\">The hierarchy we are searching, as viewed from Active Directory Users and Computers, is seen in the following image.<\/p>\n<p class=\"Fig-Graphic\"><img decoding=\"async\" title=\"Image of Active Directory Users and Computers hierarchy\" alt=\"Image of Active Directory Users and Computers hierarchy\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/february\/hey0202\/hsg-02-2-10-03.jpg\" width=\"600\" height=\"390\"><a href=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/february\/hey0202\/hsg-02-2-10-03.jpg\"><\/a><\/p>\n<p class=\"Fig-Graphic\">One of the really cool things you can do with the AD DS cmdlets is use the <b>&ndash;LDAPFilter<\/b> parameter. For example, with the <b>Get-ADUser<\/b> cmdlet, perhaps you would like to retrieve all of the users who have a password that does not expire. A <a href=\"http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2005\/08\/29\/how-can-i-get-a-list-of-all-the-users-whose-passwords-never-expire.aspx\"><font face=\"Segoe\">Hey, Scripting Guy! post from several years ago<\/font><\/a> included such a script. In the script, there was a rather complicated LDAP query that returned the users whose password does not expire. The applicable portion of the script is seen here:<\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">objCommand.CommandText = _<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>&#8220;&lt;LDAP:\/\/dc=fabrikam,dc=com&gt;;&#8221; &amp; _<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8220;(&amp;(objectCategory=User)(userAccountControl:1.2.840.113556.1.4.803:=65536));&#8221; &amp; _<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8220;Name;Subtree&#8221;<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span lang=\"EN\">An LDAP dialect query is made up of four portions. The first portion is the location of the LDAP query; the second is the LDAP filter; the third portion is the properties to return; and the last is the search scope. With the <b>Get-\nADUser<\/b> cmdlet, we have parameters for each of those four parameters. We are therefore only interested in the LDAP filter query seen here:<\/p>\n<p><\/span><\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">&#8220;(&amp;(objectCategory=User)(userAccountControl:1.2.840.113556.1.4.803:=65536));&#8221;<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span lang=\"EN\">When copying the LDAP filter query, do not include the trailing semicolon. That is an artifact of the previous query; each portion of an LDAP dialect query is separated by semicolons. The query goes directly into the parameter. There is no need to escape anything with extra quotation marks or anything else. The following command is a single-line command that will wrap when typed into the Windows PowerShell console. It accomplishes in one line the same thing the earlier Scripting Guy VBScript took 17 lines to do:<\/p>\n<p><\/span><\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">PS C:&gt; Get-ADUser -SearchBase &#8220;dc=nwtraders,dc=com&#8221; -searchscope subtree -ldapfilter &#8220;(&amp;(objectCategory=User)(userAccountControl:1.2.840.113556.1.4.803:=65536))&#8221;<\/p>\n<p>DistinguishedName : CN=Guest,CN=Users,DC=NWTraders,DC=Com<br \/>Enabled<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: False<br \/>GivenName<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<br \/>Name<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: Guest<br \/>ObjectClass<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: user<br \/>ObjectGUID<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 5b0b1ce3-808f-4976-b80e-356adc1dc7e6<br \/>SamAccountName<span>&nbsp;&nbsp;&nbsp; <\/span>: Guest<br \/>SID<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: S-1-5-21-3746122405-834892460-3960030898-501<br \/>Surname<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<br \/>UserPrincipalName :<\/p>\n<p>DistinguishedName : CN=another User,OU=HSG_TestOU,DC=NWTraders,DC=Com<br \/>Enabled<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: True<br \/>GivenName<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: another<br \/>Name<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: another User<br \/>ObjectClass<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: user<br \/>ObjectGUID<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: f8315b67-ee23-486d-9bfc-a5e118f0392a<br \/>SamAccountName<span>&nbsp;&nbsp;&nbsp; <\/span>: anotherUser<br \/>SID<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: S-1-5-21-3746122405-834892460-3960030898-1202<br \/>Surname<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: User<br \/>UserPrincipalName : anotherUser@NWTraders.Com<\/p>\n<p>DistinguishedName : CN=AHappy Camper,OU=HSG_TestOU,DC=NWTraders,DC=Com<br \/>Enabled<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: True<br \/>GivenName<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: AHappy<br \/>Name<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: AHappy Camper<br \/>ObjectClass<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: user<br \/>ObjectGUID<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 6852f2bc-37d5-46b5-b6da-4365c7009dfc<br \/>SamAccountName<span>&nbsp;&nbsp;&nbsp; <\/span>: AHappyCamper<br \/>SID<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: S-1-5-21-3746122405-834892460-3960030898-1203<br \/>Surname<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: Camper<br \/>UserPrincipalName : AHappyCamper@NWTraders.Com<\/p>\n<p>PS C:&gt;<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\">&nbsp;<\/p>\n<p class=\"MsoNormal\">VN, that is all there is to using the AD DS cmdlets to search User objects. Searching Active Directory Week will continue tomorrow. <\/p>\n<p class=\"MsoNormal\">If you want to know exactly what we will be discussing tomorrow, follow us on <a href=\"http:\/\/bit.ly\/scriptingguystwitter\" target=\"_blank\">Twitter<\/a> or <a href=\"http:\/\/bit.ly\/scriptingguysfacebook\"><font face=\"Segoe\">Facebook<\/font><\/a>. If you have any questions, send e-mail to us at <a href=\"http:\/\/blogs.technet.commailto:scripter@microsoft.com\" target=\"_blank\"><font face=\"Segoe\">scripter@microsoft.com<\/font><\/a> or post your questions on the <a href=\"http:\/\/bit.ly\/scriptingforum\" target=\"_blank\">Official Scripting Guys Forum<\/a>. See you tomorrow. Until then, peace.<\/p>\n<p>&nbsp;<\/p>\n<\/p>\n<p><b><span>Ed Wilson and Craig Liebendorfer, Scripting Guys<\/p>\n<p><\/span><\/b><\/p>\n<p><p>&nbsp;<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; &nbsp; Hey, Scripting Guy! I am interested in using Windows PowerShell to query Active Directory. We have deployed Windows Server 2008 R2 on our domain, and upgraded one of our domain controllers. I would like to be able to query for a list of all users whose passwords do not expire. When I did [&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,3,8,45],"class_list":["post-51423","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-active-directory","tag-scripting-guy","tag-searching-active-directory","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>&nbsp; &nbsp; Hey, Scripting Guy! I am interested in using Windows PowerShell to query Active Directory. We have deployed Windows Server 2008 R2 on our domain, and upgraded one of our domain controllers. I would like to be able to query for a list of all users whose passwords do not expire. When I did [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/51423","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=51423"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/51423\/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=51423"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=51423"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=51423"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}