Solved

vbscript and IIS

Posted on 2003-10-27
12
643 Views
Last Modified: 2012-08-13
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.
0
Comment
Question by:tkw829
  • 4
  • 3
  • 3
  • +1
12 Comments
 
LVL 28

Expert Comment

by:AzraSound
ID: 9627492
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.
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 9627509
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.
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 9627529
Having IIS you can talk with him using localhost name.
0
 
LVL 8

Expert Comment

by:fozylet
ID: 9628039
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.
0
 

Author Comment

by:tkw829
ID: 9629116
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.
0
 
LVL 8

Expert Comment

by:fozylet
ID: 9629226
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.
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 28

Expert Comment

by:AzraSound
ID: 9629319
>> 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.
0
 

Author Comment

by:tkw829
ID: 9629511
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.
0
 

Author Comment

by:tkw829
ID: 9629557
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.
0
 
LVL 8

Accepted Solution

by:
fozylet earned 500 total points
ID: 9629625
It seems you are using IIS Admin Objects in the script.
In that case you will need those installed in each machine trying to run that vbs.
AM not sure if you will get these components separately.

Please see http://www.microsoft.com/windows2000/en/server/iis/htm/asp/aogu2wab.htm for details
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 9629636
>>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.
0
 

Author Comment

by:tkw829
ID: 9630019
It looks like the IIS resource kit is the bare minimum that will give some access to IIS.  Thanks everyone.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now