Sunday, July 12, 2009

LDAP Query for User Accounts Created Since a Specific Date

Just modify the date string to use the YYYYMMDDHHMMSS.0Z format. So, for June 1, 2009, you would specify "20090601000000.0Z"


(&(objectCategory=user)(whenCreated>=20090601000000.0Z))

7 comments:

  1. Awesome, thanks... this helped me so much!

    ReplyDelete
  2. Replies
    1. Thank you! Glad it was helpful.

      Delete
    2. Oh totally!

      BTW, love the catch phrase on the header :)

      Delete
  3. I go looking for this information and am not surprised at all at who the OP is. Thanks Dave!

    ReplyDelete
  4. It worked! Is there a way to export the query result to a text or csv?

    ReplyDelete

  5. $Ldate = New-Object System.DateTime(2017,3,1)

    Get-ADUser -Properties name,distinguishedName,whenCreated -Filter {(objectClass -eq "user") -and (whenCreated -ge $Ldate)} |
    ConvertTo-Csv -NoTypeInformation |
    Out-File "adusers.csv"

    ReplyDelete