Learn about Windows PowerShell
Hey, Scripting Guy! Is there any way to tell the date that an Active Directory user account was created?-- DD
Hey, DD. And thanks: between the work that piled up over the holidays, the upcoming Scripting Week 2, and a nasty flu bug that’s going around, it’s nice to have a question that can be answered with just two lines of code.
That’s right: two lines of code. To determine the date that a user account (or any other Active Directory object) was created, all you have to do is bind to the account and retrieve the value of the WhenCreated attribute:
Set objUser = GetObject("LDAP://cn=ken myer, ou=Finance, dc=fabrikam, dc=com") Wscript.Echo objUser.WhenCreated
Cool, huh? The nice thing is that the value comes back as a real date and time, something on the order of 1/6/2005 8:10 AM. If you know anything about Active Directory, you know it isn’t always this easy to work with dates.
Incidentally, it’s just as easy to determine when an account was last modified. All you need to do is retrieve the value of the WhenChanged attribute:
Set objUser = GetObject("LDAP://cn=ken myer, ou=Finance, dc=fabrikam, dc=com") Wscript.Echo objUser.WhenChanged
We know: it seems way too easy, doesn’t it? But, hey, enjoy it while you can; one of these days we’ll talk about the last logon and last logoff dates, and we can guarantee you that those won’t be quite as easy.
How do i find all the users on particular date in Active directory?
What events cause the Last Modified date to change?
Nice and to the point. Thanks, But, how can I find all the accounts that were created on a specific date?
How can I tell "who" created a user in AD
What is the command to find the computer objects from create date
is it possible to determine when a user was added to a specific group
Hi how can i export a list of users from perticular OU to text file which contain this created field
for examples, a list of all users from "AU\OU Test user\blabla" to user.txt with this info
For windows power shell run this for the user gbest
get-aduser -identity gbest -properties whencreated
why not just one line???
Wscript.Echo GetObject("LDAP://cn=ken myer, ou=Finance, dc=fabrikam, dc=com").WhenCreated
Wscript.Echo GetObject("LDAP://cn=ken myer, ou=Finance, dc=fabrikam, dc=com").WhenChanged