Home / Microsoft / Microsoft DOS / Talking to IIS 7 (Windows 7, 2008)
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] - (Bottom) Print
Author Topic: Talking to IIS 7 (Windows 7, 2008)  (Read 406 times)
shiyam198
Topic Starter
Starter



Posts: 3

Experience: Beginner
OS: Unknown

« on: February 06, 2011, 01:21:43 PM »

Hi,

I got the following script from the windows scripting book for windows 2003 so obviously written for IIS 6.

The rror I am getting when I run this is :

iis.vbs(13, 1) (null): 0x8004100E

This is - Syntax error.

Line 13 is - Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & wmiNS)


I think the problem is what I am passing on wmiNS.

I tried different values based on several articles I have read after a few google searches.

- GetObject("IIS://" & ComputerName & "/W3SVC")
- GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "/W3SVC")
- wmiNS = “/root/MicrosoftIISv2"

Nothing worked. I am not able to find any thing. Can you please let me know what am i doing wrong and also point me to a book/site/tutorial on using scripts on IIS 7? (Mainly to create Application Pools, set application pool parameters, Create sites, create site specific parameters, create site specific ASP paramters, etc)

Thanks for your time

Code: [Select]
Option Explicit
'On Error Resume Next
Dim strComputer
Dim wmiNS
Dim wmiQuery
Dim objWMIService
Dim colItems
Dim objItem

strComputer = "."
wmiNS = "\root\WebAdministration"
wmiQuery = "select * from CIM_Setting"
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & wmiNS)

Set colItems = objWMIService.ExecQuery(wmiQuery)
For Each objItem In colItems
WScript.Echo ": " & objItem.Name
Next

Thanks,
Shiyam
IP logged
Pages: [1] - (Top) Print 
Home / Microsoft / Microsoft DOS / Talking to IIS 7 (Windows 7, 2008) « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.093 seconds with 20 queries.