Elevated command prompt as another user

uacwindows 7

I'm running Windows 7 (Enterprise, x64 if it makes any difference)

My account has admin privileges on this PC, but is a regular user on the domain.

I have another user account that is a member of Domain Admins. Generally, I can run admin tools as that user, and the fact that they are sometimes not elevated locally doesn't matter – they have full privileges on the domain, and that's what usually counts.

But occasionally, I need to do things like copy a file I've downloaded into a folder on a server that I need admin privileges to access. My admin account, when non-elevated, doesn't have access to my own account's private data on the PC.

I can launch a command prompt elevated under my own account, or I can launch a command prompt non-elevated under my admin account. But, short of using switch user, I can't come up with a way to launch a command prompt elevated as another user.

Anyone got any brilliant ideas?

Best Answer

PSEXEC.EXE FTW on this one

link to psexec page on sysinternals site

The -h will allow you to use Elevation if available From Psexec /?

-h If the target system is Vista or higher, has the process run with the account's elevated token, if available.

what you do is open a Elevated command prompt as you're logged in use (that has local admin rights of course)

Run Psexec with this command line to open a CMD shell under this window as a different elevated user

psexec  -h /user domain\username cmd

This should drop you to a new Prompt in the same window and you should have admin rights if both you and the other account have admin rights on that local system

If you take the -h off it will open up a new windows with user rights.

Runas doesn’t see to work for this. when I check for the Turst levels all I get with UAC on is

runas /showtrustlevels
The following trust levels are available on your system:
0x20000 (Basic User)

this no mater how I run it.

the Shell extension is built in to windows 7. You just have to hold the left shift key while you right click. Left shift exposes a lot of things sysadmins will find useful