Creation date of users in AD

Does any one know how i can export a list of users from AD including the creation date and the last time the password was changed?
Thanks
tollairAsked:
Who is Participating?
 
William ElliottSr Tech GuruCommented:
Purpose: To create a CSV listing of all users in Active Directory, listing whether the account is disabled or enabled, provide both first and last name for sorting, and list the last time the password on the account was reset, allowing for the flagging of accounts that need to be investigated and/or disabled
http://www.scriptinganswers.com/vault/AD%20Administration/Active%20Directory%20User%20Account%20Audit%20with%20Last%20Password%20Reset.zip


this will get specific user object details including creations time. you can incorporate the two if needed


Set objUser = GetObject _
    ("GC://cn=MyerKen,ou=Management,dc=NA,dc=fabrikam,dc=com")
 
strWhenCreated = objUser.Get("whenCreated")
strWhenChanged = objUser.Get("whenChanged")
Set objUSNChanged = objUser.Get("uSNChanged")
dblUSNChanged = _
    Abs(objUSNChanged.HighPart * 2^32 + objUSNChanged.LowPart)
Set objUSNCreated = objUser.Get("uSNCreated")
dblUSNCreated = _
    Abs(objUSNCreated.HighPart * 2^32 + objUSNCreated.LowPart)
objUser.GetInfoEx Array("canonicalName"), 0
arrCanonicalName = objUser.GetEx("canonicalName")
WScript.echo "Canonical Name of object:"
For Each strValue in arrCanonicalName
    WScript.Echo vbTab & strValue
Next
WScript.Echo
WScript.Echo "Object class: " & objUser.Class
WScript.echo "When Created: " & strWhenCreated & " (Created - GMT)"
WScript.echo "When Changed: " & strWhenChanged & " (Modified - GMT)"
WScript.Echo
WScript.Echo "USN Changed: " & dblUSNChanged & " (USN Current)"
WScript.Echo "USN Created: " & dblUSNCreated & " (USN Original)"
0
 
tollairAuthor Commented:
thanks for that, are you able to add in code for OU for each user as well?
0
 
tollairAuthor Commented:
Just one more thing, the output doesn't show the creation date.
0
 
William ElliottSr Tech GuruCommented:
one question are you familiar with vbs and how to modify it?  if so you can pull the code from the first script to search the entire AD infrastructure for the second code.. or combine them into one.

scriptinganswers.com may have one available already.

the real question is why do you need this information?will it be used with other information, i may have a script that does what you need this to do.
0
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.