?
Solved

What user does WSCRIPT.Shell run as?

Posted on 2001-06-19
8
Medium Priority
?
3,556 Views
Last Modified: 2008-02-07
If I use the WSCRIPT.Shell's "run" method to execute a command line program, what user does this run as?  

I am able to get my program to run, however it uses some COM components which need to be ran as a specific user.  I have tried changing the IIS Directory Security permissions to the user I want it to run as, but this does not seem to work.

Any ideas?

Thanks in advance.
David
0
Comment
Question by:d_glenn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 20

Expert Comment

by:jitganguly
ID: 6208201
Does IUSR_{yourservername} user has rights to execute those COM componets  ? Check that and assign permission to that user to those COM componets and then try runnign as This user from IIS
0
 
LVL 11

Expert Comment

by:ASPGuru
ID: 6208234
it runs as IUSR_*, unless you turn off anonymous access to your virtual directory and login as the desired user.
0
 
LVL 1

Author Comment

by:d_glenn
ID: 6208326
I have already changed it so that anonymous access for the virtual directory uses my user with the appropriate DCOM permissions.  

Any other ideas?
Thanks
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Expert Comment

by:gbaren
ID: 6208333
I have to disagree here.

IUSR_machine is for ASP, not WScript. I even tested it to make sure.


VB EXE (who.exe)
------------
dim oSys as Nnew WinNTSysInfo
msgbox oSys.UserName


VB Scirpt
-------------
Set Wsh = WScript.CreateObject("WScript.Shell")
Wsh.Run "who.exe"


Result: Currently Logged On User.

WSCript RUN runs in context of currently logged on user.


0
 
LVL 1

Author Comment

by:d_glenn
ID: 6208439
...but I am running the WSCRIPT.Shell component in an ASP page, so there is not a user to be logged in as.
0
 
LVL 1

Author Comment

by:d_glenn
ID: 6208453
Shouldn't it run as the user specified in the "Account used for anonymous access" in IIS for the virtual directory?
0
 
LVL 5

Expert Comment

by:gbaren
ID: 6208651
I see. I didn't realize you were running from the ASP page.

I actually have a piece of code that will spawn RunAs from VB with alternate credentials to move the current user from group to group. Here's a piece that you might find useful:



    sRunAsCmd = "C:\Winnt\System32\RunAs.exe"
    sRunAsParams = " /user:DOMAIN\USRNAME "
    sApp = "\" & Chr(34) & App.Path & "\YourApp.exe\" & Chr(34) & " "
    sParams = "\" & Chr(34) & "Your Parameters" & "\" & Chr(34)
   
    sCommand = sRunAsCmd & sRunAsParams & Chr(34) & sApp & sParams & Chr(34)
   
    Set oShell = New IWshShell_Class
   
    vTaskID = Shell(sCommand, 1)
    DoEvents
   
    Sleep 400
   
    If oShell.AppActivate(vTaskID) Then
        oShell.SendKeys sPwd & "{ENTER}"
    End If
0
 
LVL 20

Accepted Solution

by:
Silvers5 earned 400 total points
ID: 6209266
The IUSR_Webservername is by default the NT anonymous account (it can be changed from within IIS site settings) so either give permissions to the IUSR (local account on the web server) on whatever your com is doing or include your component in MTS and assign a higher privelieged user to run the package.. also you might need to give the Iwam permissions if an out of process application will start.. you can also to simplify your life use a free component called aspexec instead of the shell http://www.serverobjects.com/products.htm , you can assign an admin account to run the component , thus all your permission issues will be resolved..

rgrds
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question