Welcome to MSDN Blogs Sign in | Join | Help

MakeMeAdmin -- temporary admin for your Limited User account

[added March 11, 2005:  Important follow-up here:  http://blogs.msdn.com/aaron_margosis/archive/2005/03/11/394244.aspx]

 

Common scenario:  you log on with your Windows domain account, which you have removed from the Administrators group (as well as from Power Users, Backup Operators, etc.).  When you need to perform tasks that require elevated privileges, you use RunAs to start a program with the local Administrator account.  You quickly realize two things:

  1. The program running as local Administrator cannot access network resources, since your local account is recognized only on your own computer; and
  2. Any per-user settings apply to the local Administrator’s profile, not to the profile you normally work with.

 

The first problem often occurs when installing software from a network share, or an ActiveX control from an intranet site that uses Windows authentication.  An area where the second problem crops up is with applications that assume that it will be installed by the same user who will use it.  Some apps also have a “run-once” problem, in which the app needs to be executed one time with admin privileges.  For some, such as Windows Messenger 4.x, each user has to run it one time with admin privs.

 

The per-user settings problem also occurs with the Power Options applet in Control Panel, which modifies both per-machine and per-user settings.  When you use it from an unprivileged account, an error occurs writing the per-machine settings, so the per-user settings never get written.  When you use it from the local admin account, the per-user settings you write are for the local admin account, not the account you normally use.

 

There are a number of ways to address the network access problem.  The first of these that I’ll describe also addresses the user profile problem.

 

Elevating your normal account to admin

 

The only effective way I know of to address the user profile issue is to make your “normal” account an administrator.  The trick is to do it for the least amount of time necessary. 

 

The long and painful way

 

Using an admin account, you can add your normal account into the Administrators group, but that change doesn’t take effect until the next time you log on.  If you’ve tried this, you’ve probably noticed that it’s a pain to add your domain user account into the Administrators group using the GUI – first you need to use RunAs to run the Computer Management / Local Users and Groups console; you then get prompted for network credentials to resolve the domain names because your local admin account isn’t recognized.  And then when you’re done with all that, your current logon still doesn’t have admin privileges because changes to groups and privileges only take effect on subsequent logons.  Finally, you need to remember to remove yourself from the Administrators group and then log back in again to make that change take effect.

 

“MakeMeAdmin”

 

MakeMeAdmin.cmd addresses all of these issues.  When you run it, you get a Command Prompt running under your normal user account, but in a new logon session in which it is a member of the Administrators group.  This Command Prompt and any programs started from it use your regular profile, authenticate as you on the network, but have full local admin privileges.  All other programs continue to run with your regular, unprivileged account.

 

How does it work?  Remember a moment ago when I mentioned that changes to groups and privileges take effect only on subsequent logons?  The critical thing to understand is that you do not actually need to log out in order to log on.  If you use RunAs to start a process with your current account, it creates a new logon session and builds a new token, taking into account group memberships in effect at that instant.  MakeMeAdmin.cmd invokes RunAs twice, prompting you first for your local admin password, then for your current account password.  The bit that runs as local administrator does the following:

  1. Adds your current account to the local Administrators group (using NET LOCALGROUP, avoiding the problem of needing network credentials to resolve names);
  2. Invokes RunAs to start a new instance of cmd.exe using your current account, which is at this instant a member of Administrators;
  3. Removes your current account from the local Administrators group.

The result of the second step is a Command Prompt running in a new logon session, with a brand new token representing your current account, but as a member of Administrators.  The third step has no effect on the new cmd.exe’s token, in the same way that adding your account to Administrators does not affect any previously running processes.

 

The zip file also includes a less-privileged version, MakeMePU.cmd, which temporarily elevates you to Power Users instead of Administrators.

 

A very brief bit about processes and tokens

 

I’ll try to keep this as brief and broad-brush as possible.  What follows is not 100% accurate and complete, but if you’re unfamiliar with the concepts I think you might find it helpful:

  • Every program in Windows runs in a “process”.  A process may display zero or more windows.  You can see a list of the running processes by starting Task Manager and clicking on the “Processes” tab.  If you click on the “Applications” tab, then right-click on one of the items listed there and choose “Go To Process”, it will show you which process that “application” is running in.
  • A “token” identifies a user, the Windows groups that user belongs to, and a set of system privileges, such as the ability to change the computer’s clock.  When a user logs on (including with RunAs), the system creates a new token for the user, determining at that time what groups the user is a member of and which privileges the user should have.  Once a token is created, one can’t add or (generally) remove any groups or privileges from the token.
  • Every process always has a token.  In almost all cases, its token is a copy of that of its parent process (the process which started it).
  • Whenever a process tries to access a securable object (such as a file or a registry key), an access check is performed by comparing the process’ token to the “access control list” (ACL) of the object.  The result of that access check determines whether the requested access is allowed or denied.

 

Addressing the network resource access issue

 

If you prefer to use the local administrator account, but need to use your domain account for network access, there are a couple of other approaches:

 

From your local admin Command Prompt, you can simply NET USE to authenticate to the specific resources you need to access.  You need to authenticate separately this way for every remote computer you wish to access.  NET USE is logon-session specific, so any connections established in one Command Prompt affect only processes started within the same RunAs session.

 

Another commonly used approach is to use RunAs with /netonly.  The /netonly option starts the target process in a new logon session with the current token, but with the account you specify for all SSPI-based network access.  You can kind of think of it as implicitly calling NET USE for every remote computer you try to access.  Here’s how you might use it (ignore word-wrapping – this should be one line):

runas /u:%COMPUTERNAME%\Administrator "runas /netonly /u:%USERDOMAIN%\%USERNAME% cmd.exe"

(If you have renamed your builtin Administrator account, change “Administrator” to the new name.)

As with MakeMeAdmin, RunAs is used twice and you’ll get prompted for two passwords:  that of the local Administrator, and that of your current account.  What you’ll get is a Command Prompt running under the local Administrator account, using the local Administrator profile, but authenticating on the network with your domain account.  (Confusingly, the title bar will say that you’re running as the domain user rather than as the local administrator.)

 

Tradeoffs of MakeMeAdmin vs. using the builtin Administrator account

 

Personally, I prefer using MakeMeAdmin.  The main issues I have run into with MakeMeAdmin are 1) telling privileged from unprivileged apps, 2) Explorer issues, and 3) issues with objects created while running with elevated privilege.

 

1.  Telling privileged from unprivileged apps

 

In two previous posts, I echoed Keith Brown's suggestion to change the admin’s background bitmap for Explorer and Internet Explorer so that you could tell your admin windows from your non-admin ones.  But with MakeMeAdmin, you can have different IE and Explorer windows all running as “you”, but some with administrator privileges and others not.  The background bitmap settings are associated with user accounts, not with privilege levels, so they don’t help you in this scenario.

 

I promised to provide a solution.  It’s called PrivBar and it adds a toolbar to your IE and Explorer windows that lets you know at a glance at what privilege level that particular instance is running.  At this point I will have to postpone it to a future post – this post is already very long and very overdue!  I will try to post it really soon!  [July 24, 2004, 11:40pm Eastern US time:  It's up!  http://blogs.msdn.com/aaron_margosis/archive/2004/07/24/195350.aspx]

 

2.  Explorer issues

 

If you want to start explorer.exe from a MakeMeAdmin context, you need to set the Separate Process flag for your normal account, and you must start explorer.exe with /root, in the command line unless there are no other Explorer windows running.  For more information, read my post about using RunAs with Explorer, paying close attention to “More info about Explorer’s Separate Process flag” and the references to explorer.exe command line options.

 

3.  Objects created while running with elevated privilege

 

Normally, when a user creates a securable object, such as a file, folder, or registry key, that user becomes the “owner” of the object and by default is granted Full Control over it.  Prior to Windows XP, if the user was a member of the Administrators group, that group, rather than the user, would get ownership and full control.  The user still had ownership and control over the object by being a member of Administrators.  But if you created objects while a member of Administrators and then were removed from the group, your subsequent use of those objects could be limited or completely denied.  Windows XP introduced a configurable option whether ownership and control of an object created by an administrator would be granted to the specific user or to the Administrators group.  The default on XP is to grant this to the object creator; the default on Windows Server 2003 is to grant it to the Administrators group.

 

I’m not on the Windows team and was not party to the thinking that went into exposing this option and establishing its defaults.  My guess is that it was that on the server, all admins are equal.  If I’m an admin on a server and I create an object and am later reassigned or leave the company, any other admin should be able to access and manage the objects I created without any trouble.  A workstation, however, is more likely to be a single-user device.  Objects I create on my computer, such as documents, should remain under my control even if I change myself from a Computer Administrator to a Limited User (to use XP Home Edition’s terminology).  I think this makes a lot of sense.

 

However, MakeMeAdmin changes things.  If I use MakeMeAdmin to install programs, my normal account will be granted ownership and full control over the installation folder, the program executable files, and any registry keys the installation program creates.  Those access rights will remain even when I am no longer running with administrator privileges.  That’s not what I want at all.  I want to be able to run the app, create and modify my own data files, but not to retain full control over the program files after I have installed it.  For this reason, I changed the “default owner” setting on my computer to “Administrators group”.

 

To view or change this setting, open “Local Security Policy” in Administrative Tools, or run secpol.msc.  You need to be an admin to use this tool.  In the left pane, browse to Security Settings \ Local Policies \ Security Options.  The policy name is “System objects: Default owner for objects created by members of the Administrators group”.  The allowable settings are “Administrators group” or “Object creator”.

 

Coming Real Soon

  • PrivBar
  • Running with a restricted token (what does “protect my computer and data from unauthorized program activity” actually mean)
  • ???

 

Published Saturday, July 24, 2004 1:24 AM by Aaron Margosis
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: MakeMeAdmin -- temporary admin for your Limited User account

Saturday, July 24, 2004 1:38 AM by Dane Watson
Thank you for the excellent informative posting

# re: MakeMeAdmin -- temporary admin for your Limited User account

Saturday, July 24, 2004 2:29 AM by Andrew Storrs
Thanks Aaron, I've been eagerly awaiting this post... Looking forward to the privbar

# MakeMeAdmin - temporary admin for your Limited User account

Saturday, July 24, 2004 11:10 AM by Donna's SecurityFlash

# re: MakeMeAdmin -- temporary admin for your Limited User account

Sunday, July 25, 2004 1:08 PM by Daniel Schlößer
On a German Windows one has to change in the batch file the group name from Administrators to Administratoren ;-) It works perfect now!

# re: MakeMeAdmin -- temporary admin for your Limited User account

Sunday, July 25, 2004 5:00 PM by Wes
Very informative post for me. Thanks for the lesson, now maybe I will try to run as non-admin.

# re: MakeMeAdmin -- temporary admin for your Limited User account

Sunday, July 25, 2004 9:23 PM by Aaron Margosis
Daniel, thanks for the note. I should have mentioned that the script can be customized, for localization or any other reason. Thanks for pointing it out.

# running as non-admin

Monday, July 26, 2004 3:35 PM by Eric Jarvi

# re: MakeMeAdmin -- temporary admin for your Limited User account

Monday, July 26, 2004 8:00 PM by ToddM
I had to make a change or five to get the batch file to handle user names with embedded spaces. Wasn't exactly a trival change, either, given the existence double quotes already in the cmd file. (And, no, just using \" didn't help, either). Once I've got it cleaned-up, I'll post here.

# re: MakeMeAdmin -- temporary admin for your Limited User account

Monday, July 26, 2004 8:46 PM by Aaron Margosis
ToddM - thanks, good point. Does this work for you? (I've tried it and it seems to work for me...) Mostly just replace instances of %1 with "%*". I've only tried this with the current username with an embedded space - didn't try domain/workgroup name with embedded space, or a renamed admin account with an embedded space.


@echo off
setlocal
set _Admin_=%COMPUTERNAME%\Administrator
set _Group_=Administrators
set _Prog_="cmd.exe /k Title *** %* as Admin *** && cd c:\ && color 4F"
set _User_=%USERDOMAIN%\%USERNAME%

if "%1"=="" (
runas /u:%_Admin_% "%~s0 %_User_%"
if ERRORLEVEL 1 echo. && pause
) else (
echo Adding user %* to group %_Group_%...
net localgroup %_Group_% "%*" /ADD
if ERRORLEVEL 1 echo. && pause
echo.
echo Starting program in new logon session...
runas /u:"%*" %_Prog_%
if ERRORLEVEL 1 echo. && pause
echo.
echo Removing user %* from group %_Group_%...
net localgroup %_Group_% "%*" /DELETE
if ERRORLEVEL 1 echo. && pause
)
endlocal

# re: MakeMeAdmin -- temporary admin for your Limited User account

Thursday, July 29, 2004 8:22 PM by Ari Pernick
"iexplore.exe -new" will do what you want without setting any special settings.

# re: MakeMeAdmin -- temporary admin for your Limited User account

Thursday, July 29, 2004 8:48 PM by Aaron Margosis
Ari - what does -new do for iexplore.exe? Wasn't that for starting IE 4.x in a new process? Starting iexplore.exe always results in a separate process now.

# re: MakeMeAdmin -- temporary admin for your Limited User account

Monday, August 02, 2004 1:54 PM by Howard Hoy
We use a similar process here for our Zenworks Deployments. In some instances the Zenworks tool will not properly elevate a user which then requires us to add a user to the admin group, then remove them. I have devloped a tool called Authenti-key for NT that allows you elevate installs as an administrator. IT works on 95 - XP. You can create an elevated CMD window and perform any admin task from there. Similar to SU and can be used in scripting.

Here is a link.

http://downloads-zdnet.com.com/Authenti-Key-for-NT-AKEY-/3000-2094-10153448.html?tag=lst-0-1

Great work on the script. !!

# Installing software as Admin?

Tuesday, August 10, 2004 11:06 PM by TrackBack
Use MakeMeAdmin.cmd when installign software

# Installing software as Admin?

Tuesday, August 10, 2004 11:09 PM by TrackBack
Use MakeMeAdmin.cmd when installign software

# MakeMeAdmin script

Wednesday, August 11, 2004 10:31 AM by Extra88
This is an interesting script. It has some room for error but I have an idea about how to avoid that. Some fellow who seems to work for Microsoft in some capacity has written a batch script called MacMeAdmin that...

# re: MakeMeAdmin -- temporary admin for your Limited User account

Wednesday, August 11, 2004 10:47 AM by Marc Poljak
thanks a lot for this superb script. I was looking for a solution that addresses the issues with "RunAs" for a long time.

# re: MakeMeAdmin -- temporary admin for your Limited User account

Wednesday, August 11, 2004 12:33 PM by Carolh
Great utility. The one problem we ran into is that we have the "installation" file on a netware server, and can't point to the network drive mapping.

# re: MakeMeAdmin -- temporary admin for your Limited User account

Wednesday, August 11, 2004 1:09 PM by Aaron Margosis
Carolh - Correct. SMB sessions (e.g., NET USE connections and drive mappings) belong to a logon session. Since MakeMeAdmin runs in a separate logon session from your main shell, it doesn't automatically get the shell session's drive mappings. (I assume the same or similar is true with IPX/SPX stuff.) You can create a new connection within the MakeMeAdmin session using NET USE or the NetWare equivalent.

# re: MakeMeAdmin -- temporary admin for your Limited User account

Wednesday, August 11, 2004 1:34 PM by Toby Ovod-Everett
Clever - I was wondering how you were going to get around the logon problem, but the minute you said "creates a new logon session" I knew where you were going! Cute!

That said, I'm personally a bit queasy about any RunAs style solutions - because the secure and insecure windows are in the same (ok, I'm hunting for the term, what do you call the ?contexts? ?windows sessions? that which every logged on user under XP fast user switching has one of - I'll call them window sessions for now - I know there's a proper term for them) window session, there is a greater chance of cross-application attacks through SendMessage, PostMessage, screen grabs, etc. Personally, I'm pretty happy with the Fast User Switching approach on my home machine (which obviously isn't a domain member) - I use the account "Admin" (created) for administrative stuff and then there are personal accounts for my wife and I, guests, etc. With 768 MB of RAM, I rarely run into resource issues, even with up to seven simultaneous sessions logged in. It only takes ten seconds to hit Windows-L, click, type in the Admin password, and go do something.

Of course, to be safer, I should never su to root on my Linux box (since anyone who manages to get access to my personal account could easily alias su to something else), etc. I do try to change all my passwords whenever I am forced to authenticate from a machine I don't trust (i.e. Internet cafes in airports).

--Toby Ovod-Everett

# MakeMeAdmin -- temporary admin for your Limited User account

Wednesday, August 11, 2004 4:24 PM by Lockergnome's Tech News Watch
"Common scenario: you log on with your Windows domain account, which you have removed from the Administrators group (as well as from Power Users, Backup Operators, etc.) . When you need to perform tasks that require elevated privileges, you use RunAs to start a program with the local Administrator account. You quickly realize" that this is a pain in the posterior! Here's how to go about it much easier and without the limitations....

# re: MakeMeAdmin -- temporary admin for your Limited User account

Wednesday, August 11, 2004 9:54 PM by Aaron Margosis
Toby - I've never had my code called "cute" before. Thanks?

The term you are looking for in the 2nd paragraph is "desktop" - as in, the Win32 construct that is defined within a Window Station. (See http://msdn.microsoft.com/library/en-us/dllproc/base/desktops.asp) . Any program (more accurately, any thread) running on a particular desktop can access any window running on that desktop, send it messages, simulating keystrokes and mouse events, etc. When you use RunAs, you're creating a new program running in a different security context, but on the same desktop, so the risk you identified exists. With Fast User Switching, you are switching to a different desktop and are not vulnerable to those kinds of attacks. I pointed to Fast User Switching in an earlier post called "The easiest way to run as non-admin"; it is IMO also the most secure way to run as non-admin for the reason you point out. However, FUS isn't available for domain-joined machines.

# re: MakeMeAdmin -- temporary admin for your Limited User account

Thursday, August 12, 2004 3:28 AM by Marc Poljak
Aaron - is there a way to avoid the first command prompt for the local administrator? I would find it great if you know a method how to pipe it, like for example: echo YourSecretPassword| runas /u:%_Admin_% "%~s0 %_User_%" ?

# re: MakeMeAdmin -- temporary admin for your Limited User account

Thursday, August 12, 2004 3:58 AM by Sean McLeod
I looked at my Local Security Policy on my XP machine and "System objects: Default owner..." is set to "ObjectCreator". However when I check the ownership of files, e.g. Adobe Acrobat Reader and others under "Program Files" the owner is my local machine's administrators group and not my account (which currently is part of the administrators group).

My machine isn't part of a domain.

# Rage on Omnipotent » Make me admin

Thursday, August 12, 2004 6:39 AM by TrackBack
Rage on Omnipotent » Make me admin

# re: MakeMeAdmin -- temporary admin for your Limited User account

Thursday, August 12, 2004 11:57 AM by Sean McLeod
I guess another combo option to get the benefits of running your admin session in a separate desktop using FUS and to use the same user account functionality that MakeMeAdmin offers is to try the following:

Use FUS to login into the Administrator account.
Have a script in the Administrator's startup folder that:
- Kills the explorer.exe process
- Runs a tweaked MakeMeAdmin script to create a new explorer process with your regular account added to the administrators group

Now any further processes that are launched by this instance of explorer will be running with your account in the administrators group.

For those people who can't use FUS since they're part of a domain the other option to look into with XP SP2 is the ability to have an active console user and an active RDP session. There was talk that this would be added in XP SP2 specifically to support the use of Mira/SmartDisplay devices.

If this is enabled in XP SP2 then you could use the above combination just replacing the FUS component with an RDP session back to your localhost.


# re: MakeMeAdmin -- temporary admin for your Limited User account

Friday, August 13, 2004 12:13 AM by Aaron Margosis
Sean McLeod, re ownership of files. I just checked an XP SP1 box that I never changed the default owner setting on. DIR /Q in the Program Files folder shows a mix of specific account and BUILTIN\Administrators ownership. I'm going to take a completely wild guess here and suggest that the ones that show BUILTIN\Administrators were created/installed by the Windows Installer or Automatic Updates services running as System.

Re your FUS replacement - I'd call that "Scary User Switching". I could come up with something that kept the same acronym, but I'd probably be banned from blogging! :-) Seriously, I would expect so many things to break that way, not to mention the security problem of previously running apps trying to do things through the shell - if they manage to do so at all, those things will run with elevated privilege. RDP back to localhost would be good - not as good as FUS since it would still share the same desktop, but could be good.

FWIW, I made a brief attempt to take the old DESKTOPS SDK sample app and rework it to support different contexts on different (Win32) desktops. It kinda sorta worked, but failed in odd ways, too.

# re: MakeMeAdmin -- temporary admin for your Limited User account

Friday, August 13, 2004 12:27 AM by Aaron Margosis
Marc Poljak: as far as I know, RUNAS.EXE does not let you enter passwords through stdin. This is probably to discourage the practice of storing passwords in plain text files.

# re: MakeMeAdmin -- temporary admin for your Limited User account

Friday, August 13, 2004 7:05 AM by Sean McLeod
In terms of RDP back to the localhost, if you're logged onto the console as userX and then RDP back as admin the terminal services component will create a separate desktop for the admin logon session. So I'm not sure why you say it'll share the same desktop.

Only issue is that I think the multiple session option will only be available for Windows Media Center Edition machines with SP2 and not regular Windows XP Pro with SP2.

# re: MakeMeAdmin -- temporary admin for your Limited User account

Friday, August 13, 2004 8:42 AM by Sean McLeod
In terms of "Scary User Switching" ;-) the only 'previously running apps' would be apps started by the 1st instance of Explorer running apps in the admin's startup group etc.

These are the same apps that would run anyway when you use FUS and login in as admin. So I'm not sure what 'security' issue you're thinking of in terms of these now communicating with the 2nd instance of explorer running as your regular account with admin group privileges since they already have admin privilige so could do just about anything anyway.

I was assuming that your admin account wouldn't have loads of these and that 99% of the actual apps that you want to run with admin privileges like user manager etc. you would launch via the new instance of explorer and these would have a token of consisting of your regular account plus the admin group and be the same as the 2nd instance of explorer. So there shouldn't be any 'interaction' problems between these an explorer.

If you definitely didn't want there to be any chance of mixing apps running under the admin account with apps running under your regular account as part of the admin group then another option is a specialised userinit process for your admin FUS session.

Modify WinLogon's userinit registry value to run 'customuserinit.exe' instead of the standard 'userinit.exe'. In this custom userinit program check to see what our current user is, if it isn't administrator then just run the standard userinit.exe and quit.

If the current user is administrator then use a version of your MakeMeAdmin concept to use runas to run the standard userinit.exe with a token of your standard account in the admin group. The standard userinit will then launch explorer and so all processes now will be running with the same token (standard account in the admin group).

So you'll now have 2 FUS sessions, one running as your standard user account without admin privileges and another running as your standard user account with admin privileges on separate desktops.

The one potential downside I see to the MakeMeAdmin concept is that you may have virus/spyware stuff installed as a browser helper object (BHO) or some other variation. But they don't have admin rights which is great since you're not part of the admin group. However if you then use MakeMeAdmin to create a process with yourself in the admin group and then you run an instance of IE now suddenly the spyware BHO will be loaded by this new instance of IE and will now be running with admin rights.

# re: MakeMeAdmin -- temporary admin for your Limited User account

Friday, August 13, 2004 9:10 AM by Aaron Margosis
Sean McL, re RDP back to localhost: I'm referring to the fact that your RDP client app (typically mstsc.exe) is on the same desktop as your non-privileged logon. Unprivileged apps could (at least theoretically, I haven't tried it) send messages to the mstsc window to direct key and mouse events to the remote desktop.

I'll tackle your next post after I get some coffee :-)

# re: MakeMeAdmin -- temporary admin for your Limited User account

Saturday, August 14, 2004 2:24 PM by Will Brown
Aaron Margosis: I love this blog, thank you so much for the time and effort!

Aaron && Sean: Considering the whole same desktop/message issue (how hard would it be for malware to find a process with admin rights? furthermore why isnt there any security for messaging), it seems that Sean's solution, Scary User Switching, as its now officially known :D, seems to be the best one. I'm not sure what the 'previously running apps' are either. They only thing they could be are things started by user logon scripts. According to this <http://www.microsoft.com/windows2000/techinfo/reskit/en-us/default.asp?url=/windows2000/techinfo/reskit/en-us/regentry/12330.asp> the only things userinit does are run logon scripts, establish network connections, and then start explorer. so if your special MakeMeAdmin account isnt running anything with loginscripts, the first thing to run should be explorer.

One thing I think might be better. Instead of making a custom userinit application (which would need to call userinit anyway to reestablish network connections), couldn't we set user specific paths to explorer, by changing Shell in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\system.ini\boot from "SYS:Microsoft\Windows NT\CurrentVersion\Winlogon" to "USR:Software\Microsoft\Windows NT\CurrentVersion\Winlogon". Then create the Shell entry in that key for each user and point set them to explorer.exe. Except for your special MakeMeAdmin account, set it to the properly modified MakeMeAdmin.cmd.

Marc Poljak: storing the admin password in the file would defeat the purpose. i don't see any prob with using the savecred option to eleminate having to type in the password for the current user account though. it would be saved in the admin's credentials folder.

# re: MakeMeAdmin -- temporary admin for your Limited User account

Sunday, August 15, 2004 5:41 AM by Sean McLeod
Will the one issue with your approach is that any processes launched by the login scripts will now be running with the Admin token and not the regular user account in the admin group. Also the network connections will be established with the admin account.

So you'll have a mix of accounts which is what I was trying to avoid with the custom userinit approach.

# re: MakeMeAdmin -- temporary admin for your Limited User account

Sunday, August 15, 2004 7:45 AM by Marc Poljak
Will Brown: Yes, I know that storing a password in a plain text file is a very bad idea, but there are tools with which you can transform a BAT file into a EXE and then obfuscate the code in order to prevent the retrieval of the password via a hex editor. With a script like MakeMeAdmin you can launch a new command shell with elevated privileges or you can launch all kind of things through a logon script. This is useful if you do not have Group Policies and Active Directory at your disposal or an installed "agent" on the client, which runs under the local system account.

But, with the /SAVECRED option I have the result which I was looking for (well, not quite what I wished, but it works and that's important!). So, thank you for getting me on the right track.

Cheers,

Marc Poljak

# re: MakeMeAdmin -- temporary admin for your Limited User account

Monday, August 16, 2004 8:16 AM by Vittorio Pavesi
I experienced a similar problem with right delegation and I developed a little utility called MyRunAs that allow you to run a program impersonating another user (like Windows RunAs) but it generate an executable where there are the user credentials and the program name crypted.
Take a look on http://spazioinwind.libero.it/vittoriop/myprojects.html
Regards

Vittorio

# re: MakeMeAdmin -- temporary admin for your Limited User account

Monday, August 16, 2004 1:20 PM by Aaron Margosis
Sean McLeod - The first time I read your post about what I called "Scary User Switching" I misunderstood exactly what you were doing. I guess it might work - have you tried it?

Note that once you apply SAVECRED, the creds can be used with other apps as well, not just the one you specified.

# re: MakeMeAdmin -- temporary admin for your Limited User account

Tuesday, August 17, 2004 6:35 AM by Sean McLeod
Aaron, yes what I was proposing was really just a combination of your suggestions with hopefully the best benefits of both, i.e. using a separate admin account with FUS and using MakeMeAdmin to create a logon token that is a combination of your regular (LUA) in the admin group (call this your 'MakeMeAdmin' account, although it's not really a separate distinct user account).

So you end up with a separate desktop session and all the added security benefits that brings but at the same time instead of running processes in this desktop as the administrator account and the potential hassles that brings with network credentials, installing software etc. you run as your special 'MakeMeAdmin' account.

I'll test it out on a test machine in the next couple of days and let you know how it works, just a bit busy with some 'real' work ;-)

# re: MakeMeAdmin -- temporary admin for your Limited User account

Wednesday, August 18, 2004 5:44 PM by Great!
I was wondering what it would take make this into a SHell extension to create a kind of SUPER_Runas feature. Would be awesome to be able to right-click on an app/shortcut and run as any user elevated to Admin or poweruser etc.

# re: MakeMeAdmin -- temporary admin for your Limited User account

Wednesday, August 18, 2004 5:47 PM by Great!
I was wondering what it would take make this into a SHell extension to create a kind of SUPER_Runas feature. Would be awesome to be able to right-click on an app/shortcut and run as any user elevated to Admin or poweruser etc.

# Low-privileged accounts and non-Windows platforms

Sunday, August 29, 2004 1:40 PM by .net DElirium

# Will's Blog - Adventures of an IT Grad &raquo; Running as Limited User and Having temporary admin priveledges

Thursday, September 02, 2004 10:07 PM by TrackBack
Will's Blog - Adventures of an IT Grad &raquo; Running as Limited User and Having temporary admin priveledges

# Nerhood Weblog - Digital Diary - Family, Work, Technology, Books and Media &raquo; MakeMeAdmin &#8211; temporary admin for your Limited User account

Friday, September 03, 2004 4:48 PM by TrackBack
Nerhood Weblog - Digital Diary - Family, Work, Technology, Books and Media &raquo; MakeMeAdmin &#8211; temporary admin for your Limited User account

# reuteras.com &raquo; Bra verktyg f?r Windows

Sunday, September 05, 2004 4:04 PM by TrackBack
reuteras.com &raquo; Bra verktyg f?r Windows

# Take Me to Your Leader

Friday, September 17, 2004 2:06 PM by Misc. Ramblings
Whether you use Windows or Linux, each provides for the creation of users with different security privileges. That is, the ability to execute certain functions. In Windows, the highest level is Administrator and in Linux it's called root. For the purpose of this post, I'll concentrate on Windows for...

# I had more problems after switching

Thursday, September 23, 2004 2:40 AM by Martin's WebLog

# Windows Update and least privlege

Thursday, October 14, 2004 2:02 PM by Deep Thoughts...

# PrivBar - An IE/Explorer toolbar to show current privilege level

Monday, October 25, 2004 2:53 PM by Lockergnome's IT Professionals
Aaron Margosis is a Microsoft employee who is writing a weblog on running Windows with least privilege on the desktop. If you are having trouble running applications under an account with less privileges than administrator, there are many useful suggestions...

# Taking the Plunge

Friday, November 12, 2004 11:02 PM by Zupancic Perspective

# Taking the Plunge

Tuesday, November 16, 2004 4:56 PM by Zupancic Perspective

# RE: Das Henne-Ei Problem oder

Thursday, November 18, 2004 6:32 AM by Dirks WebLog

# Developing software for Windows without being an admin

Saturday, December 04, 2004 4:51 PM by Aali's blog

# Developing Non-Admin: File Ownership on Windows Server 2003

Monday, December 27, 2004 6:18 PM by Geek Noise

# How about a Shell Extension for MakeMeAdmin?

Wednesday, January 05, 2005 3:12 PM by Michael Howard's Web Log

# So that is what they were -- AntiSpyware Alerts

Thursday, January 13, 2005 4:49 PM by Robert Hurlbut's .NET Blog

# re: Misconceptions about Least Privilege

Wednesday, January 26, 2005 7:51 PM by .net DElirium

# Least-Privileged Users, Add/Remove Programs and System Management Server

Thursday, January 27, 2005 11:48 AM by strawberryJAMM's Security and User Experience WebL

# Enterprise Library 2005 available

Friday, January 28, 2005 11:45 PM by Robert Hurlbut's .NET Blog

# MakeMeAdmin -- temporary admin for your Limited User account

Sunday, January 30, 2005 8:40 AM by David Christiansen's Weblog

# Running as a non-Administrator

Monday, January 31, 2005 3:43 PM by Casa d

# Running as a non-Administrator

Monday, January 31, 2005 3:45 PM by Casa d

# Low-privileged accounts and non-Windows platforms

Friday, February 04, 2005 3:47 PM by .net DElirium

# Managing Power Options as a non-administrator

Wednesday, February 09, 2005 11:58 PM by Aaron Margosis' WebLog

# Running as non-admin

Thursday, February 10, 2005 11:24 PM by Wes' Puzzling Blog

# chris.webdevlab.com &raquo; The Non-Admin Blog

Tuesday, February 15, 2005 9:48 AM by TrackBack
chris.webdevlab.com &raquo; The Non-Admin Blog

# re: Making life as a LUser more livable

Tuesday, March 01, 2005 12:43 PM by blog://brycem@microsoft.com

# More Great Non-Admin Resources

Tuesday, March 01, 2005 10:23 PM by Geek Noise

# MakeMeAdmin follow-up

Friday, March 11, 2005 3:48 PM by Aaron Margosis' WebLog
MakeMeAdmin script updates, and a security setting you should change

# Table of contents, Aaron Margosis' non-admin blog

Monday, April 18, 2005 8:22 PM by Aaron Margosis' WebLog
Complete list of Aaron Margosis' non-admin / least privilege posts, for easy lookup.

# Running with a clean machine as non-admin

Monday, May 02, 2005 8:26 PM by John Watson

# Installing .inf files if you are living the non-admin lifestyle

Monday, May 30, 2005 11:23 AM by Jason Haley
Installing .inf files if you are living the non-admin lifestyle

# re: MakeMeAdmin -- temporary admin for your Limited User account

Sunday, June 05, 2005 4:23 PM by Yang
I learn something usefull today!

# Spread the LUA joy

Friday, June 10, 2005 12:12 PM by tonyso
Get your friends and family, all those folks that come to you for computer help once their machines have...

# Software I have on my computer

Wednesday, June 15, 2005 2:57 PM by venkatna's WebLog
I got a shiny new tablet (Toshiba M4) and spent some time installing all the software that I usually...

# Need Security? - Running Windows with Least Privilege!

Tuesday, July 05, 2005 12:11 PM by Daniel van Soest
Ok, ik heb vandaag wat sessies gevolgd over de security improvements in het Longhorn timeframe en hoe...

# MakeMeAdmin -- temporary admin for your Limited User account

Sunday, July 10, 2005 6:59 PM by David Christiansen
Very handy tool for those of us that rightly develop under the 'least privileged' user context.

MakeMeAdmin...

# MakeMeAdmin -- temporary admin for your Limited User account

Sunday, July 10, 2005 6:59 PM by David Christiansen
Very handy tool for those of us that rightly develop under the 'least privileged' user context.

MakeMeAdmin...

# Least privileged user access for developers

Friday, July 29, 2005 5:55 PM by Nigel Watling
OK, the last entry was a teaser for a blog entry or two on what developers can and IMHO should do regarding...

# Switching Source Code Control Providers as Non-Administrative User

Sunday, July 31, 2005 10:47 PM by Zupancic Perspective

# Running with a clean machine as non-admin

Thursday, August 18, 2005 1:08 PM by John Watson

# re: MakeMeAdmin -- temporary admin for your Limited User account

Thursday, August 25, 2005 4:03 PM by ken
Anyone know how to gain Administrative Privilages with a Limited Account if you don't know the password?

# Links

Monday, September 05, 2005 2:52 PM by Murat Uysal

# Links

Monday, September 05, 2005 2:54 PM by Murat Uysal

# Smart Client - Windows Forms

Monday, September 05, 2005 4:01 PM by Murat Uysal

# re: MakeMeAdmin -- temporary admin for your Limited User account

Saturday, November 05, 2005 3:46 PM by Matt
How can you get around typing in the local administrator password?

# re: MakeMeAdmin -- temporary admin for your Limited User account

Tuesday, November 15, 2005 9:30 PM by vxcyvxv
Simply not?

Well, there's another way to get this working without needing to pass any password at all.

Let run a priviledged service which accepts requests from users to spawn a certain process, but only if it is on a whitelist - just like suid-Bit under Linux.

There's are two alternatives known: SuSrv+SrvAny with two instances, and the commercial (free for personal use) PolicyMaker Application Security, which allows a certain fine tuning on what access should be actually granted.

# re: MakeMeAdmin -- temporary admin for your Limited User account

Friday, January 20, 2006 4:26 PM by Paul Blair
This little utility inspired me to write a service based app that allows you to launch any program as yourself with an admin token. If anyone want's to try it out and comment, you can grab it here....

http://home.toadlife.net/blog/weblog.pl?trackback=1

Thanks Aaron. :)

# re: MakeMeAdmin -- temporary admin for your Limited User account

Tuesday, January 31, 2006 6:57 AM by Archos
it does'nt work with me...it's asking for admin password which i don't know.

# re: MakeMeAdmin -- temporary admin for your Limited User account

Tuesday, January 31, 2006 12:13 PM by Aaron Margosis
Archos - that is correct. You need to have the admin password in order to do this. Otherwise it would be an unauthorized elevation of privilege!

# re: MakeMeAdmin -- temporary admin for your Limited User account

Wednesday, February 01, 2006 12:17 PM by Mike
Not sure what I'm doing wrong, but running this gives me an error after entering the first local admin password:


Enter the password for ADMINCOMP\Administrator:
Attempting to start C:\DOCUME~1\MSMITH~1.DOM\Desktop\MakeMeAdmin.cmdkeMeAdmin.cm
d DOMAIN\msmith as user "ADMINCOMP\Administrator" ...
RUNAS ERROR: Unable to run - C:\DOCUME~1\MSMITH~1.DOM\Desktop\MakeMeAdmin.cmdkeM
eAdmin.cmd DOM\msmith
87: The parameter is incorrect.

# re: MakeMeAdmin -- temporary admin for your Limited User account

Wednesday, February 01, 2006 12:39 PM by Mike
Well running it from the root of the c drive works fine. Seems as though it just refuses to run properly from the desktop.

# re: MakeMeAdmin -- runas Doesn't work with password in RTL language

Monday, February 06, 2006 1:22 PM by Yinon Ehrlich
I cannot use your batch-files, nor a simple runas.exe.
My administrator user name and password are in Hebrew. Moreover, the Administrator user name consists of more than one word. All of this is fine for me, it make me feel more secure and it works with "Shift-right-click-run-as".
But: runas does not accepts it. (I'm using Windows XP Home Ed. SP2).
Anyone has a suggestion ?

Thanks

# More LUA

Wednesday, February 08, 2006 8:33 PM by Wintellog

# More LUA

Wednesday, February 08, 2006 8:37 PM by Wintellog

# re: MakeMeAdmin -- temporary admin for your Limited User account

Friday, February 24, 2006 9:24 AM by Vatroslav Mihalj
Try using quoatation marks for domain accounts, to avoid interpreting "\" as directory separator in batch scripts

# re: MakeMeAdmin -- temporary admin for your Limited User account

Friday, February 24, 2006 9:44 AM by Aaron Margosis
Vatroslav Mihalj - I'm not sure what problem you're trying to solve.  The script should already have quotes in the correct places - see where "%*" is used in the second part of the script.

# re: MakeMeAdmin -- temporary admin for your Limited User account