DirectoryEntry.Path プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
この DirectoryEntryのパスを取得または設定します。
public:
property System::String ^ Path { System::String ^ get(); void set(System::String ^ value); };
public string Path { get; set; }
[System.ComponentModel.TypeConverter("System.Diagnostics.Design.StringValueConverter, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.DirectoryServices.DSDescription("DSPath")]
public string Path { get; set; }
[System.DirectoryServices.DSDescription("DSPath")]
[System.ComponentModel.SettingsBindable(true)]
[System.ComponentModel.TypeConverter("System.Diagnostics.Design.StringValueConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
public string Path { get; set; }
[System.DirectoryServices.DSDescription("DSPath")]
[System.ComponentModel.SettingsBindable(true)]
[System.ComponentModel.TypeConverter("System.Diagnostics.Design.StringValueConverter, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
public string Path { get; set; }
member this.Path : string with get, set
[<System.ComponentModel.TypeConverter("System.Diagnostics.Design.StringValueConverter, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")>]
[<System.DirectoryServices.DSDescription("DSPath")>]
member this.Path : string with get, set
[<System.DirectoryServices.DSDescription("DSPath")>]
[<System.ComponentModel.SettingsBindable(true)>]
[<System.ComponentModel.TypeConverter("System.Diagnostics.Design.StringValueConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")>]
member this.Path : string with get, set
[<System.DirectoryServices.DSDescription("DSPath")>]
[<System.ComponentModel.SettingsBindable(true)>]
[<System.ComponentModel.TypeConverter("System.Diagnostics.Design.StringValueConverter, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")>]
member this.Path : string with get, set
Public Property Path As String
プロパティ値
この DirectoryEntry オブジェクトのパス。 既定値は空の文字列 ("") です。
- 属性
注釈
Path プロパティは、ネットワーク環境でこのエントリを一意に識別します。 このエントリは、この Pathを使用していつでも取得できます。
Pathを設定すると、ディレクトリ ストアから新しいエントリが取得されます。現在バインドされているエントリのパスは変更されません。
DirectoryEntry コンポーネントに関連付けられているクラスは、任意の Active Directory Domain Services サービス プロバイダーで使用できます。 現在のプロバイダーには、インターネット インフォメーション サービス (IIS)、ライトウェイト ディレクトリ アクセス プロトコル (LDAP)、Novell NetWare Directory Service (NDS)、WinNT があります。
Note
プロバイダーを識別する Path のセクション ("://" の前) では、大文字と小文字が区別されます。 たとえば、"LDAP://" や "WinNT://" などです。
Path プロパティの構文は、プロバイダーによって異なります。 一般的なシナリオを次に示します。
Winnt
コンピューター上のグループに接続します。 たとえば、"WinNT://<domain name>/<computer name>/<group name>" などです。 ローカル コンピューターに接続している場合は、"WinNT://<コンピューター名>/< グループ名>" です。
コンピューター上のユーザーに接続します。 たとえば、"WinNT://<domain name>/<computer name>/<user name>" などです。 ローカル コンピューターに接続している場合は、"WinNT://<コンピューター名>/<ユーザー名>" です。
コンピューター上のサービスに接続します。 たとえば、"WinNT://<domain name>/<computer name>/<service name>" などです。 ローカル コンピューターに接続している場合は、"WinNT://<computer name>/<service name>" です。
ネットワーク上のすべてのドメインを検出します。 たとえば、"WinNT:" ドメインは、このエントリの子を列挙することで見つけることができます。
LDAP
ドメイン内のグループに接続します。 たとえば、"LDAP://CN=<group name>, CN =<Users>, DC=<domain component>, DC=<domain component>,..." などです。
ドメイン内のユーザーに接続します。 たとえば、"LDAP://CN=<full user name>, CN=<Users>, DC=<domain component>, DC=<domain component>,..." などです。
ドメイン内のコンピューターに接続します。 たとえば、"LDAP://CN=<computer name>,CN=<Computers>, DC=<domain component>, DC=<domain component>,..." などです。
IIS
- Web ディレクトリに接続します。 たとえば、"IIS://LocalHost/W3SVC/1/ROOT/<Web ディレクトリ名>" などです。
LDAP を使用して現在のドメインにバインドするには、パス "LDAP://RootDSE" を使用して、既定の名前付けコンテキストを取得し、エントリを再バインドします。 例えば次が挙げられます。
String str = ent.Properties["defaultNamingContext"][0];
DirectoryEntry domain = new DirectoryEntry("LDAP://" + str);
詳細については、プロバイダーのドキュメントと 、Active Directory サービス インターフェイスの使用に関する 記事を参照してください。