-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: LovedJohnySmith
Message 2 in Discussion
Directory Services is one of the important assembly in .NET assemblies. it
provides easy access to Active Directory from managed code. The namespace
contains two component classes, DirectoryEntry and DirectorySeacher, which use
the Active Directory Services Interfaces (ADSI) technology. ADSI is the set of
interfaces that Microsoft provides as a flexible tool for working with a
variety of network providers. ADSI gives the administrator the ability to
locate and manage resources on a network with relative ease, regardless of the
network's size.The classes in this namespace can be used with any of the Active
Directory service providers. The current providers are: Internet Information
Services (IIS), Lightweight Directory Access Protocol (LDAP), Novell NetWare
Directory Service (NDS), and WinNT. Please have a look at the following code
snippet.... const string WebServerSchema = "IIsWebDirectory"; // Case
Sensitive
string ServerName = <Your Servername>;
string sSiteInfo=null; //Creating the object for accessing the web sites
listed out in the default web site
DirectoryEntry objEntry = new DirectoryEntry("IIS://" + ServerName +
"/w3svc/1/ROOT"); //To Get all the Web Services folders available in the iis
default web site
foreach (DirectoryEntry objSite in objEntry.Children)
{
if (objSite.Path.ToString()!="IIS://" + ServerName+
"/w3svc/1/ROOT/aspnet_client")
{
if (objSite.SchemaClassName == WebServerSchema)
{
//sSiteInfo=sSiteInfo+objSite.Name + " - " +
objSite.Properties["ServerComment"].Value.ToString()+"\n";
if (objSite.Children!=null)
{
if (objSite.Properties.PropertyNames!=null)
{
if (objSite.Properties["KeyType"].Value.ToString()!="" &&
objSite.Properties["KeyType"].Value.ToString()!=string.Empty &&
objSite.Properties ["KeyType"].Value.ToString()=="IIsWebDirectory")
{
sSiteInfo=sSiteInfo+objSite.Name+"\n";
}
} }
}
} }
} thanx, Smith
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you
received this message by mistake, please click the "Remove" link below. On the
pre-addressed e-mail message that opens, simply click "Send". Your e-mail
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]