Is there a way to list all active websites that exist within IIS using c#?
Thanks
Sp
For IIS 7 you can use Microsoft.Web.Administration.dll (C:\Windows\System32\inetsrv) and the following code
var iisManager = new ServerManager(); SiteCollection sites = iisManager.Sites;