次の方法で共有


DirectoryEntry.NativeGuid プロパティ

プロバイダが返す DirectoryEntry のグローバル一意識別子を取得します。

Public ReadOnly Property NativeGuid As String
[C#]
public string NativeGuid {get;}
[C++]
public: __property String* get_NativeGuid();
[JScript]
public function get NativeGuid() : String;

プロパティ値

プロバイダが返す DirectoryEntry のグローバル一意識別子。

解説

Active Directory のオブジェクトをバインドする場合は、 NativeGuid プロパティを使用します。

メモ   LDAP プロバイダは、IIS、NDS、WinNT の各プロバイダとは異なる形式で、 DirectoryEntry のグローバル一意識別子を返します。

使用例

[Visual Basic, C#, C++] DirectoryEntry クラスの Guid プロパティと NativeGuid プロパティの例を次に示します。この例は、ユーザーが指定した DirectoryEntry を取得し、その Guid プロパティと NativeGuid プロパティを表示します。

 
Dim myADSPath As [String] = "LDAP://onecity/CN=Users,DC=onecity,DC=corp,DC=fabrikam,DC=com"
Dim myDirectoryEntry As New DirectoryEntry(myADSPath)

' Display the Guid and NativeGuid.
Console.WriteLine("The GUID of the ADS object:" + myDirectoryEntry.Guid.ToString)
Console.WriteLine("The Native GUID of the ADS" + "object:" + myDirectoryEntry.NativeGuid)

[C#] 
String myADSPath = "LDAP://onecity/CN=Users,DC=onecity,DC=corp,DC=fabrikam,DC=com";
DirectoryEntry myDirectoryEntry=new DirectoryEntry(myADSPath);

// Display the Guid and NativeGuid.
Console.WriteLine("The GUID of the ADS object:"+
                  myDirectoryEntry.Guid);
Console.WriteLine("The Native GUID of the ADS"+
                  "object:"+myDirectoryEntry.NativeGuid);

[C++] 
String* myADSPath = S"LDAP://onecity/CN=Users,DC=onecity,DC=corp,DC=fabrikam,DC=com";
DirectoryEntry* myDirectoryEntry = new DirectoryEntry(myADSPath);

// Display the Guid and NativeGuid.
Console::WriteLine("The GUID of the ADS object: {0}", __box(myDirectoryEntry->Guid));
Console::WriteLine("The Native GUID of the ADS object: {0}",
                   myDirectoryEntry->NativeGuid);

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

.NET Framework セキュリティ:

参照

DirectoryEntry クラス | DirectoryEntry メンバ | System.DirectoryServices 名前空間 | DirectoryEntry.Guid | Guid