January 07, 2008

Active Directory

Active Directory is the windows method to access all distributed devices such as files, printers.

In .NET the Active Directory is accessed from System.DirectoryServices namespace.

.NET uses Windows Active Directory Service Interfaces (ADSI) to interact with the distributed devices, there are 5 of these ADSIs;
Path Windows NT version 5.0, Windows 2000, or Windows XP WinNT://path, Lightweight Directory Access Protocol (LDAP) ldap://path/, Novell NetWare Directory Service NDS://path, Novell Netware 3.x NWCOMPAT://path, Internet Information Services (IIS) IIS://.

e.g.

DirectoryEntry webentry = new DirectoryEntry();
String path = "IIS://localhost/W3SVC/1/ROOT";


DirectoryEntries webSiteChildren = webentry.Children;
foreach (DirectoryEntry website in webSiteChildren)
{

//can access metadata of each website on iis here
}

No comments: