DirectoryEntry.NativeGuid Property

Gets the GUID of the DirectoryEntry, as returned from the provider.

Namespace: System.DirectoryServices
Assembly: System.DirectoryServices (in system.directoryservices.dll)

public string NativeGuid { get; }
/** @property */
public String get_NativeGuid ()

public function get NativeGuid () : String

Not applicable.

Property Value

A Guid structure that represents the GUID of the DirectoryEntry, as returned from the provider.

Use the NativeGuid property when binding an object in Active Directory.


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.

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.

String myADSPath = "LDAP://onecity/CN=Users,
DirectoryEntry myDirectoryEntry=new DirectoryEntry(myADSPath);

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

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions