May 7, 2013

Automating Remote Microsoft Management Console (MMC) – It’s Simple!


While running a remote MMC Snap-In is useful, automating it is bliss! Session Macros/Scripts/Tools will do the job, configure once and run the MMC against any of your servers.

Here's how you do it:


1. Create the session tool via: Edit -> New Entry -> Add Macro/Script/Tool

2. Select: “Command Line”

3. Name: “DHCP”

4. Run: “dhcpmgmt.msc /ComputerName $HOST$” (see notes below)
  • Note: if you only put “dhcpmgmt.msc” in the run textbox and hit “Assign file icon to session,” the dhcpmgmt.msc icon will be assigned
  • Note: Passing the host name can be tricky, as some Snap-Ins require different parameter formatting. For example: /Computer=$HOST$ or /ComputerName $HOST$

5. Select: “Run as Administrator”

6. Select: “Open embedded/tabbed” (see note below)
  • Note: Embedding the console works with most Snap-Ins

Next, double-check your sessions. They must be configured to feed the proper credentials to the session tool. On the Tools tab of each session, make sure you’ve selected the proper credentials to be supplied:



  • Use default credentials = send nothing and let Windows figure things out
  • User session credentials = use the same credentials as the session
  • Use custom credentials = use specific credentials
  • Use credential repository = specify a set of credentials from the repository



To run the Snap-In, select your session and locate the tool in the dashboard.  If everything is configured properly, a simple click is all you need!

We hope this gives you a helpful new way to manage your day-to-day workload, and make your life simpler and more efficient. If you have other great tips on using session macros/scripts/tools that we can share with the community, please let us know! 

5 comments:

  1. I tried to launch remote MMC snap-in this way, but it launches the local snap-ins rather than the remote? I have double checked the credentials and tried using different settings. Any ideas? Thanks.

    ReplyDelete
    Replies
    1. Not all snap-ins support remote management. Please contact us at support@devolutions.net

      Delete
    2. This comment has been removed by the author.

      Delete
    3. runas /netonly /user:contoso\First.Last "mmc dhcpmgmt.msc"
      This works for prompting user credentials and opening the snap in. btw, most snapin's require calling 'mmc' first then passing the msc.
      What I can not figure out is cli switches for dhcpmgmt.msc to 'add server' rather than using authored msc previously created. Ideas?

      Delete
    4. The clarifications are on the technet site : http://social.technet.microsoft.com/Forums/windowsserver/en-US/8feb2232-3a21-4b56-88b6-04036b984864/dhcpmgmtmsc-parameters?forum=winserverNIS

      You must either configure your snap-in and save the console, or use the command line to perform the task you wanted to run in the console.

      Delete