Running as non-admin

After setting up my new domain recently I decided I would finally try to run as non-admin. Currently I'm a normal user.

There is however those times where you need to run as admin. To run applications you could use the MakeMeAdmin utility. However I prefer to use Run++. It allows you to run an executable as another user (i.e. Administrator). You can setup a custom command and then provide it the username and/or password then whenever you run that command it will run that command under the given user context. Run++ accomplishes this by simply using the new options on the ProcessStartInfo in the .NET Framework 2.0 which allows you to pass user credentials (underneath the hood it makes a call to CreateProcessWithLogonW with the given credentials).

By doing this I don't have to type the administrator username and password every time I want to start a program as administrator. FYI the password is encrypted using the new ProtectedData class which uses DPAPI and by using the DataProtectionScope.CurrentUser scope the the password can only be decrypted by the user that created it.

Currently I only have a command prompt that is setup to run as administrator that way I can just do any other work I need from there.

No Comments