« The Japan Page has moved... | New Photo Gallery - The Atomic Dome (Genbaku Dome) in Hiroshima, Japan »

Sample Script - Runas MMC

I've just about completed a 2500 user Exchange 5.5 to 2003 migration (you'd be surprised how many laggards are still using Exchange 5.5). One of the challenges was quickly logging into several different AD domains to perform account maintenance.

Since Windows 2000 the "run as" feature has greatly simplified this, but you still have to click SHIFT while right clicking the icon. What if I'm too lazy? Write a batch script, of course.

So, here's a sample script to fire off a custom MMC console with one double click.

1. Create the console and save it. I give mine a specific name like NTDOMAIN_ADUC.msc and save them under c:\batch\runas .
2. Create a NTDOMAIN_ADUC.cmd script, copy the sample code below in and change it for your login.
3. Create a shortcut from the script to your desktop or quicklaunch toolbar.
4. You're done !

You could embed your domain password in the script, but I prefer to be promtped. That way when I change my password every 14 days (yah, right!) I don't have to touch the script.

You can create your own ASCII art on http://www.network-science.de/ascii/

This batch script has been tested on Windows 2000, XP and 2003.


::REM ---- Begin sample script ---
::REM Windows XP / 2000 / 2003 sample batch script "Runas MMC"
::REM By John D. Seaman, www.japan-page.net/batch

@echo off
cls

::REM ASCII art generator on the web @ http://www.network-science.de/ascii/
(Remember to neutralize the command characters with a "^".

echo _____ __ __ __ __ _____
echo ^| __ \ /\ ^| \/ ^| \/ ^|/ ____^|
echo ^| ^|__) ^| _ _ __ / \ ___ ^| \ / ^| \ / ^| ^|
echo ^| _ / ^| ^| ^| '_ \ / /\ \ / __^| ^| ^|\/^| ^| ^|\/^| ^| ^|
echo ^| ^| \ \ ^|_^| ^| ^| ^| ^|/ ____ \\__ \ ^| ^| ^| ^| ^| ^| ^| ^|____
echo ^|_^| \_\__,_^|_^| ^|_/_/ \_\___/ ^|_^| ^|_^|_^| ^|_^|\_____^|
echo.
echo R u n A s M M C S a m p l e S c r i p t
echo www.japan-page.net/batch

cd c:\windows\system32
runas /user:NTDomain\UserID "%windir%\System32\mmc.exe C:\batch\runasMMC\NTDOMAIN_ADUC.msc"

exit
::REM ---- End sample script ---

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)