Avatar of Barry Jones
Barry JonesFlag for United Kingdom of Great Britain and Northern Ireland asked on

Administer IIS6 from VB6

Hi.  I am trying to administer IIS (create webs, change existing web properties, set web folder permissions and delete webs), from a VB6 application.

As far as I can tell, I can use WMI to do this.  Any pointers on using this - the MS site looks a little confusing for me.  I have never used WMI before.  I dont want a scripted solution (I need to check errors after each command, and I need it to execute in sync with the VB app processing).  IDeally I need a COM component5 to do this - does anyone know of anything?  Failing this, can anyone help me get started with WMI please?

Thanks, TheFoot
Visual Basic ClassicMicrosoft IIS Web Server

Avatar of undefined
Last Comment
Barry Jones

8/22/2022 - Mon
Ted Bouskill

Download the IIS Resource Kit.  It's fully of samples written in VBS for managing IIS.
ASKER
Barry Jones

Thanks for your reply.  I found a reference for these scripts at:

http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/1805162e-6ac5-4a98-9a08-919c4c10827d.mspx?mfr=true

However these built-in scripts do basic stuff like creating/deleting websites virtual directories etc.  I will need to set properties like default pages, custom 404 error pages, log directory and application pools.

I read that there are 3 methods; ADSI WMI and ABO.  ABO appears to be better designed for COM use (ie within VB6), but the docs indicate that restarting the web server is required when using this.

Any experience on using these methods?  Pitfalls, gotchas etc??

Thanks, TheFoot
Ted Bouskill

Any substantial changes to IIS generally require a restart.  You won't get around that.

I prefer WMI.  Did you search www.iis.net for more information?  That site is run by Microsoft and has LOTs of great articles.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
ASKER
Barry Jones

Thanks for the link - I did check them out, and all I can find is IIS7 stuff.?

Do you have any code examples in Vb to get me started?  I cannot seem to locate a good reference or example anywhere...

Thanks, TheFoot
ASKER CERTIFIED SOLUTION
Ted Bouskill

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
Barry Jones

That link from MSDN proved very useful.  From that I found:

http://msdn.microsoft.com/en-us/library/ms524913(VS.85).aspx

Which basically gave me the complete walk through that I needed.  WMI is a learning curve for sure!!  The difficulty is knowing which services, classes and methods/properties to use.


Anyways.. successfully build a Vb6 method that creates a website, configures the properties and starts!

Thanks for your help.

TheFoot