DirectoryEntry.Password Propriedade

Definição

Define a senha a ser usada ao autenticar o cliente.

public:
 property System::String ^ Password { System::String ^ get(); void set(System::String ^ value); };
public:
 property System::String ^ Password {  void set(System::String ^ value); };
[System.ComponentModel.Browsable(false)]
[System.DirectoryServices.DSDescription("DSPassword")]
public string Password { get; set; }
[System.ComponentModel.Browsable(false)]
[System.DirectoryServices.DSDescription("DSPassword")]
public string Password { set; }
[<System.ComponentModel.Browsable(false)>]
[<System.DirectoryServices.DSDescription("DSPassword")>]
member this.Password : string with get, set
[<System.ComponentModel.Browsable(false)>]
[<System.DirectoryServices.DSDescription("DSPassword")>]
member this.Password : string
Public Property Password As String

Valor da propriedade

A senha a ser usada ao autenticar o cliente.

Atributos

Exemplos

O exemplo a seguir demonstra as propriedades e Username as Password propriedades da DirectoryEntry classe. Este exemplo obtém o usuário especificado DirectoryEntry e o Path de todos os seus Children.

Dim myADSPath As String = _
      "LDAP://onecity/CN=Users,DC=onecity,DC=corp,DC=fabrikam,DC=com"

' Create an Instance of DirectoryEntry.
Dim myDirectoryEntry As New DirectoryEntry(myADSPath)
myDirectoryEntry.Username = UserName
myDirectoryEntry.Password = SecurelyStoredPassword

' Get the Child ADS objects.
Console.WriteLine("The Child ADS objects are:")
Dim myChildDirectoryEntry As DirectoryEntry
For Each myChildDirectoryEntry In  myDirectoryEntry.Children
   Console.WriteLine(myChildDirectoryEntry.Path)
Next myChildDirectoryEntry
String myADSPath = "LDAP://onecity/CN=Users,
         DC=onecity,DC=corp,DC=fabrikam,DC=com";

// Create an Instance of DirectoryEntry.
DirectoryEntry myDirectoryEntry = new DirectoryEntry(myADSPath);
myDirectoryEntry.Username = UserName;
myDirectoryEntry.Password = SecurelyStoredPassword;

// Get the Child ADS objects.
Console.WriteLine("The Child ADS objects are:");
foreach(DirectoryEntry myChildDirectoryEntry in myDirectoryEntry.Children)
   Console.WriteLine(myChildDirectoryEntry.Path);

Comentários

Você pode definir as propriedades Username e Password para especificar credenciais alternativas com as quais acessar as informações no Active Directory Domain Services. Todos os outros DirectoryEntry objetos recuperados dessa instância (por exemplo, por meio Children) são criados automaticamente com as mesmas credenciais alternativas.

Aplica-se a

Confira também