none
run elevated command prompt (or application) as another user

    Question

  • I can run an application as another user, and I can run an application as another user.  What I cannot figure out how to do is run an application as another user with elevation.  Both of the accounts are in the administrators groups of the windows 7 pro systems, one os a domain admin.  In order to get around this I currently have to turn off UAC.  Is there a way to choose run as administrator and somehow use another user account?
    Wednesday, April 21, 2010 7:00 PM

Answers

  • Based on my research, there are only two choices: run as another user and run as administrator. If you would like to modify the execution policy via another user profile with administrator privilege, you have log off the current account and login on with another user account.

     

    Thanks,

    Novak

     

     

    • Marked as answer by Jim_B Friday, April 30, 2010 6:49 PM
    Friday, April 30, 2010 2:56 AM

All replies

  • Hi,

     

    To run an application as different user account, you just need press “Shift” key when right clicking the application shortcut. Also, you can refer to the following method:

     

    Run as different user

     

    Thanks,

    Novak

    Tuesday, April 27, 2010 7:23 AM
  • right. unfortunatly you have to choose- either another user OR an administrator.  How can I run as another user and elevate that user.  To see what I am talking about try running powershell as another user (that's also in the admin group on the system).  Once the prompt opens try changing the execution policy. You should get a message about being denied access
    Tuesday, April 27, 2010 2:22 PM
  • Based on my research, there are only two choices: run as another user and run as administrator. If you would like to modify the execution policy via another user profile with administrator privilege, you have log off the current account and login on with another user account.

     

    Thanks,

    Novak

     

     

    • Marked as answer by Jim_B Friday, April 30, 2010 6:49 PM
    Friday, April 30, 2010 2:56 AM
  • Thanks Novak, I just wanted to make sure that this was in fact broken in windows 7 and not just something I didn't understand.  Do you know if there is any sort of fix in the works to allow windows 7 to have multiple user accounts with administrative rights?
    Friday, April 30, 2010 6:51 PM
  • I had a similar problem, I needed to test some backup code (PowerShell) which I needed to run as a different user account with elevated permissions due to the fact that the code updates registry keys on the local workstation where I was testing (which requires elevated permissions) but required access to SQL (which required to execute as a different account).

    I ended up starting a command prompt with "Run as administrator" and then from the elevated command prompt I performed "runas /netonly /user:UserAccount PowerShell_ISE.exe". This allowed me to run local with elevated permissions and still have the necessary network access.

    Hope it helps.

    • Proposed as answer by LgBankston Friday, April 29, 2011 1:15 PM
    Thursday, February 03, 2011 7:45 AM
  • I have found the way to do this is to create the account locally on your PC with elevated priveleges. Once you have done that you can then hold shift+right-click the cmd window. Select run as a different user and chose the different user you created the local account for. I've done this will my environment because we have our regular AD accounts and then what they call our secure accounts. Secure accounts don't have email or access to the internet but give you access to all of your servers. Regular accounts give access to email and internet. I have to manage AD,DNS and DHCP from my local machine with the MMC. I just created a new MMC, added my secure account as an admin on my pc and run the saved MMC as my secure account. Works every time!
    Friday, April 29, 2011 1:21 PM
  • There is a working solution for this... be logged in as a non-administrator (as is recommended!).

    To run as any other user with elevation:  Right-click and choose "Run as Administrator" and enter the credentials of that user.

    To run as any other user without elevation:  Shift-Right-click and choose "Run as different user" and enter the credentials of that user.

    This is how I work all the time, and it works great.  I have to run various MMC consoles as myself for one Domain, as a domain admin for another domain, as a "domain workstation admin" for remote management, and as local admin for Ghost or local management.  Interestingly, some things like MMC require the elevation step even though they don't require admin rights.  This means that the MMCs I run as myself, still require me to enter my credentials. 

    The biggest annoyance I have is that our baseline GPO blocks non-admins rights to regedit.exe.  I can't get into my HKCU if I run it as local admin (because I'm logged in - thus it's locked).  The solution is a simple batch file that gives my account execute rights (with icacls).  I run that as local admin just before I attempt to open regedit.

    True, I have to think about which account I want use when I start any particular administrative tool, but isn't that the point?  Shouldn't we admins think twice before we do admin work?

    I think anyone technical enough to be posting on TechNet forums should try running Win7 under standard user rights.  It's not bad at all, and does have some advantages.

     

    • Proposed as answer by cascomp Friday, June 03, 2011 4:29 PM
    Friday, June 03, 2011 4:29 PM
  • I may have another solution (at least it's working for my collegue on Win7 who is running as an admin [despite my attempts at conversion])...

    Download CPAU from JoeWare.net

    Download Elevate.exe from Johannes Passing

    The following works (at least in some cases - we are starting an mmc/msc) in a batch file:

    CPAU.exe  -u <domain\user> -p <password> -ex "Elevate.exe <program and arguments>"

    specifically, our batch includes:

    CPAU.exe  -u DomainA\testadmin -p pAss1234 -ex "elevate.exe mmc MngAComp.msc"

    You may have to play with the CPAU parameters (i.e. add -profile) depending on what you are trying to do.

    Hope this helps someone.

     

    • Proposed as answer by cascomp Thursday, November 17, 2011 1:51 PM
    Friday, June 03, 2011 8:47 PM
  • There is one way with inbuilt options from Windows 7 / Windows Server 2008.

    To start application from another user and with elevated rights (as administrator) in the same time, you have to:

    Right Click on executable -> Properties -> Compatibility -> "Change settings for all users..." -> Check "Run this program as an administrator" -> OK

    Now start application with Shift+Right Click -> Run as different user -> enter credentials -> Elevation approval popup should appear, so press Yes to approve elevation.



    • Edited by Ivan Akcheurov Wednesday, August 31, 2011 8:26 AM small edit
    • Proposed as answer by mps83 Wednesday, December 07, 2011 9:54 AM
    Wednesday, August 31, 2011 8:25 AM
  • Thanks Ivan, your answer helped me a lot.
    Wednesday, December 07, 2011 9:54 AM