How to export AD on prem all users and their all attributes?

Vinod Survase 4,756 Reputation points
2021-11-08T17:10:48+00:00

How to export AD on prem all users and their all attributes along with all groups and computers from AD?

Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,835 questions
0 comments No comments
{count} votes

Accepted answer
  1. Andreas Baumgarten 116.9K Reputation points MVP
    2021-11-08T17:43:01.78+00:00

    Hi @Vinod Survase ,

    using PowerShell it could look like this:

    Import-Module ActiveDirectory  
    Get-ADUser -Filter * -Properties * | Export-Csv c:\junk\allADusers.csv -NoTypeInformation  
    

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten

    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Gary Reynolds 9,581 Reputation points
    2021-11-09T02:12:42.167+00:00

    Hi,

    An alternative option is to use ldifde to dump the AD objects and attributes,

    ldifde -r "(|(objectcategory=user)(objectclass=group)(objectcategory=computer))" -f export.ldf
    

    Gary.

    1 person found this answer helpful.

  2. Gary Nebbett 6,106 Reputation points
    2021-11-11T11:18:39.17+00:00

    Hello @Vinod Survase ,

    Depending on what you mean by "all attributes", then yet another option (with different characteristics to the other suggestions) is to use the Directory Replication Service (DRS) Remote Protocol documented in [MS-DRSR]. This would obtain all attributes, including password related information (hashes, history, etc.). I don't think that there is an "off-the-shelf" tool that does what you possibly want but, if you have the right background, it is fairly easy to develop a tool based on [MS-DRSR].

    Gary


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.