Run admin tools from a desktop

Every administrator knows that it is bad etiquette to add their own username to the domain admin group. However, it can be tempting to do so in order to run common administrative tasks from your PC. With the following batch file, you will be prompted for the domain admin password, but you will act as a standard user while running administrative tools at your desktop.

Start the process with these first two steps:


  1. Install the adminpak.msi file off your server CD onto your workstation PC.
  2. Get the 'choice.exe' file off the Win2k resource kit and put in the same directory as the script below. It will work in a Win2k3 or Win2k domain.

In the following script, replace [domain] with your domain name:


 @echo off @echo :BEGIN CLS echo. echo. "What would you like to work on today master?" echo. echo. @echo off echo 1 = "Users & Computers" echo 2 = "AD SItes and Services" echo 3 = "AD Domains and Trusts" echo 4 = DNS echo 5 = DHCP echo 6 = "Group Policy" echo 7 = Quit CHOICE /N /C:1234567 PICK A NUMBER (1, 2, 3, 4, 5, 6, or 7)%1 REM - THE NEXT THREE LINES ARE DIRECTING USER DEPENDING UPON INPUT IF ERRORLEVEL ==7 GOTO SEVEN IF ERRORLEVEL ==6 GOTO SIX IF ERRORLEVEL ==5 GOTO FIVE IF ERRORLEVEL ==4 GOTO FOUR IF ERRORLEVEL ==3 GOTO THREE IF ERRORLEVEL ==2 GOTO TWO IF ERRORLEVEL ==1 GOTO ONE
:one runas /user:[domain]Administrator

Requires Free Membership to View

"mmc C:WINDOWSsystem32dsa.msc" GOTO END
:two runas /user:[domain]Administrator "mmc C:WINDOWSsystem32dssite.msc" GOTO END
:three runas /user:[domain]Administrator "mmc C:WINDOWSsystem32domain.msc" GOTO END
:four runas /user:[domain]Administrator "mmc C:WINDOWSsystem32dnsmgmt.msc" GOTO END
:five runas /user:[domain]Administrator "mmc C:WINDOWSsystem32dhcpmgmt.msc" GOTO END
:six runas /user:[domain]Administrator "mmc C:WINDOWSsystem32gpmc.msc" GOTO END
:seven GOTO END
:END exit

Please let us know how useful you find this tip by rating it below! If you have a useful Windows tip, timesaver or workaround to share, submit it to our tip contest and you could win a prize!

This was first published in August 2006

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.