A C# utility that enumerates domain computers and tests administrative access to them, including connectivity checks, admin privileges verification, and C$ share writability testing.
- Enumerate all computers in an Active Directory domain
- Test network connectivity
- Verify administrative access using Service Control Manager (SCM) API
- Test C$ administrative share writability
- Support for both synchronous and asynchronous processing
- Flexible domain and domain controller specification
- Single computer testing mode
- .NET Framework (or .NET Core/5+)
- Windows operating system
- Domain-joined machine or domain credentials
- Appropriate Active Directory query permissions
- Administrative rights on target computers (to verify access)
FindAdminAccess.exe [options]| Option | Description |
|---|---|
--async |
Process computers asynchronously for faster execution |
--domain <name> |
Specify domain name (e.g., contoso.com) |
--dc <server> |
Specify domain controller to query |
--computer <name> |
Test a specific computer only |
--help, -h, /? |
Show help message |
Test all computers in the current domain (synchronous):
FindAdminAccess.exeTest all computers asynchronously (faster but resources heavy):
FindAdminAccess.exe --asyncSpecify domain and domain controller:
FindAdminAccess.exe --domain contoso.com --dc dc01.contoso.comTest a specific computer:
FindAdminAccess.exe --computer SERVER01 --asyncThe tool displays results in a table format:
Computer Name Online Admin Handle C$ Writable
---------------------------------------------------------------------------
SERVER01.contoso.com Yes Yes Yes
WORKSTATION02.contoso.com Yes No N/A
OFFLINE-PC.contoso.com No N/A N/A
- Computer Name: FQDN of the computer
- Online: Whether the computer responds to ping
- Admin Handle: Whether administrative access (SCM) is available
- C$ Writable: Whether the administrative C$ share is writable
- Computer Enumeration: Queries Active Directory using
PrincipalContextandComputerPrincipalto retrieve all computer objects - Connectivity Check: Uses ICMP ping with 1-second timeout to verify network connectivity
- Admin Access Test: Attempts to open Service Control Manager with
SC_MANAGER_ALL_ACCESSrights via P/Invoke - C$ Share Test: Tries to create and delete a test file on the administrative C$ share
- Open the solution in Visual Studio
- Build the project (Ctrl+Shift+B)
csc /out:FindAdminAccess.exe Program.csOr with .NET CLI:
dotnet buildIf you encounter domain connection errors, try these steps:
- Verify DNS resolution of the domain/DC
- Check if LDAP ports (389/636/3268/3269) are accessible
- Try using just
--dcwithout--domainparameter - Try using the DC's FQDN instead of IP address
- Ensure you have domain query permissions
- Local machine testing is in the TODO
- Async mode significantly increases performance for large domains
- Failed admin access attempts do not generate verbose errors by default (can be enabled in code)
Lsecqt