Op Englesch liesen Editéieren

Deelen iwwer


Domain.FindDomainController Method

Definition

Finds any domain controller in this domain.

Overloads

FindDomainController()

Finds any domain controller in this domain.

FindDomainController(LocatorOptions)

Finds a domain controller in this domain that meets the specified criteria.

FindDomainController(String)

Finds a domain controller in this domain and in the specified site.

FindDomainController(String, LocatorOptions)

Finds a domain controller in this domain and in the specified site that meets the specified criteria.

FindDomainController()

Source:
Domain.cs
Source:
Domain.cs
Source:
Domain.cs
Source:
Domain.cs
Source:
Domain.cs

Finds any domain controller in this domain.

C#
public System.DirectoryServices.ActiveDirectory.DomainController FindDomainController();

Returns

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

Exceptions

A domain controller cannot be located.

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

The object has been disposed.

Remarks

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.

See also

Applies to

.NET 10 (package-provided) an aner Versiounen
Produkt Versiounen
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

FindDomainController(LocatorOptions)

Source:
Domain.cs
Source:
Domain.cs
Source:
Domain.cs
Source:
Domain.cs
Source:
Domain.cs

Finds a domain controller in this domain that meets the specified criteria.

C#
public System.DirectoryServices.ActiveDirectory.DomainController FindDomainController(System.DirectoryServices.ActiveDirectory.LocatorOptions flag);

Parameters

flag
LocatorOptions

A combination of one or more of the LocatorOptions members that defines the type of domain controller to find.

Returns

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

Exceptions

A domain controller cannot be located.

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

The flag parameter contains an invalid value.

The object has been disposed.

See also

Applies to

.NET 10 (package-provided) an aner Versiounen
Produkt Versiounen
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

FindDomainController(String)

Source:
Domain.cs
Source:
Domain.cs
Source:
Domain.cs
Source:
Domain.cs
Source:
Domain.cs

Finds a domain controller in this domain and in the specified site.

C#
public System.DirectoryServices.ActiveDirectory.DomainController FindDomainController(string siteName);

Parameters

siteName
String

The name of the site to search for the domain controller.

Returns

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

Exceptions

A domain controller cannot be located.

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

siteName is an empty string.

siteName is null.

The object has been disposed.

See also

Applies to

.NET 10 (package-provided) an aner Versiounen
Produkt Versiounen
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

FindDomainController(String, LocatorOptions)

Source:
Domain.cs
Source:
Domain.cs
Source:
Domain.cs
Source:
Domain.cs
Source:
Domain.cs

Finds a domain controller in this domain and in the specified site that meets the specified criteria.

C#
public System.DirectoryServices.ActiveDirectory.DomainController FindDomainController(string siteName, System.DirectoryServices.ActiveDirectory.LocatorOptions flag);

Parameters

siteName
String

The name of the site to search for the domain controller.

flag
LocatorOptions

A combination of one or more of the LocatorOptions members that defines the type of domain controller to find.

Returns

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

Exceptions

A domain controller cannot be located.

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

This exception will occur for any of the following reasons.

  • siteName is an empty string.

  • flag contains an invalid value.

siteName is null.

The object has been disposed.

See also

Applies to

.NET 10 (package-provided) an aner Versiounen
Produkt Versiounen
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10