Getting the Domain Name of your Active Directory using C# or VB .Net
This is a simple method to return the doamin name of the ADDS server
Parameters: (string) Server name
Programming Languages Supported
ASP.NET, C#, VB.Net, Visual Studio 2010, Visual Sutdio 2012
An instance of the LDAP manager must be instantiated for a valid ADDS server.
The method is called passing the Username as a string. Three
things can then occur:
- The domain name is returned
- An Exception will be thrown for other errors
Where LdapConnection is an instance of LdapManager
public String GetDomainName(String server)
This method does not result in any "Login" context.