powershell - How can I detect whether AD user password is expired without a second account to query AD? -


i have created (powershell) wizard guide user through process (remotely) join computer domain. script runs under login of (standard) local administrator , queries ad , joins computer (add-computer) using credentials of concerned user. user has explicit permissions on 1 or more specific ad computer accounts join computer domain (he not domain administrator).

everything works fine new hires password set “user must change password @ next logon”. whenever query in ad using credentials of user password expired, general error: “unknown user name or bad password.”

how can determine password expired account (not using other accounts) prompt password change?

is possible @ all? (how windows os @ logon?)

this question not same how can query users expired password in active directory? because in scenario, have account available query ad.

found this, unable test @ point get-aduser $env:username -properties passwordexpired, passwordneverexpires, passwordlastset

edit: mentioned, can not query ad running under local admin account not part of ad , not have ad account query password expiration account testing.

this seems design, new hires you'd need devise way make password expire after time, instead of upon first logon.


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -