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 です。
注意
プロバイダーを Path 識別するセクション ("://" の前) では大文字と小文字が区別されます。 たとえば、"LDAP://" や "WinNT://" などです。
プロパティの Path 構文は、プロバイダーによって異なります。 一般的なシナリオを次に示します。
WinNT
コンピューター上のグループにConnectします。 たとえば、"WinNT://<domain name>/<computer name>/<group name>" です。 ローカル コンピューターに接続している場合は、"WinNT://<computer name>/<group name>"。
コンピューター上のユーザーにConnectします。 たとえば、"WinNT://<domain name>/<computer name>/<user name>" です。 ローカル コンピューターに接続している場合は、"WinNT://<computer name>/<user name>"。
コンピューター上のサービスにConnectします。 たとえば、"WinNT://<domain name>/<computer name>/<service name>" です。 ローカル コンピューターに接続している場合は、"WinNT://<computer name>/<service name>"。
ネットワーク上のすべてのドメインを検出します。 たとえば、"WinNT:" ドメインは、このエントリの子を列挙することで見つけることができます。
LDAP
ドメイン内のグループにConnectします。 たとえば、"LDAP://CN=<group name>、CN =<Users>、DC=<domain component>、DC=<domain component>,..." などです。
ドメイン内のユーザーにConnectします。 たとえば、"LDAP://CN=、CN=<full user name>、DC=<Users>、DC=<domain component><domain component>,..." などです。
ドメイン内のコンピューターにConnectします。 たとえば、"LDAP://CN=、CN=<computer name>、DC=<Computers>、DC=<domain component><domain component>,..." などです。
IIS
- Web ディレクトリにConnectします。 たとえば、"IIS://LocalHost/W3SVC/1/ROOT/<Web directory name>" です。
LDAP を使用して現在のドメインにバインドするには、パス "LDAP://RootDSE" を使用して、既定の名前付けコンテキストを取得し、エントリを再バインドします。 次に例を示します。
String str = ent.Properties["defaultNamingContext"][0];
DirectoryEntry domain = new DirectoryEntry("LDAP://" + str);
詳細については、プロバイダーのドキュメントと Active Directory サービス インターフェイスの使用に関 する記事を参照してください。