By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,574 Members | 1,205 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,574 IT Pros & Developers. It's quick & easy.

IISFAQ WSH Script in/to DotNet

P: n/a
Hallo NG,
ive found this script http://www.iisfaq.com/default.aspx?View=A399&P=109.
Now i want to use that script in a web application. can someone plz help me
to convert it, or show me a way to call it from asp.net (written in vb.net).

thx in advance
regards benjamin
Nov 18 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
check out
http://msdn.microsoft.com/library/en...starttopic.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

--
Hope this helps,
Zeeshan Mustafa, MCSD
"Benjamin Bittner" <benjamin_bittner[a_t]nospam.web.de> wrote in message
news:Oz**************@tk2msftngp13.phx.gbl...
Hallo NG,
ive found this script http://www.iisfaq.com/default.aspx?View=A399&P=109.
Now i want to use that script in a web application. can someone plz help me to convert it, or show me a way to call it from asp.net (written in vb.net).
thx in advance
regards benjamin



Nov 18 '05 #2

P: n/a
Hallo Zeeshan,
"M. Zeeshan Mustafa" <ze*****@no-spm.please.zeeshan.net> schrieb im
Newsbeitrag news:O8**************@TK2MSFTNGP09.phx.gbl...
check out
http://msdn.microsoft.com/library/en...starttopic.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.vb s", " -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
Nov 18 '05 #3

P: n/a
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.

--
Hope this helps,
Zeeshan Mustafa, MCSD
"Benjamin Bittner" <benjamin_bittner[a_t]nospam.web.de> wrote in message
news:eg**************@TK2MSFTNGP09.phx.gbl...
Hallo Zeeshan,
"M. Zeeshan Mustafa" <ze*****@no-spm.please.zeeshan.net> schrieb im
Newsbeitrag news:O8**************@TK2MSFTNGP09.phx.gbl...
check out

http://msdn.microsoft.com/library/en...starttopic.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.vb s", " -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

Nov 18 '05 #4

P: n/a
Hallo Zeeshan
"M. Zeeshan Mustafa" <ze*****@no-spm.please.zeeshan.net> schrieb im
Newsbeitrag news:%2****************@TK2MSFTNGP10.phx.gbl...
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
Nov 18 '05 #5

P: n/a
Hallo NG,
i think i found something.
With CreateProcessAsUser, you can start a process with another user. but the
problem is, i dont have a clue how to use it.
here is a kb article for CreateProcessAsUser.
http://msdn.microsoft.com/library/de...cessasuser.asp

could someone plz provide me a example for this?

thx in advance
regards benjamin
Nov 18 '05 #6

P: n/a
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.

--
Hope this helps,
Zeeshan Mustafa, MCSD
"Benjamin Bittner" <benjamin_bittner[a_t]nospam.web.de> wrote in message
news:ub**************@TK2MSFTNGP09.phx.gbl...
Hallo Zeeshan
"M. Zeeshan Mustafa" <ze*****@no-spm.please.zeeshan.net> schrieb im
Newsbeitrag news:%2****************@TK2MSFTNGP10.phx.gbl...
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

Nov 18 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.