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:
- Install the adminpak.msi file off your server CD onto your workstation PC.
- 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 "mmc C:WINDOWSsystem32dsa.msc" GOTO END
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
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