> ----- Original Message -----
> From: "Alex Henderson" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, April 26, 2002 2:41 AM
> Subject: [DOTNET] Directory Services : accessing IIS SMTP server details.


Following uses the IIS schema to  retrieve the property names and uses these names as 
index in the property collection.


..
  DirectoryEntry mailSvc = new DirectoryEntry("IIS://localhost/SmtpSvc/1");
  PropertyCollection pcoll = mailSvc.Properties;
  DirectoryEntry schema = new DirectoryEntry("IIS://localhost/schema/IIsSmtpService");
  PropertyCollection schemaPcoll = schema.Properties;
// dump all service properties to the console
  foreach(string s in schemaPcoll["OptionalProperties"])
  {
   try {
    Console.WriteLine(s + "\t" + pcoll[s].Value);
   }
   // Catch "not  yet supported properties" exceptions
   catch(Exception ex)
   {
    Console.WriteLine(ex.Message);
   }
  }

...

Willy.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to