IISFAQ WSH Script in/to DotNet

B

Benjamin Bittner

Hallo Zeeshan,
M. Zeeshan Mustafa said:
check out
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemdiagnosticsprocessclassstarttopic.asp

you can use this:
Process.Start("D:\path\to\MakeWebSite.vbs", "arguments here")

and it will run MakeWebSite.vbs script and will pass arguments
you have specified
Ive tried this:

Try
Process.Start("C:\Inetpub\AdminScripts\mkw3site.vbs", " -r
C:\Inetpub\wwwroot -t client.loopline.de -o 8080")
Catch exc As Exception
lblTest.Text = exc.ToString
End Try

No error msg is shown, but the script wont work. If i execute this:
C:\Inetpub\AdminScripts\mkw3site.vbs -r C:\Inetpub\wwwroot -t
client.loopline.de -o 8080
it works.

What could cause this?

PS. the vbs script i found, wont work in any case, so i used the one which
comes with the iis.

regards benjamin
 
M

M. Zeeshan Mustafa

Benjamin,

I tested the script at my side, and it works fine.

I beleive that the user which is running aspnet worker
process (ASPNET usually) does not have permissions to add
new web site (or do whatever admin task).

If you are impersonating identity of web your user, then the
user may does not have permissions to run script.

This happens because when you do process.start('c:\...\blah.vbs')
it runs in the security context of the user which is doing process.start.
 
B

Benjamin Bittner

Hallo Zeeshan
M. Zeeshan Mustafa said:
Benjamin,

I tested the script at my side, and it works fine.

I beleive that the user which is running aspnet worker
process (ASPNET usually) does not have permissions to add
new web site (or do whatever admin task).

If you are impersonating identity of web your user, then the
user may does not have permissions to run script.

This happens because when you do process.start('c:\...\blah.vbs')
it runs in the security context of the user which is doing process.start.
Can i start a process with another user?
Or is there another workaround?

regards benjamin
 
M

M. Zeeshan Mustafa

you can add ASPNET user in Administrators user group on
your computer or start ASPNET woker process as SYSTEM
so it will have full system level previliges.

if you want to start ASPNET worker process as SYSTEM
read this http://www.aspheute.com/artikel/20020123.htm (german)
article for introduction and replace "machine" to "system" in userName
attribute in <processModel .../> .... reboot your pc.

doing this will make asp.net worker process to start as system user.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top