Skip to main content
RLS
Inspiring
December 19, 2012
Answered

How to consume Microsoft.Web.Administration?

  • December 19, 2012
  • 1 reply
  • 3859 views

I have been managing websites in IIS6, but I understand that things have changed radically in IIS7 and that "all I need to do" is consume the services available in Microsoft.Web.Administration's servermanager and Microsoft.Web.Management and I'll have all the services and methods I need to replicate what I was doing in IIS6.

Well and good if you're savvy on that whole "consume services" thing, which I suck at.

I am told I can find this in c:\windows\system32\inetsrv\Microsoft.Web.Administration.dll and, indeed, it is there.

Try as I might, I cannot figure out how to pull this into an object so I can consume it.  I've tried:


<cfobject type="COM" action="CREATE" class="Microsoft.Web.Administration" name="objMicrosoftWeb">



<cfobject action="create" class='Microsoft.Web' name="objMicrosoftWeb" type="com">

<script>

set myServerManager = CreateObject('.NET', 'ServerManager', 'c:\windows\system32\inetsrv\Microsoft.Web.Administration.dll');

</script>

<cfobject


name="serverManager"

component="c:\windows\system32\inetsrv\Microsoft.Web.Administration.dll" />

all to no avail.  I am obviously not a COM genius.

Can anyone clue me in?  I think even if I could figure out how to get a list of classes and methods I might be able to reign this in, but, alas, I am clueless in this arena.

Thanks!

This topic has been closed for replies.
Correct answer RLS

In IIS6 I was using the metabase with a variety of exe and vbs files.

In IIS7 I want to take advantage of the XML structure. I could probably use AppCMD but that seems so old school. I'd prefer to use the API and, in my mind, do it correctly and likely much more efficiently.

I just don't know how to list the services that are outside of Cold Fusion. ColdFusion Builder doesn't show them to me and I can't find a copy of OLEVIEWER to download, so I'm having trouble peeking under the hood.

I've tried so many variations on trying to make an object out of Microsoft.Web.Administration.dll that my fingers are numb and my eyes are bleeding. I don't know why I can't find any specific instance on the web of someone doing this with ColdFusion; it's weird, frankly.

To me, it's a simple question that SOMEONE out there must have answered by now. Knowing the name of an object on your computer, how do you create a CFObject out of it so you can use the services?  But that's probably just me not knowing some reason why that won't work.

This is what I want to get, first. Once I have that, I think I can figure the rest out: http://msdn.microsoft.com/en-us/library/ms614834(v=vs.90).aspx

RLS


I guess the trick is all in how you phrase your question when searching for the answer.

Out of desperation, I searched for the error message I was receiving, and this (http://forums.adobe.com/message/4227246) provided me the answer, right from here within the CF Forums, something I had already searched.

I was using:

<cfobject type="dotnet" name="Mtable" class="ApplicationDomain"

          assembly="c:/windows/system32/inetsrv/Microsoft.Web.Administration.dll">

and getting an error stating that the class was not found in the assembly list (Class ApplicationDomain not found in the specified assembly list. The assembly that contains the class must be provided to the assembly attribute).

By simply giving it the COMPLETE class name, as such:

<cfobject type="dotnet" name="Mtable" class="Microsoft.Web.Administration.ApplicationDomain"

          assembly="c:/windows/system32/inetsrv/Microsoft.Web.Administration.dll">

I attained success.

This question is resolved. Hope this helps someone else looking for this solution.

RLS

1 reply

Inspiring
December 19, 2012

You can get a list of classes by googling Microsoft.Web.Administration and selecting an offering from msdn.microsoft.com    

RLS
RLSAuthor
Inspiring
December 19, 2012

Thank you, but that does not list the service as it appears on my computer / server nor does it help me to figure out how to code the createobject capture that I need.  I've been staring at that damn msdn article / series and a million other articles about Microsoft.Web.Administration but none of them give me the answer and I've tried but I cannot figure it out myself. Thanks, but I need hand holding this time...

Inspiring
December 20, 2012

You could always take another approach.  What did you used to be able to do with IIS 6 that you can't do with IIS 7?