Accessing information on IIS programatically

  • Thread starter Thread starter thechaosengine
  • Start date Start date
T

thechaosengine

Hi all,

Does anyone know of a way I can get information on the status of IIS including
what websites and Virtual Roots are defined and whether they are running
or not.

I'll be using C# in particular and am currently looking into WMI - something
that I havent used in the past.

Anyone know if I'm on the right track?

Many thanks

Kindest Regards
 
thechaosengine said:
Hi all,

Does anyone know of a way I can get information on the status of IIS
including what websites and Virtual Roots are defined and whether they
are running or not.

I'll be using C# in particular and am currently looking into WMI -
something that I havent used in the past.
Anyone know if I'm on the right track?

Yes, it's pretty simple using ADSI or WMI and there's lots of samples of
it on the net. Try googling/msdn:ing for "IIS Create Virtual Directory
ADSI" or similar.
 
IIS 5.0 exposes a COM+ object model that you can interop with to
progrramatically access and modify the IIS metabase. Im not sure which
dll or what interfaces it exposes, may some one from MS can help there.
But if you are using IIS 6.0, WMI will definately work. IIS 6.0 exposes
a WMI namespace that you can connect to and manage the IIS metabase.
Sorry dont have more details on that for ya, but if your app is gonna
manage 5.0 or older WMI may not be possible. I could be wrong here
though.

Hope this helps,
NuTcAsE
 
Back
Top