Neptune IT
asked on
PS script to obtain "password never expire"
Hi,
I am trying to run a PS script to get All the ad users in specific OU with Password set to never expire. Following is the script that i wrote however i also would like to add the "description" field in the output. I tried with following but the description comes out as blank,even though specific object does have description. Also if any way i can organize regular account vs service account.
Search-ADAccount -PasswordNeverExpires -SearchBase 'OU=Canada,DC=slbntdom,DC= neptunetg, DC=com' | Select-Object name, DistinguishedName, Description
I am trying to run a PS script to get All the ad users in specific OU with Password set to never expire. Following is the script that i wrote however i also would like to add the "description" field in the output. I tried with following but the description comes out as blank,even though specific object does have description. Also if any way i can organize regular account vs service account.
Search-ADAccount -PasswordNeverExpires -SearchBase 'OU=Canada,DC=slbntdom,DC=
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I could have posted the exact same script as you and you would still have found an issue with it :P
Maybe, maybe not ...
ASKER
Thank you guys
Open in new window
Shaun,
it's, well, "bad style" (that is, additional and easily avoidable load on the DCs) to retrieve all properties of a user, only to throw away most of them immediately afterwards.