Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Creation date of users in AD

Posted on 2007-07-22
6
Medium Priority
?
889 Views
Last Modified: 2012-08-14
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
0
Comment
Question by:tollair
  • 2
  • 2
5 Comments
 
LVL 19

Accepted Solution

by:
William Elliott earned 200 total points
ID: 19544677
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
 

Author Comment

by:tollair
ID: 19552816
thanks for that, are you able to add in code for OU for each user as well?
0
 

Author Comment

by:tollair
ID: 19552845
Just one more thing, the output doesn't show the creation date.
0
 
LVL 19

Expert Comment

by:William Elliott
ID: 19561041
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
 
LVL 1

Expert Comment

by:Computer101
ID: 21392511
Forced accept.

Computer101
EE Admin
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Uncontrolled local administrators groups within any organization pose a huge security risk. Because these groups are locally managed it becomes difficult to audit and maintain them.
Scripts are great for performing batch jobs against users, however sometimes the GUI is all you need.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
Suggested Courses

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question