Announcement

Collapse
No announcement yet.

AD Export Help

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • AD Export Help

    Hi

    I need to export a list of all accounts from AD where the password is set to non expire, and also get the last logon time for each account.

    I've tried the usual ldifde and csvde commands but can't get the exact information that i need.

    Does anyone have a vb or powershell script or can point me in the right direction of where to find a script that could help.

    Thanks in advance

  • #2
    Re: AD Export Help

    I would suggest adfind.
    few examples

    Just for one user
    adfind -samdc -b DC=company,DC=com -f "&(name=username*)(objectcategory=user)" -tdcd lastLogonTimestamp useraccountcontrol -csv

    For all user objects
    adfind -samdc -b DC=company,DC=com -f objectcategory=user -tdcd lastLogonTimestamp useraccountcontrol -csv

    If you would like to enumerate it for particular OU change the -b DC=company,DC=com to DN of OU.

    Hope it helps

    Reference: http://blog.joeware.net

    Comment

    Working...
    X