11Apr06 Using control panel applications
We have several users at the office who do not have administrator rights to their computers (this is for several reasons) but once in a while we have to make some changes which require an administrator-level account. Up to this point we follow the same routine, they log off, I log on using an admin account, make the changes, log off and let the user log back to their machine. Pretty disruptive routine if you ask me.
I asked a couple of colleagues who are deeply involved with managing Windows systems for a solution to this problem. There has to be a way to invoke the control panel applications, or any part of the Windows operating system, with the appropriate permissions — just like if I was logged in with the appropriate account. Of course there is a solution, after all I am not the only doing this kind of thing.
The solution is the runas command which allows you to invoke a program or process using the credentials of a different account. I attempted to run the control panel from the command line runas /u:admin_account "control" however that did not work as I expected it, I could not launch the control panel this way.
Shortly there after, I received another email from one of our tech guys who is also a MS MVP and he had the solution to my problem. I have to launch a command line window with the admin rights first, then I can use this console to launch the appropriate control panel applet. To launch the console window with admin rights I execute this command: runas /u:admin_account cmd and enter the appropriate password when prompted. I can execute the control applets under the admin account.
Here is an entry from the MS knowledgebase which describes some more of the control applets and their filenames. Now, we don’t have to do the whole log off - log on dance every time we need to make a configuration change to these machines. Thanks guys for the help.
12Apr06
8:40am
Very cool! And very useful! Thanks for posting this!