I want to get a listing of IIS websites in Perl and their home directory. Does anyone have a module or application to do this? Is there a configuration file anywhere that I can use regular file IO on? Is there an API published anywhere for this, or an opensource implementation I can look at?

link|improve this question

57% accept rate
Is there a reason it needs to be in perl instead of vbscript or powershell? – Zypher Aug 6 '10 at 19:49
What version of IIS are you targeting? – squillman Aug 6 '10 at 20:06
We're using on the server in question IIS6. – Evan Carroll Aug 6 '10 at 20:33
sorry, forgot to come back and check in. I had a pm at one point but I can't find it now (been a while since I've used Perl for Windows admin tasks). Only thing I can come up with is one that targets IIS5 but VERY limited functionality and it won't even list the web sites. – squillman Aug 9 '10 at 14:32
feedback

1 Answer

up vote 1 down vote accepted

The following two articles give a pretty good overview of how to query the IIS metabase via ADSI (using VBScript, in this case):

http://blogs.msdn.com/b/david.wang/archive/2005/07/13/howto-enumerate-iis-website-configuration.aspx

http://blogs.msdn.com/b/david.wang/archive/2006/06/08/howto-enumerate-iis-website-and-ftpsite-configuration-vbscript-using-adsi.aspx

Practically speaking, all you'd need to do is reimplement something similar using Win32::OLE. You could look instead at querying the IIS metabase XML directly (typically found somewhere like %SystemRoot%\System32\inetsrv\metabase.xml), but that's probably somewhat less portable.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.