+ Reply to Thread
Results 1 to 13 of 13
  1. dmw
    dmw is offline
    Member
    Join Date
    Aug 2005
    Location
    MA
    Posts
    81

    Certifications
    A+, Network +, MCP, MCSA, CCENT
    #1

    Default Query AD for users created within a certain amount of time

    Hi,

    I am looking to query AD to find all users in an Ou who have been created in the last month. Anyone know which attribute can get me the last part - created date?

    Thanks
    Reply With Quote Quote  

  2. SS -->
  3. New Member royal's Avatar
    Join Date
    Jul 2006
    Location
    Chicago, IL
    Posts
    3,373
    #2
    Well, I am currently at home and loaded up my Longhorn machine and checked out the newly created attribute editor. I see an attribute called whenCreated. Perhaps it's usable on Server 2003. Unfortunately, I can't check it out right now as I don't have access to a Server 2003 machine.

    Reply With Quote Quote  

  4. Senior Member
    Join Date
    Apr 2007
    Location
    D.C.
    Posts
    233

    Certifications
    MCP (70-290, 70-291, 70-680)
    #3
    Quote Originally Posted by icroyal
    Well, I am currently at home and loaded up my Longhorn machine and checked out the newly created attribute editor. I see an attribute called whenCreated. Perhaps it's usable on Server 2003. Unfortunately, I can't check it out right now as I don't have access to a Server 2003 machine.

    Just verified, and its the same on W2003/W2000

    *EDIT*

    Just realized with icroyal's screenshot -- looks like with Longhorn they smashed together ADSI Edit with ADUC, nice! That'll make it a little bit easier, and one less MSC to open
    Reply With Quote Quote  

  5. dmw
    dmw is offline
    Member
    Join Date
    Aug 2005
    Location
    MA
    Posts
    81

    Certifications
    A+, Network +, MCP, MCSA, CCENT
    #4
    I don't see the atttribute tab. Windows 2003 R2 SP2?

    Do I need to add a reg key?
    Reply With Quote Quote  

  6. New Member royal's Avatar
    Join Date
    Jul 2006
    Location
    Chicago, IL
    Posts
    3,373
    #5
    He was referring to the existence of the attribute in Server 2003 rather than the GUI displaying it. The Attribute Editor tab is a Longhorn only feature.
    Reply With Quote Quote  

  7. Senior Member
    Join Date
    Apr 2007
    Location
    D.C.
    Posts
    233

    Certifications
    MCP (70-290, 70-291, 70-680)
    #6
    Yes, I was just confirming the attribute also exists in 2000/2003.

    I grabbed the attribute via ADSI Edit
    Reply With Quote Quote  

  8. dmw
    dmw is offline
    Member
    Join Date
    Aug 2005
    Location
    MA
    Posts
    81

    Certifications
    A+, Network +, MCP, MCSA, CCENT
    #7
    OK now I see. Lets see what I can do with that. I will report back.
    Reply With Quote Quote  

  9. dmw
    dmw is offline
    Member
    Join Date
    Aug 2005
    Location
    MA
    Posts
    81

    Certifications
    A+, Network +, MCP, MCSA, CCENT
    #8
    Not done yet but I don't see a way this can be done with either dsquery or dsget.
    Reply With Quote Quote  

  10. New Member royal's Avatar
    Join Date
    Jul 2006
    Location
    Chicago, IL
    Posts
    3,373
    #9
    Quote Originally Posted by dmw
    Not done yet but I don't see a way this can be done with either dsquery or dsget.
    It can't be. You'll have to script it or get someone to script it for you. As I am not a scripter, there are others on this forum that might be able to help you out. Also, there are plenty of vbscripting forums that might be able to help you out with what you need.
    Reply With Quote Quote  

  11. Senior Member doom969's Avatar
    Join Date
    Feb 2005
    Location
    127.0.0.1
    Posts
    305

    Certifications
    CTL (Certified TechExam Lurker)
    #10
    Just a thought,
    Cant you use csvde with a filter for the attribute username and whencreated ?
    Or use ldifde and parse the file ?
    not sure if its possible, i might try it

    Doom969
    Reply With Quote Quote  

  12. dmw
    dmw is offline
    Member
    Join Date
    Aug 2005
    Location
    MA
    Posts
    81

    Certifications
    A+, Network +, MCP, MCSA, CCENT
    #11
    Just a thought, doesn't it seem like this should be something that could be done pretty easily?

    Anyways, anyone familar with the tool adfind. I started using it and it looks like I can get the info exported to a text file pretty easily. Both the whencreated and the createtimestamp.

    Not bad
    Reply With Quote Quote  

  13. Senior Member
    Join Date
    Apr 2007
    Location
    D.C.
    Posts
    233

    Certifications
    MCP (70-290, 70-291, 70-680)
    #12
    Quote Originally Posted by dmw
    Just a thought, doesn't it seem like this should be something that could be done pretty easily?

    Anyways, anyone familar with the tool adfind. I started using it and it looks like I can get the info exported to a text file pretty easily. Both the whencreated and the createtimestamp.

    Not bad
    Good call dmw.

    The ADFind tool can be downloaded for free from http://www.joeware.net/freetools/tools/adfind/index.htm
    Reply With Quote Quote  

  14. dmw
    dmw is offline
    Member
    Join Date
    Aug 2005
    Location
    MA
    Posts
    81

    Certifications
    A+, Network +, MCP, MCSA, CCENT
    #13
    So adfind is the answer for and I see myself using this alot more as I get to learn it.

    The command I used to pipe this directly to a csv file which I could then manipulate how I needed.

    adfind -b ou=yourou,dc=yourdomain,dc=com -f "objectcategory=user" cn
    whenCreated -tdcgt -csv > whencr.csv

    The tdcgt formats the date/time stamp into a human readable form. Also there are forums for adfind here:

    http://www.joeware.net/myforum/viewf...2b2e5c2b2e2fd0
    Reply With Quote Quote  

+ Reply to Thread

Social Networking & Bookmarks