Solved

What user does WSCRIPT.Shell run as?

Posted on 2001-06-19
8
3,538 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
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 100 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Executing a script on a timer online 5 43
MS SQL 2008 and stored prodcures and dates 5 34
Clear input text 15 32
ms sql string field to asp variable as number 5 29
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

738 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