DirectoryEntry.Password プロパティ

定義

クライアントの認証時に使用するパスワードを設定します。

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

プロパティ値

クライアントを認証するときに使用するパスワード。

属性

次の例では、Username クラスのPasswordプロパティとDirectoryEntryプロパティを示します。 この例では、ユーザー指定のDirectoryEntryとそのすべてのChildrenPathを取得します。

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);

注釈

Username プロパティと Password プロパティを設定して、Active Directory Domain Servicesの情報にアクセスする代替資格情報を指定できます。 このインスタンスから取得したその他の DirectoryEntry オブジェクト ( Childrenなど) は、同じ代替資格情報を使用して自動的に作成されます。

適用対象

こちらもご覧ください