Building Custom MMCs

If you find that the existing console tools don't meet your needs or you want to create your own administration tool with the features you choose, you can build your own custom console tools. This allows you to determine which features the console includes, which snap-ins it uses, and which additional commands are available.

The steps for creating custom console tools are as follows:

  1. Create the console for the tool.

  2. Add snap-ins to the console. Snap-ins you use can include Microsoft console tools as well as console tools from third-party vendors.

  3. When you are finished with the design, save the console in user mode so that it is ready for use.

Each step is examined in detail in the sections that follow. Optionally, you can create one or more taskpad views containing shortcuts to menu commands, shell commands, and navigation components that you want to include in your custom tool. Techniques for creating taskpad views are discussed in the section entitled "Designing Custom Taskpads for the MMC" later in this chapter.

Step 1: Creating the Console

The first step in building a custom console tool is to create the console that you'll use as the framework. To get started, open a blank MMC in author mode. Click Start, select Run, type mmc in the Open box, and then click OK. This opens a blank console titled Console1 that has a default console root as shown in Figure 11-5.

A blank console with the default console root

Figure 11-5. A blank console with the default console root

If you want your custom tool to be based on an existing console, you can open its .msc file and add it to the new console. Select Open on the File menu, and then use the Open dialog box to find the .msc file you want to work with. As discussed previously, most .msc files are in the %SystemRoot%System32 directory. Any existing console you choose will open in author mode automatically. Keep in mind that you generally don't want to overwrite the existing .msc file with the new .msc file you are creating. Because of this, when you save the custom console, be sure to choose Save As rather than Save on the File menu.

If you want to start from scratch, you'll work with the blank console you just opened. The first thing you'll want to do is rename the console root to give it and the related window a more meaningful name. For example, if you are creating a console tool to help you manage the Active Directory directory service, you could rename the console root Active Directory Management. To rename the console root and the related window, right-click the console root, and select Rename. Type the name you want to use, and then press Enter.

The next thing you'll want to do is to consider how many windows the console tool must have. Most console tools have a single window, but as shown in Figure 11-6, a console can have multiple windows, each with its own view of the console root. You add windows to the console by using the New Window option on the Window menu. After you add a window, you'll probably want the MMC to automatically tile the windows as shown in the figure. You can tile windows by selecting Tile Horizontally on the Window menu. You don't have to do this, however; anytime there are multiple windows, you can use the options on the Window menu to switch between them.

Although consoles can have multiple windows, most consoles have a single window

Figure 11-6. Although consoles can have multiple windows, most consoles have a single window

Step 2: Adding Snap-Ins to the Console

While you are thinking about the organization of the tool and the possibility of using additional views of the console root, you should also consider the types of snap-ins that you want to add to the console. Each of the tools listed in Table 11-1 is available as a stand-alone snapin that you can add to the console. If you've installed any third-party tools on the computer, these tools might have stand-alone snap-ins that you can use. Many other snap-ins are available from Microsoft as well.

Again, think of snap-in types or categories, not necessarily specific snap-ins that you want to use. You might want to organize the snap-ins into groups by creating folders for storing snapins of a specific type or category. For example, if you are creating a console tool for managing Active Directory, you might find that there are four general types of snap-ins that you want to work with: General, Policy, Security, and Support. You would then create four folders in the console with these names.

Folders are implemented as a snap-in that you add to the console root. To add folders to the console root, follow these steps:

  1. Choose Add/Remove Snap-In from the File menu in the main window. As shown in Figure 11-7, you must now choose where to add the snap-in. At this point, it is possible only to add the snap-in to the console root (which is now called Active Directory Management or whichever other name you used), but after you add folders, you can add snap-ins to a folder below the console root by selecting it in the Snap-Ins Added To list.

    Choose where to add the snap-in

    Figure 11-7. Choose where to add the snap-in

  2. Choose Add, which displays the Add Standalone Snap-In dialog box. Note that this dialog box is set so that you can see the previous dialog box as well. This is important because when you add snap-ins they appear in the Add/Remove Snap-In list.

  3. The Available Standalone Snap-Ins list shows all the snap-ins that are available. Scroll through the list until you see the Folder snap-in, as shown in Figure 11-8. Click Folder, and then choose Add. The Folder snap-in is added to the list of snap-ins in the Add/ Remove Snap-In dialog box. Repeat this for each folder that you want to use. If you are following the example and want to use four folders, you would click Add three more times so that four Folder snap-ins appear in the Add/Remove Snap-In dialog box.

    When you add a snap-in in the Add Standalone Snap-In dialog box, it appears on the Add/Remove Snap-In list

    Figure 11-8. When you add a snap-in in the Add Standalone Snap-In dialog box, it appears on the Add/Remove Snap-In list

  4. Now close the Add Standalone Snap-In dialog box by clicking Close, and return to the Add/Remove Snap-In dialog box. You'll see the folders you've added. Click OK to close this dialog box and return to the console you are creating.

After you add folders, you must rename them. Right-click the first folder, and choose Rename. Type a new name, and then press Enter. If you are following the example, rename the folders: General, Policy, Security, and Support. When you are finished renaming the folders, follow a similar process to add the appropriate snap-ins to your console:

  1. Choose Add/Remove Snap-In on the File menu in the main window.

  2. In the Snap-Ins Added To list, choose the folder to use, and then click Add.

  3. Use the Add Standalone Snap-Ins dialog box to add snap-ins to the selected folder.

  4. When you are finished, click Close to return to the Add/Remove Snap-In dialog box. You'll find the snap-ins you've chosen are added to the designated folder.

  5. If you want to work with a different folder, select the folder in the Snap-Ins Added To list, and repeat steps 2 to 4.

  6. When you are finished adding snap-ins to folders, click OK to close the Add/Remove Snap-In dialog box and return to the console you are creating.

Some snap-ins prompt you to select a computer to manage, as shown in the following screen:

image with no caption

If you want the snap-in to work with whichever computer the console is running on, select Local Computer. Otherwise, select Another Computer, and then type the computer name or IP address of the computer you want to use. If you don't know the computer name or IP address, click Browse to search for the computer you want to work with.

Tip

Specify which computer to manage

To ensure you can specify which computer to manage when running the console from the command line, you must select the Allow The Selected Computer To Be Changed option. When you use this option and save the console, you can set the computer to manage using the /Computer=RemoteComputer parameter.

Some snap-ins are added by using wizards with several configuration pages, so when you select these snap-ins you start the associated wizard and the wizard helps you configure how the snap-in is used. One snap-in in particular that uses a wizard is Link To Web Address. When you add this snap-in, you start the Link To Web Address Wizard, as shown in the screen on the following page, and the wizard prompts you to create an Internet shortcut. Here, you type the Uniform Resource Locator (URL) you want to use, click Next, enter a descriptive name for the URL, then click Finish. Then, when you select the related snap-in in the console tree, the designated Web page appears in the details pane.

image with no caption

While you are adding snap-ins, you can also examine the available extensions for snap-ins. In the Add/Remove Snap-In dialog box, click the Extensions tab, then use the Snap-Ins That Can Be Extended list to choose the snap-in that you want to work with. All available extensions are enabled by default, as shown in the following screen. So, if you want to change this behavior, you can clear the Add All Extensions option and then clear the individual options for extensions you want to exclude.

image with no caption

Figure 11-9 shows the example console with snap-ins organized using the previously discussed folders:

  • General Containing Active Directory Users and Computers, Active Directory Sites and Services, and Active Directory Domains and Trusts

  • Policy Containing Local Computer Policy, Resultant Set of Policy, and Default

  • Domain Policy

  • Security Containing Security Templates and Security Configuration and Analysis

  • Support Containing links to Microsoft Knowledge Base, Microsoft Tech Support, and Windows Server Home Page

A custom console with snap-ins organized into four folders

Figure 11-9. A custom console with snap-ins organized into four folders

Step 3: Saving the Finished Console

When you are finished with the design, you are ready to save your custom console tool. Before you do this, however, there are a couple of final design issues you should consider:

  • What you want the initial console view to be

  • Which user mode you want to use

  • Which icon you want to use

  • What you want to name the console tool and where you want it to be located

Setting the Initial Console View Before Saving

By default, the MMC remembers the last selected node or snap-in and saves this as the initial view for the console. In the example tool created, if you expand the General folder, select Active Directory Users and Computers, and then save the console, this selection is saved when the console is next opened.

Keep in mind that subsequent views depend on user selections. To prevent user selections from changing the view, you'll find two handy options when you select Options from the File menu:

  • Do Not Save Changes To This Console Select this option to prevent the user from saving changes to the console. Clear this option to change the view automatically based on the user's last selection in the console before exiting.

  • Allow Users To Customize Views Select this option to allow users to add windows focused on a selected item in the console. Clear this option to prevent users from adding customized views.

Note

Only the folder with the selected snap-in is expanded in the saved view. If you use folders and select a snap-in within a folder, the expanded view of the folder is saved with the snap-in selected. If you expand other folders, the console is not saved with these folders expanded.

Setting the Console Mode Before Saving

When you are finished authoring the console tool, select Options on the File menu. In the Options dialog box, as shown in the screen on the following page, you can change the console mode so that it is ready for use.

In most cases, you'll want to use User Mode—Full Access. Full access has the following characteristics:

  • Users have a Window menu that allows them to open new windows, and they can also right-click a node or snap-in and choose New Window From Here to open a new window.

  • Users can right-click and choose New Taskpad View to create a new taskpad view.

With user mode set to Limited Access, Multiple Window, the console has the following characteristics:

  • Users have a Window menu that allows them to arrange windows, and they can also right-click a node or snap-in and choose New Window From Here to open a new window.

  • Users cannot right-click and choose New Taskpad View to create a new taskpad view.

User mode set to Limited Access, Single Window has the following characteristics:

  • Users do not have a Window menu and cannot right-click a node or snap-in and choose New Window From Here to open a new window.

  • Users cannot right-click and choose New Taskpad View to create a new taskpad view.

    image with no caption

Setting the Console Icon Before Saving

While you are working in the Options dialog box, you might consider setting custom icons for your console tools. All the console tools developed by Microsoft have their own icons. You can use these icons for your console tools as well, or you could use icons from other Microsoft programs quite easily. In the Options dialog box (which is displayed when you select Options on the File menu), click Change Icon. This displays the Change Icon dialog box, as shown in the following screen:

image with no caption

In the Change Icon dialog box, click Browse. By default, the Open dialog box should open with the directory set to %SystemRoot%System32. In this case, type shell32.dll as the File Name, and click Open. You should now see the Change Icon dialog box with the Shell32.dll selected, which will allow you to choose one of several hundred icons registered for use with the operating system shell (see the following screen). Choose an icon, and then click OK. From then on, the icon will be associated with your custom console tool.

image with no caption

Saving the Console Tool to the Desktop, the Start Menu, or a Folder

After you set the user mode, you can save the console tool. The console tool can appear as one of the following:

  • A desktop icon Select Save As on the File menu, and then navigate the folder structure to %SystemRoot%Documents and Settings\%UserName%Desktop. Here, %UserName% is the name of the user who will work with the tool or All Users if all users with an account on the computer should be able to run the tool. After you type a name for the console, click Save.

  • A menu option of the Start menu Select Save As on the File menu, and then navigate the folder structure to %SystemRoot%Documents and Settings\%UserName%Start MenuProgramsAdministrative Tools. Here, %UserName% is the name of the user who will work with the tool or All Users if all users with an account on the computer should be able to run the tool. After you type a name for the console, click Save.

  • A folder icon Select Save As on the File menu, and then navigate to the folder where you want the console tool to reside. After you type a name for the console, click Save.

Tip

Change tool names using the Options dialog box

By default, the name shown on the console tool's title bar is set to the file name you designate when saving it. As long as you are in author mode, you can change the console tool name using the Options dialog box. Select Options on the File menu, and then type the name in the box provided at the top of the Console tab.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset