Prashant Girennavar
asked on
Turn off Password never expires on local administrator account
Hello Experts,
we have some servers where the Password Never Expires flag is checked , and I am trying to find out a scripting way to uncheck these option so that password expires on the Local administrator account.
There are -bor 0x10000 (https://social.technet.microsoft.com/Forums/en-US/e4e96a5e-3b28-4673-8c61-d4abdf8f2426/win-7-setting-the-option-password-never-expires-for-a-specific-local-user?forum=winserverpowershell) which turn this option ON.
But , what is need is exact opposite. I want to turn off the option so that , the password gets expired.
Thanks,
-Prashant Girennavar.
we have some servers where the Password Never Expires flag is checked , and I am trying to find out a scripting way to uncheck these option so that password expires on the Local administrator account.
There are -bor 0x10000 (https://social.technet.microsoft.com/Forums/en-US/e4e96a5e-3b28-4673-8c61-d4abdf8f2426/win-7-setting-the-option-password-never-expires-for-a-specific-local-user?forum=winserverpowershell) which turn this option ON.
But , what is need is exact opposite. I want to turn off the option so that , the password gets expired.
Thanks,
-Prashant Girennavar.
ASKER
Hello Sandeep,
This is not about AD account. This is about local administrator account on member servers.
Any other suggestions please.
Thanks,
-Prashant Girennavar.
This is not about AD account. This is about local administrator account on member servers.
Any other suggestions please.
Thanks,
-Prashant Girennavar.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can also use adfind and admod from Joe richards
http://www.joeware.net/freetools/tools/adfind/index.htm
http://www.joeware.net/freetools/tools/admod/
adfind -default -bit -f "&(objectcategory=person)(
I've included two screenshots
The first is just the adfind command not piped to admod to show you what accounts have the flag set for the password to never expire.
Note by default admod only changes 10 objects (great safety feature). I added the -unsafe switch and it will do all the accounts.
Thanks
password-not-expire-adfind.jpg
password-not-expire-admod.jpg