Domain.FindDomainController Method ()

 

Finds any domain controller in this domain.

Namespace:   System.DirectoryServices.ActiveDirectory
Assembly:  System.DirectoryServices (in System.DirectoryServices.dll)

public DomainController FindDomainController()

Return Value

Type: System.DirectoryServices.ActiveDirectory.DomainController

A DomainController that represents the domain controller that is found by this method.

Exception Condition
ActiveDirectoryObjectNotFoundException

A domain controller cannot be located.

ActiveDirectoryOperationException

A call to the underlying directory service resulted in an error.

ObjectDisposedException

The object has been disposed.

This method finds any domain controller in the domain. There is no guarantee that the same domain controller will be found by another call to this method.

.NET Framework
Available since 2.0
Return to top
Show: