Exploring WMI Classes
A WMI class defines a WMI-managed object such as a file share, a disk file, etc. All WMI classes live within a namespace. WMI classes, like .NET classes, contain members that include properties, methods, and events. An example class is Win32_Share
, which you find in the root\CIMV2
namespace. This class defines an SMB share on a Windows host. Within WMI, the Win32
WMI provider implements this class (along with multiple other OS and host-related classes).
As mentioned, you typically use the SMB cmdlets to manage SMB shares (as discussed in Chapter 8, Managing Shared Data, including the Creating and securing SMB shares recipe). Likewise, you carry out most AD management activities using AD cmdlets rather than accessing the information via WMI. Nevertheless, you can do things with WMI, such as event handling, that can be very useful to the IT professional.
A WMI class contains one or more properties that are attributes of an occurrence of a WMI class. Classes...