Dave Stone
asked on
AD Users With Expiration
Hi,
I am using ADFind to list my AD users. I would like to add the account expirations if possible. Here is the current script that gives me all the users with their names:
adfind -default -f "&(objectcategory=person)( objectclas s=user)" samaccountname displayname -csv > c:\users.csv
Is this possible?
Thank you
I am using ADFind to list my AD users. I would like to add the account expirations if possible. Here is the current script that gives me all the users with their names:
adfind -default -f "&(objectcategory=person)(
Is this possible?
Thank you
Do you want to continue using adfind, or powershell?
Use to luv me some joeware!!
You prolly can't really read it though, cause it is in MS speak....
adfind -default -f "&(objectcategory=person)(objectclass=user)" samaccountname displayname accountexpires -csv > c:\users.csv
You prolly can't really read it though, cause it is in MS speak....
ASKER
Me love joeware too! However the dates came back as: 9.22337E+18
Thank you
Thank you
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I ran the last script in the elevated powershell as directed. It returned the names but no expiration dates. The column was there but they were all blank.
Are the accounts set to "not expire"? Spot check and see if an account actually has an expiration date.
ASKER
Ah ha! That is it. Hey, thanks for your help. Would you want to throw in a lookup for expiring passwords?
How about this,
This will give you all the properties for your AD account, then find the one(s) you want and add it to the command I gave you above. :)
get-aduser your-user-name -properties *
This will give you all the properties for your AD account, then find the one(s) you want and add it to the command I gave you above. :)
ASKER
Thanks again