IISFAQ WSH Script in/to DotNet

  • Thread starter Thread starter Benjamin Bittner
  • Start date Start date
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
 
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.
 
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
 
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.
 
Back
Top