IIS Server Security >> IIS and WSH

by Matt » Wed, 15 Oct 2003 06:46:53 GMT

OK... dont' bag me for doing things the wrong way, if you
can suggest a much nicer way, then go ahead, but anyways
here my problem:

I'm using WSH and command prompts (cmd) to run a few dos

Mainly i'm wanting to lookup an ip number for it's host, ie
oShell.Run "%ComSpec% /c nslookup " & strIP & "> C:\temp\"
& strIP & ".txt", 0, True

and use rar to compress files before using them, ie.
oShell.Run "c:\temp\rar.exe a -sfx -m5 -av -wc:\temp\ -ep
c:\temp\" & sFileName & ".exe c:\temp\" & sFileName
& ".txt", 0, True

i problem is that since windows 2000 (and i'm
guessing .net) the IIS securities have gotten alot
tighter... well this i know.

My problem is that unless i change the annonymous iis user
to the administrator (a BIG no no) i keep getting
permission errors.

I don't think it's on the folders... well i'm pretty sure
on that one... but i could be wrong.

If someone could tell me what, where (and how) to help me
correct this issue. what policy to change. I've tried
every possible default iis account (user and admin)
without success.

Alternatively if you can think of a solution that doesn't
require COMs etc. (as i don't have full access to all
servers these functions run on) then that'd be great

Thanx in advance

Similar Threads

1. IIS and WSH on 2003 - IIS Server Security

2. Using WSH or VBScript to restart IIS on schedule

3. IIS Lockdown and WSH and Distributed Assembly excecute permission denied - IIS Server Security

4. Can I call a WSH from ASP?

And vice versa?

I want to have a single script for sending emails, accessible from both 
ASP pages in any virtual directory in our websites (all on the one 
server), plus accessible from a number of WSH (windows scripting host 
vbscript files) which are triggered by the web servers Scheduled tasks.

The script formats text and checks emails and so on.

Is this a candidate for a web service? if so, how would i write it? Is a 
web service available from WSH?


5. Regular Expressions, WSH, and not getting New RegExp to work at all - ASP

6. "Permission denied" error while calling WSH's LogEvent method

I am having "Permission denied" error while calling 
LogEvent method of WScript.Shell component.
Basically, ASP page calls Windows Script Host Shell 
component to log events to the OS Application Event log.

My environment:
Windows Server 2003, IIS 6, WSH, Classic ASP, Vbscript

Below is the code and the error:
call LogEvent(0, "some text")

Function LogEvent(intEventType, strEventMessage)
   Set objWshShell = Server.CreateObject("WScript.Shell")
   call objWshShell.LogEvent(intEventType, strEventMessage)
   Set objWshShell = Nothing
End Function

Microsoft VBScript runtime error '800a0046' 
Permission denied 

I made the change below based on 301309 KB article to no 

"...Set the following Registry key to 0 instead of 1, and 
then restart your computer for the changes to take effect. 
Name: RestrictGuestAccess

I guess Windows Server 2003 configuration is a reason for 
the error. Everything worked fine on Win2K server with IIS 

7. Can't execute WSH script from bat file - ASP

8. wsh VS aspexec

which is better to use?

dim wsh
set wsh = Server.CreateObject("WScript.Shell")
wsh.run "c:\build.exe", 1, True
set wsh = nothing


Dim Executor
Set Executor = Server.CreateObject("ASPExec.Execute")
Executor.Application = "c:\build.exe"
Executor.ShowWindow = True
Set Executor = nothing