Understanding Windows Management Instrumentation


Windows Management Instrumentation (WMI) is Microsoft's implementation of Webbased Enterprise Management (WBEM) that is intended to create a standard for the management of the Windows networking environment. Although Microsoft has various initiatives relative to enterprise network management, WMI in the context of group policies typically refers to two things: one is the use of WMI scripts, and the other is the use of WMI filtering.

Using WMI Scripting

Although Group Policy can automate a number of tasks in a Windows networking environment, there are many things that it cannot do. When a group policy cannot be used, typically a WMI script can be used to complete the task. Such tasks include the following:

  • Moving files from one folder to another on the network

  • Deleting a file or list of files from the network

  • Automating the process of installing a new network printer

  • Automating the process of adding a user account and user profile to the network

Typically, when a network administrator hears the term scripting, he immediately begins to think about Visual Basic programming and application coding. However, if you can cut, paste, copy, and edit text information, you can effectively use WMI scripts for group policies.

Microsoft provides hundreds of predefined scripts that can be copied and pasted into a group policy. In the Windows Script Development Center at http://msdn.microsoft.com/library/default.asp?url=/nhp/Default.asp?contentid=28001169, there are samples of scripts that can be copied, pasted, and then edited to create fully functional scripts. As an example, the following script adds domain users into groups. By simply editing "fabrikam" with the name of your domain, and editing the cn (common names) and ou (organization units) names and OUs in your organization, you can use this script to automate a process that might otherwise take you a few seconds to do manually. A few seconds multiplied by hundreds of adds, moves, and changes to a network can add up to significant time savings over the course of a month or year.

Const ADS_PROPERTY_APPEND = 3 Set objGroup = GetObject _   ("LDAP://cn=Sea-Users,cn=Users,dc=NA,dc=fabrikam,dc=com") objGroup.PutEx ADS_PROPERTY_APPEND, "member", _     Array("cn=Scientists,ou=R&D,dc=NA,dc=fabrikam,dc=com", _       "cn=Executives,ou=Management,dc=NA,dc=fabrikam,dc=com", _       "cn=MyerKen,ou=Management,dc=NA,dc=fabrikam,dc=com") objGroup.SetInfo 


Some organizations have extended scripting to automate an employee account creation process. Rather than manually creating a user, manually adding the user into groups, manually creating an email address, a phone number, and other user information, a script can be linked to an OU such that every time a user is created in an OU, the properties for that user are automatically created and associated to the user.

Using WMI Filters

WMI filters allow an administrator to specify a WMI-based query to filter the effect of a Group Policy Object in the WMI object database. As an example, a WMI filter can look for certain group membership assignments for a user, and based on the user's group membership, apply a script as appropriate.

Adding a New WMI Filter to a Group Policy Object

To add or delete a new WMI filter to a Group Policy Object, perform the following steps:

1.

Open Active Directory Users and Computers.

2.

Right-click the domain or OU for which you want to set a group policy.

3.

Click Properties and then click the Group Policy tab.

4.

Click an entry in the Group Policy Object links and then click Properties.

5.

Click the WMI Filter tab.

6.

Click This Filter and then click Browse/Manage.

7.

Click Advanced.

8.

Click on New to add information about any new filters or click Delete to remove a filter. Then click OK.

Importing to and Exporting from a Group Policy Object

To import to or export from a Group Policy Object, perform these steps:

1.

Open Active Directory Users and Computers.

2.

Right-click the domain or OU for which you want to set a group policy.

3.

Click Properties and then click the Group Policy tab.

4.

Click an entry in the Group Policy Object links and then click Properties.

5.

Click the WMI Filter tab.

6.

Click This Filter and then click Browse/Manage.

7.

Click Advanced. Then click Import to import, or click the filter in the list you want to export and click Export. Finally, click OK.

When you're importing, select an MOF file that contains the WMI filter or filters you want to import.




Microsoft Windows Server 2003 Unleashed(c) R2 Edition
Microsoft Windows Server 2003 Unleashed (R2 Edition)
ISBN: 0672328984
EAN: 2147483647
Year: 2006
Pages: 499

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net