Link to home
Start Free TrialLog in
Avatar of tkw829
tkw829

asked on

vbscript and IIS

I am writing a program to query IIS servers for information such as security attributes, Site name, etc.  When I started doing test runs of the program, I began to realize that I couldn't run it on my workstation because IIS was not installed on my system.  Is there a way to get around installing IIS to make my program work?  If I have to install this product, is there some smaller subset that I could get away with (group of DLL's and some executables?) to get this functionality?  Thanks for any assistance.
Avatar of AzraSound
AzraSound
Flag of United States of America image

Is IIS running on a machine anywhere on your network?  If so, could you point your scripts to those machines for testing?  The scaled down version of IIS is PWS (Personal Web Server).  Never installed it myself...probably available somewhere on Microsoft's website.
Avatar of AlexFM
AlexFM

What is your operating system? It is easy to install IIS on Windows NT/2K/XP computer: Control Panel - Add/Remove programs - Add/Remove Windows components. In NT you need Option Pack 4 for this.
Having IIS you can talk with him using localhost name.
PWS comes with the Visual Studio 6 cd set... but your calls to IIS may not work with PWS.
If you have NT/2K/XP, it is best to add IIS, as AlexFM said.
Avatar of tkw829

ASKER

My ideal scenario would be to not have to install IIS at all.  Do I have to have it in order to query IIS servers?  Thanks for your patience.  

P.S. - I am running the query from a windows NT workstation with WSH 5.6.  What is PWS?

Additional background - If I can successfully create this program, I will be wrapping it up in an installer to be distributed to co-workers for general use.  This is why I would like to avoid having to include IIS in the install.  Again thanks for your patience.
PWS is a scaled down web server from MS which can take only 10 max connections at a time (i.e. basically for testing purposes).

If you have an IIS server to which you have access in your network, you should be able to query it.
if only general things like site name is being queried, you might be able to do the query on any IIS server in the internet too.

do a http://www.whois.sc/mydomain.com on a domain and see the 'server type' that comes up, to see if it is IIS.
>> I am running the query from a windows NT workstation with WSH 5.6

As long as WSH is installed, and that's where all of the code is coming from, that should be all you need to execute it.  If IIS isn't installed on the server being queried, your code just doesn't return anything, but it shouldn't be dependent on the machine running the code to have IIS installed, one wouldn't think.
Avatar of tkw829

ASKER

Maybe it's just my code then.  This first piece of code gives me the following (hostname is a placeholder for the real name in my script)

error:
ActiveX component can't create object IIS://hostname

Code:
Set IIsWebServerObj = CreateObject("IIS://'hostname'")

This second piece of code gives me invalid syntax

Error:
Line 1
Invalid syntax code: 800401e4 source: (null)

Code:
set vdirObj=GetObject("IIS://'hostname'/W3svc/1/Root")
' Print out the current value of some properties:
For Each Property in vdirObj.Properties
 WScript.Echo Property.Name & " = " & Property.Value
Next

P.S. - These scripts were directed at a legitimate IIS 5.0 server (Windows 2000).  If I run these scripts locally on that same server, they run just fine.
Avatar of tkw829

ASKER

As a reference, I know that queries to a Microsoft SQL database apparently require you to have some form of SQL client installed on the machine running the script.  I've also experienced not being able to directly access winsock unless I had a developers license, but someone found away around that by making certain system calls to bypass the license issue.  If no one can find a way around installing IIS, then I probably should give the points to AzraSound as the first respondent with essentially the same idea being expressed throughout the replies.  Thanks again all of you.
ASKER CERTIFIED SOLUTION
Avatar of fozylet
fozylet
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>>queries to a Microsoft SQL database apparently require you to have some form of SQL client

It requires that you have MDAC installed, which contains the drivers and components necessary for talking to Microsoft data stores.

I still wouldn't think you needed anything installed to execute the code above other than the latest scripting runtimes, and proper security rights to access the remote IIS metabase.  Perhaps its simply a security issue, though, I never had to do anything like this so never dug around to see what security settings may need to be tweaked to allow you proper remote access.
Avatar of tkw829

ASKER

It looks like the IIS resource kit is the bare minimum that will give some access to IIS.  Thanks everyone.