I am curious on how i would list out Web services, Web sites, and App Pools to a .txt file on a Windows Server 2003 machine. I have Powershell 2.0 configured and have been trying to run some scripts but nothing seems to work.
I've tried:
iisweb /query
and i get an error saying:
- This script does not work with WScript
- Would you like to register CScript as your default host for VBscript?
- To run this script type: `"CScript.exe IIsCnfg.vbs[params]"`
I tried using CScript.exe IIsCnfg.vbs[params]"but even that command fails and errors out to an
Input error: Can not find script file "C:\%SYSTEMROOT%\system32\iiscnfg.vbs`
Anyone have any experience with Windows Server 2003 and using Powershell with it? Version of Powershell is 2.0
@pk
Here is what it gives me as an error code. I also dont understand the parameters it wants me to give it.
PS U:> CSript.exe IIsCnfg.vsb /query
The term 'CSript.exe' is not recognized as the name of a cmdlet, function, script file, oroperable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At line:1 char:11
+ CSript.exe <<<< IIsCnfg.vsb /query
+ CategoryInfo : ObjectNotFound: (CSript.exe:String) [], CommandN
otFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
C:\%SYSTEMROOT%\system32\iiscnfg.vbs
? If so, that path doesn't exist. The%SYSTEMROOT%
variable already contains the drive letter, so in effect it's looking forC:\C:\Windows\system32\iiscnfg.vbs
.cscript
, notcsript
(notice thec
aftercs
)