DirectoryEntry.NativeGuid Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the GUID of the DirectoryEntry, as returned from the provider.
public:
property System::String ^ NativeGuid { System::String ^ get(); };
public string NativeGuid { get; }
[System.ComponentModel.Browsable(false)]
[System.DirectoryServices.DSDescription("DSNativeGuid")]
public string NativeGuid { get; }
member this.NativeGuid : string
[<System.ComponentModel.Browsable(false)>]
[<System.DirectoryServices.DSDescription("DSNativeGuid")>]
member this.NativeGuid : string
Public ReadOnly Property NativeGuid As String
A Guid structure that represents the GUID of the DirectoryEntry, as returned from the provider.
- Attributes
The following example demonstrates the Guid and NativeGuid properties of the DirectoryEntry class. This example gets the user-specified DirectoryEntry and displays its Guid and NativeGuid properties.
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)
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);
String^ myADSPath = "LDAP://onecity/CN=Users,DC=onecity,DC=corp,DC=fabrikam,DC=com";
DirectoryEntry^ myDirectoryEntry = gcnew DirectoryEntry(myADSPath);
// Display the Guid and NativeGuid.
Console::WriteLine("The GUID of the ADS object: {0}", myDirectoryEntry->Guid));
Console::WriteLine("The Native GUID of the ADS object: {0}",
myDirectoryEntry->NativeGuid);
Use the NativeGuid property when binding an object in Active Directory Domain Services.
Note
The Lightweight Directory Access Protocol (LDAP) provider returns the globally unique identifier of a DirectoryEntry in a different format than the Internet Information Services (IIS), Novell NetWare Directory Server (NDS), and WinNT providers.
Product | Versions |
---|---|
.NET | 8 (package-provided), 9 (package-provided) |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided) |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: