{"id":2385,"date":"2020-04-20T09:08:46","date_gmt":"2020-04-20T09:08:46","guid":{"rendered":"http:\/\/galhano.com\/blog\/?p=2385"},"modified":"2026-01-20T10:39:30","modified_gmt":"2026-01-20T10:39:30","slug":"using-net-user-command-to-display-user-expiration-date","status":"publish","type":"post","link":"http:\/\/galhano.com\/blog\/?p=2385","title":{"rendered":"Using Net User command to Display User Expiration Date"},"content":{"rendered":"\n<p>[ps]Net user USERNAME \/domain[\/ps]<\/p>\n\n\n\n<p>Using Powershell<\/p>\n\n\n\n<p>[ps]get-aduser -filter * -properties passwordlastset, passwordneverexpires |ft Name, passwordlastset, Passwordneverexpires[\/ps]<\/p>\n\n\n\n<p> To display the expiration date rather than the password last set date, use this command. <\/p>\n\n\n\n<p>[ps<\/p>\n\n\n\n[ps]Get-ADUser -filter {Enabled -eq $True -and PasswordNeverExpires -eq $False} \u2013Properties &#8220;DisplayName&#8221;, &#8220;msDS-UserPasswordExpiryTimeComputed&#8221; |\nSelect-Object -Property &#8220;Displayname&#8221;,@{Name=&#8221;ExpiryDate&#8221;;Expression={[datetime]::FromFileTime($_.&#8221;msDS-UserPasswordExpiryTimeComputed&#8221;)}}[\/ps]\n\n\n\n<p><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>[ps]Net user USERNAME \/domain[\/ps] Using Powershell [ps]get-aduser -filter * -properties passwordlastset, passwordneverexpires |ft Name, passwordlastset, Passwordneverexpires[\/ps] To display the expiration date rather than the password last set date, use this command. [ps [ps]Get-ADUser -filter {Enabled -eq $True -and PasswordNeverExpires -eq $False} \u2013Properties &#8220;DisplayName&#8221;, &#8220;msDS-UserPasswordExpiryTimeComputed&#8221; | Select-Object -Property &#8220;Displayname&#8221;,@{Name=&#8221;ExpiryDate&#8221;;Expression={[datetime]::FromFileTime($_.&#8221;msDS-UserPasswordExpiryTimeComputed&#8221;)}}[\/ps]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33,215,161],"tags":[],"class_list":["post-2385","post","type-post","status-publish","format-standard","hentry","category-code-snippets","category-active-directory","category-powershell","author-admin"],"_links":{"self":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2385"}],"version-history":[{"count":4,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2385\/revisions"}],"predecessor-version":[{"id":2389,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2385\/revisions\/2389"}],"wp:attachment":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2385"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}