This is a C# port/packaging of ldapdomaindump adapted to build as a .NET Framework 4.5 executable.
This repository was adapted from the original project by dirkjan: https://github.com/dirkjanm/ldapdomaindump Thanks to the original author and contributors.
- .NET Framework 4.5 Developer Pack (to compile)
- Visual Studio (or MSBuild) for building
- PowerShell 5+ (for
Compress-Archiveused by the tool to create ZIP archives)
The project includes support for ILMerge via ILMerge.MSBuild.Task. The task requires a native ILMerge.exe to be available. Configure the path in LDAPDomainDump.csproj using the AlternativeILMergePath MSBuild property, for example:
<AlternativeILMergePath>$(MSBuildProjectDirectory)\\tools\\ilmerge\\ILMerge.exe</AlternativeILMergePath>
If you don't need ILMerge, you may remove the ILMerge.MSBuild.Task PackageReference from the project file.
From a Developer Command Prompt (Visual Studio) in the project directory:
- Build (Release):
msbuild /p:Configuration=Release LDAPDomainDump.csproj
Or open the project in Visual Studio and build the solution.
After building, run the produced LDAPDomainDump.exe from the command line. It uses the current Windows user's credentials to bind to LDAP.
Usage:
LDAPDomainDump.exe [options]
Options:
--outdir <path>, -o <path> Directory where generated reports will be written (default: current directory)
--archive <name>, -a <name> Archive filename for generated reports (default: ldapdomaindump_reports.zip)
--no-compress, -n Don't compress the generated reports
--dc <ip|host>, -dc <ip|host> Use this domain controller (IP or hostname) instead of doing DNS discovery
Examples:
- Dump domain and write reports to
C:\reports:
LDAPDomainDump.exe -o C:\reports
- Dump and create
myreports.zip, remove original files after compression:
LDAPDomainDump.exe -o C:\reports -a myreports.zip
- Use a specific domain controller:
LDAPDomainDump.exe --dc 192.168.1.10
The tool generates these files (in the output directory):
domain_users.html,domain_users.json,domain_users.grepdomain_groups.html,domain_groups.json,domain_groups.grepdomain_computers.html,domain_computers.json,domain_computers.grepdomain_policy.html,domain_policy.json,domain_policy.grepdomain_trusts.html,domain_trusts.json,domain_trusts.grepdomain_users_by_group.htmldomain_computers_by_os.html
If compression is enabled the generated files will be archived into the ZIP file you specified and the original files deleted.
This repository is provided under the MIT License (see LICENSE if included). The original ldapdomaindump project by Dirk-jan is available at: https://github.com/dirkjanm/ldapdomaindump
Thanks to Dirk-jan and contributors for the original ldapdomaindump project which inspired and provided the base functionality.
If you want the README adjusted (add more build details, CI, or packaging instructions), tell me what to include.