abdiel has asked for the wisdom of the Perl Monks concerning the following question:

Does anyone know of a module I can use to acccess/modify the IIS metabase through Perl? I currently have a command line utility I access through backticks, but I really don't like that solution (not to mention it doesn't always work). I've searched the site and CPAN, and can find no mention of IIS or the Metabase. Microsoft has a utility that looks like regedit to modify the metabase, so I wonder if an altered version of Win32::TieRegistry would work. Any suggestions as to where I can get more information on this? Thanks

Replies are listed 'Best First'.
Re: Accessing IIS metabase with Perl
by rchiav (Deacon) on May 03, 2001 at 21:57 UTC
    If you're on a Windows box, you're probably going to want to use ADSI. I'd highly recomend picking up "ADSI Scripting for System Administration". All of the examples are VB (not vbscript) but it covers a lot about how to access the metabase. And all you'll really need is Win32::OLE and descriptions of how it's done. I found it very easy to look at it in VB and then write something in Perl. And to be honest, you're not going to find anything easier than using ADSI.

    Hope this helps..
    Rich

Re: Accessing IIS metabase with Perl
by Chmrr (Vicar) on May 03, 2001 at 22:05 UTC

    I'll prefix this with the comment that I have no clue what I'm doing -- I just wandered through a google search for "activeperl metabase" until I found something mildly useful. ;> Anyways, it looks like Win32::OLE is one way to do so, as is brought up (tangentially) here. Searching for metabase on that mailing list provided a few more hits.

    Update: Wow! What I said made some sense, as rchiav also mentionned Win32::OLE.

     
    perl -e 'print "I love $^X$\"$]!$/"#$&V"+@( NO CARRIER'

Re: Accessing IIS metabase with Perl
by dws (Chancellor) on May 03, 2001 at 22:12 UTC
    Does anyone know of a module I can use to acccess/modify the IIS metabase through Perl?

    I've seen this done with Win32::OLE, but haven't done it myself. The stumbling block is in getting your hands on a description of the Metabase object model. There's one out on MSDN somewhere. Once you have that, the Perl side is as straight-forward as any other use of Win32::OLE.

    If you're running IIS 4.0 on NT, there are some examples.vbs files in C:\winnt\system32\inetsrv\adminsamples\ that modify the Metabase. You can reverse-engineer a small part of the object model from those.

      The stumbling block is in getting your hands on a description of the Metabase object model. There's one out on MSDN somewhere.

      Indeedy there is.

      Deciphering it is a whole 'nother matter, but having the VBS examples handy, perusing the ActiveState archives (the -admin and -user lists particularly), and plain ol' experimentation will get you far.

          --k.