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

I am looking for a way to interface with IIS. Specifically to perform two functions. 1) Create FTP Virtual Directories. 2) Get the currently logged in ftp users. I have looked on CPAN and can't find a module that interfaces with IIS.

Replies are listed 'Best First'.
Re: IIS (Internet Information Services)
by meetraz (Hermit) on Jan 24, 2003 at 19:25 UTC
    In order to do admin functions, you can use Win32::OLE and ADSI. For example, to stop site #0,
    use strict; use Win32::OLE; my $IIS = Win32::OLE->GetObject("IIS://servername/W3SVC/0"); $IIS->Stop();
    more info here

    But for statistics, like which users are currently connected via FTP, I would use Win32::PerfLib and look at the counters available for IIS.

Re: IIS (Internet Information Services)
by ibanix (Hermit) on Jan 25, 2003 at 09:46 UTC
    Hi Shadow,

    Win32::OLE is your best bet. You will need to use the Active Directory Services Interface (ADSI) to access the IIS ADSI provider, aka "IIS:".

    This can be very challenging. I highly recommend you pickup a copy of David Roth's excellent book, Win32 Perl Scripting: The Administrator's Handbook. It has been an invaluable tool for me in my quest to conquer my Win32 network using Perl.

    Also, you should read the ADSI Overview, and the full ADSI doucmentation at the MSDN Library. In the latter, pick Network and Directory services, then the Active Directory, ADSI and Directory Services option.

    Good luck. I wonder if there is any interest in an IIS module which runs on top of Win32::OLE?

    ibanix

    $ echo '$0 & $0 &' > foo; chmod a+x foo; foo;
Re: IIS (Internet Information Services)
by byrned (Initiate) on Jan 25, 2003 at 00:20 UTC
    This isn't very specific, but it may be a direction to look. I think that the Windows Scripting Host (WSH) allows you to do this. The normal languages for WSH are JavaScript and VBScript, but I think that PerlScript will also work.