List of Samples


Chapter 1: The Windows WMI Providers Discovery

Sample 1.1: Locating WMI provider registration instances with their supported classes (Part I)
Sample 1.2: Locating WMI Provider registration instances with their supported classes (Part II)
Sample 1.3: Locating WMI provider registration instances with their supported classes (Part III)
Sample 1.4: Listing a single instance of a class with its properties formatted
Sample 1.5: Listing all instances of a class with their properties formatted
Sample 1.6: The DisplayFormattedPropertyFunction.vbs function.:

Chapter 2: The Win32 Providers

Sample 2.1: Determine if a mouse is right or left hand configured
Sample 2.2: Alerting script when the free disk space decreases below 50 percent on a specific disk
Sample 2.3: Executing CHKDSK via WMI
Sample 2.4: Retrieving hardware resource information (Part I)
Sample 2.5: Retrieving hardware resource information (Part II)
Sample 2.6: Retrieving hardware resource information (Part III)
Sample 2.7: Retrieving hardware resource information (Part IV)
Sample 2.8: Retrieving network device information (Part I)
Sample 2.9: Retrieving network device information (Part II)
Sample 2.10: Retrieving network device information (Part III)
Sample 2.11: Retrieving network device information (Part IV)
Sample 2.12: Configuring a network adapter (Part I)
Sample 2.13: Configuring a network adapter (Part II)
Sample 2.14: Retrieving battery information
Sample 2.15: Retrieving modem information
Sample 2.16: Managing the printer drivers, the printers, and their related print jobs (Part I)
Sample 2.17: Viewing printer drivers, printers, and job information (Part II)
Sample 2.18: Adding printers and printer connections (Part III)
Sample 2.19: Deleting, managing (test page, pause, resume, etc.) and renaming printers (Part IV)
Sample 2.20: Adding and deleting printer drivers (Part V)
Sample 2.21: Managing printer jobs (pause, resume, and delete) (Part VI)
Sample 2.22: Retrieving the desktop monitor information
Sample 2.23: Retrieving the video adapter information
Sample 2.24: Locating the WMI provider registration instances with their COM information
Sample 2.25: Retrieving DCOM application settings
Sample 2.26: Reading, creating, updating, and deleting environment variables (Part I)
Sample 2.27: Reading environment variables (Part II)
Sample 2.28: Creating environment variables (Part III)
Sample 2.29: Updating environment variables (Part IV)
Sample 2.30: Deleting environment variables (Part V)
Sample 2.31: Gathering disk partition, disk drive, and logical disk information (Part I)
Sample 2.32: Gathering disk partition information (Part II)
Sample 2.33: Gathering disk drive information (Part III)
Sample 2.34: Gathering logical disk information (Part IV)
Sample 2.35: Watching a file size
Sample 2.36: Copying, renaming, deleting, (un)compressing, and taking ownership of files and directories.
Sample 2.37: Viewing, creating, updating, and deleting page files (Part I)
Sample 2.38: Viewing page files (Part II)
Sample 2.39: Creating page files (Part III)
Sample 2.40: Updating page files (Part IV)
Sample 2.41: Deleting page files (Part V)
Sample 2.42: Retrieving network device information (Part V)
Sample 2.43: Configuring the Operating System (Part I)
Sample 2.44: Viewing various Operating System properties (Part II)
Sample 2.45: Viewing Operating System QFE (Part III)
Sample 2.46: Joining and unjoining a domain or workgroup, and renaming a workstation (Part IV)
Sample 2.47: Time zone, daylight savings, and startup options (Part V)
Sample 2.48: The Operating System recovery parameters (Part VI)
Sample 2.49: Setting application time slice, date and time, and rebooting the Operating System (Part VII)
Sample 2.50: Viewing, creating, and killing processes (Part I)
Sample 2.51: Viewing processes (Part II)
Sample 2.52: Creating processes (Part II)
Sample 2.53: Killing processes (Part IV)
Sample 2.54: Viewing, creating, and killing processes (OnObjectReady sink routine) (Part V)
Sample 2.55: Viewing, creating, and killingprocesses (On Completed sink routine) (Part VI)
Sample 2.56: Viewing, creating, and deleting scheduled jobs (Part I)
Sample 2.57: Viewing the scheduled jobs (Part II)
Sample 2.58: Creating scheduled jobs (Part III)
Sample 2.59: Deleting scheduled jobs (Part IV)
Sample 2.60: Creating, updating, and deleting a Win32_Service (Part I)
Sample 2.61: Viewing the Win32_Service instances (Part II)
Sample 2.62: Creating a Win32_Service instance (Part III)
Sample 2.63: Modifying a Win32_Service instance (Part IV)
Sample 2.64: Deleting a Win32_Service instance (Part V)
Sample 2.65: Viewing, creating, updating, and deleting shares
Sample 2.66: Retrieving the group membership
Sample 2.67: Retrieving the SID from the UserID
Sample 2.68: Retrieving the UserID from the SID

Chapter 3: The WMI Providers

Sample 3.1: Updating the WMI settings
Sample 3.2: Viewing and updating the NT Event Log configuration and clearing and backing up the NT Event Log information
Sample 3.3: Browsing, creating, deleting, searching, and replacing information in the registry (Parti)
Sample 3.4: Browsing information in the registry (Part II)
Sample 3.5: Creating information in the registry (Part III)
Sample 3.6: Deleting information in the registry (Part IV)
Sample 3.7: Browsing, searching, and replacing information in the registry (Part V)
Sample 3.8: Browsing, searching, and replacing information in the registry (Part VI)
Sample 3.9: Creating or updating information in the registry (Part VII)
Sample 3.10: Viewing the active sessions with their associations
Sample 3.11: Viewing Job kernel instance associated with a process
Sample 3.12: Verifying trusts
Sample 3.13: Managing the Windows Proxy LAN settings
Sample 3.14: Windows Product Activation
Sample 3.15: Managing Windows Installer packages (Part I)
Sample 3.16: Managing Windows Installer packages (Part II)
Sample 3.17: Managing Windows Installer packages (Part III)
Sample 3.18: Retrieving RSOP information from an applied GPO (Part I)
Sample 3.19: Retrieving RSOP information from an applied GPO (Part II)
Sample 3.20: Retrieving RSOP information from an applied GPO (Part III)
Sample 3.21: Retrieving RSOP information from an applied GPO (Part IV)
Sample 3.22: Retrieving RSOP information from an applied GPO (Part V)
Sample 3.23: Retrieving RSOP information from an applied GPO (Part VI)
Sample 3.24: Retrieving RSOP information from an applied GPO (Part VII)
Sample 3.25: Exploiting the System Restore features from script (Part I)
Sample 3.26: Viewing the System Restore points (Part II)
Sample 3.27: Enabling/disabling disk monitoring (Part III)
Sample 3.28: Creating a restore point (Part IV)
Sample 3.29: Getting the last restore status (Part V)
Sample 3.30: Restoring a restore point (Part VI)
Sample 3.31: Updating the System Restore parameters (Part VII)
Sample 3.32: Getting the current time (UTC and local)
Sample 3.33: Retrieving Disk quota information for each logical disk
Sample 3.34: Viewing the default volume quotas (Part I)
Sample 3.35: Configuring the default volume quotas (Part II)
Sample 3.36: Viewing, creating, updating, and deleting volume quota per user (Part I)
Sample 3.37: Updating volume quota per user (Part II)
Sample 3.38: Deleting volume quota per user (Part III)
Sample 3.39: Viewing, creating, modifying, and deleting DFS nodes (Part I)
Sample 3.40: Viewing, creating, modifying, and deleting DFS nodes (Part II)
Sample 3.41: Managing disk services and shadow copies (Part I)
Sample 3.42: Viewing all Win32_ShadowCopy instances (Part II)
Sample 3.43: Creating new shadow copies (Part III)
Sample 3.44: Deleting shadow copies (Part IV)
Sample 3.45: Associating a shadow storage with a Win32_Volume instance (Part V)
Sample 3.46: Viewing the volumes with their related shadow storage and shadow copies (Part VI)
Sample 3.47: Executing the Chkdsk Win32_Volume method (Part VII)
Sample 3.48: Executing the DefragAnalysis Win32_Volume method (Part VIII)
Sample 3.49: Executing the Defrag Win32_Volume method (Part IX)
Sample 3.50: Executing the Format Win32_Volume method (Part X)
Sample 3.51: Updating a Win32_ShadowStorage instance (Part XI)
Sample 3.52: Removing a Win32_ShadowStorage instance (Part XII)
Sample 3.53: Creating an Active Directory user object with WMI
Sample 3.54: Monitoring, managing, and alerting script for the Windows Group modifications
Sample 3.55: Making the Configuration and Schema context accessible
Sample 3.56: Monitoring, managing, and alerting script for the FSMO role modifications
Sample 3.57: Viewing and managing the Active Directory Replication state (Part I)
Sample 3.58: Viewing the inbound replication state information for a Naming Context (Part II)
Sample 3.59: Triggering the KCC and forcing a Naming Context replication (Part III)
Sample 3.60: PINGing a system at regular time intervals (Part I)
Sample 3.61: PINGing a system at regular time intervals (Part II)
Sample 3.62: Testing connectivity with the Network Diagnostic provider
Sample 3.63: Viewing, adding, and deleting IP v4.0 routes (Part I)
Sample 3.64: Adding IP v4.0 routes (Part II)
Sample 3.65: Deleting IP v4.0 routes (Part III)
Sample 3.66: Managing the DNS server (Part I)
Sample 3.67: Viewing the DNS zones (Part IIa)
Sample 3.68: Managing the DNS zones (Part IIb)
Sample 3.69: Managing the DNS records (Part III)
Sample 3.70: Obtaining localhost IP addresses from WMI via SNMP
Sample 3.71: Obtaining remote device IP addresses from WMI via SNMP
Sample 3.72: A MOF file to create a dedicated namespace for an SNMP device
Sample 3.73: Creating a private MIB in the CIM repository
Sample 3.74: The updated DisplayProperties() function to display the SnmpVarBind instances
Sample 3.75: The DisplaySNMPBindings() function to display the SnmpVarBind instances
Sample 3.76: Sending SNMP commands
Sample 3.77: Capturing performance counter values (raw or cooked) at regular time intervals (Part I)
Sample 3.78: Capturing performance counter values (raw or cooked) at regular time intervals (Part II)
Sample 3.79: The MOF file to register the Performance Monitoring provider
Sample 3.80: A MOF file defining a class to retrieve Process counters from the Performance Monitor
Sample 3.81: Viewing the Performance Monitor Process counters with a script
Sample 3.82: Registering the View provider
Sample 3.83: The Join View class
Sample 3.84: The Union View class
Sample 3.85: The Association View class
Sample 3.86: A MOF file to forward WMI events

Chapter 4: WMI Security Scripting

Sample 4.1: Viewing all Win32_Service instances with their status from a WMI-ASP script
Sample 4.2: The WMIManageSD.Wsfframework to manage security descriptors from the command line
Sample 4.3: Connecting to files and folders with WMI (Part I)
Sample 4.4: Connecting to files and folders with ADSI (Part II)
Sample 4.5: Connecting to shares with WMI (Part III)
Sample 4.6: Connecting to shares with ADSI (Part IV)
Sample 4.7: Connecting to Active Directory objects with WMI (Part V)
Sample 4.8: Connecting to Active Directory objects with ADSI (Part VI)
Sample 4.9: Connecting to Exchange 2000 mailbox information with WMI (Part VII)
Sample 4.10: Connecting to Exchange 2000 mailbox information with ADSI (Part VIII)
Sample 4.11: Connecting to Exchange 2000 mailbox information with CDOEXM (Part IX)
Sample 4.12: Connecting to registry keys with ADSI (Part X)
Sample 4.13: Connecting to CIM repository namespaces with WMI (Part XI)
Sample 4.14: Retrieving file and folder security descriptors with WMI (Part I)
Sample 4.15: Retrieving file and folder security descriptors with ADSI (Part II)
Sample 4.16: Retrieving file system share security descriptors with WMI (Part III)
Sample 4.17: Retrieving file system share security descriptors with ADSI (Part IV)
Sample 4.18: Retrieving Active Directory object security descriptors with WMI (Part V)
Sample 4.19: Retrieving Active Directory object security descriptors with ADSI (Part VI)
Sample 4.20: Retrieving Exchange 2000 mailbox security descriptors with WMI (Part VII)
Sample 4.21: Retrieving Exchange 2000 mailbox security descriptors with ADSI (Part VIII)
Sample 4.22: Retrieving Exchange 2000 mailbox security descriptors with CDOEXM (Part IX)
Sample 4.23: Retrieving registry key security descriptors with ADSI (Part X)
Sample 4.24: Retrieving CIM repository namespace security descriptors with WMI (Part XI)
Sample 4.25: Create a default security descriptor for a share
Sample 4.26: Converting the binary security descriptor to an ADSI representation
Sample 4.27: Converting the ADSI security descriptor to a binary format
Sample 4.28: Deciphering a WMI security descriptor representation
Sample 4.29: Deciphering an ADSI security descriptor representation
Sample 4.30: Deciphering the security descriptor Control Flags property
Sample 4.31: Calculate the security descriptor controls value
Sample 4.32: Deciphering the ACE Type property
Sample 4.33: Deciphering the ACE Flags property
Sample 4.34: Deciphering the ACE FlagType property
Sample 4.35: Deciphering the ACE AccessMask property for files and folders
Sample 4.36: Deciphering the ACE AccessMask property for File System shares
Sample 4.37: Deciphering the ACE AccessMask property for Active Directory objects
Sample 4.38: Deciphering the ACE AccessMask property for Exchange 2000 mailboxes
Sample 4.39: Deciphering the ACE AccessMask property for registry keys
Sample 4.40: Deciphering the ACE AccessMask property for CIM repository namespaces
Sample 4.41: Updating the security descriptor owner
Sample 4.42: Creating a Win32_Trustee instance
Sample 4.43: Updating the security descriptor group
Sample 4.44: Updating the security descriptor control flags
Sample 4.45: Adding ACE in the ADSI object model (Part I)
Sample 4.46: Adding ACE in the WMI object model (Part II)
Sample 4.47: Removing ACE in the ADSI object model (Part I)
Sample 4.48: Removing ACE in the WMI object model (Part II)
Sample 4.49: Reordering ACE in the ADSI object model (Part I)
Sample 4.50: Reordering ACE in the WMI object model (Part II)
Sample 4.51: Updating file and folder security descriptors with WMI (Part I)
Sample 4.52: Updating file and folder security descriptors with ADSI (Part II)
Sample 4.53: Updating share security descriptors with WMI (Part III)
Sample 4.54: Updating share security descriptors with ADSI (Part IV)
Sample 4.55: Updating Active Directory object security descriptors with WMI (Part V)
Sample 4.56: Updating Active Directory object security descriptors with ADSI (Part VI)
Sample 4.57: Updating Exchange 2000 mailbox security descriptors with WMI (Part VII)
Sample 4.58: Updating Exchange 2000 mailbox security descriptors with ADSI (Part VIII)
Sample 4.59: Updating Exchange 2000 mailbox security descriptors with CDOEXM (Part IX)
Sample 4.60: Updating registry key security descriptors with ADSI (Part X)
Sample 4.61: Updating CIM repository namespace security descriptors with WMI (Part XI)

Chapter 5: The Optional Windows Components and Application WMI Providers

Sample 5.1: Retrieving NLB network configuration settings
Sample 5.2: Changing the license mode
Sample 5.3: Changing the security mode
Sample 5.4: Changing the temporary folder settings
Sample 5.5: Enabling/disabling the Terminal Services connections
Sample 5.6: Configuring the Terminal Services remote control settings
Sample 5.7: Configuring the Terminal Services maximum connection settings
Sample 5.8: Configuring the Terminal Services encryption and authentication levels
Sample 5.9: Configuring the Terminal Services client connection policy settings
Sample 5.10: Configuring the Terminal Services client color depth policy settings
Sample 5.11: Configuring the Terminal Services client mapping settings
Sample 5.12: Configuring the Terminal Services connection environment settings
Sample 5.13: Configuring the Terminal Services connection logon settings
Sample 5.14: Configuring the Terminal Services connection session settings
Sample 5.15: Viewing the IISWebServer ServerBindings property with WMI
Sample 5.16: The script initialization phase
Sample 5.17: Retrieving a collection of OV_Message instances
Sample 5.18: Retrieving all properties of an OV_Message instance
Sample 5.19: Managing a specific OV_Message instance
Sample 5.20: Changing the OVOW message severity level
Sample 5.21: Retrieving the OVOW message annotation
Sample 5.22: Managing a series of OV_Message instances
Sample 5.23: Connecting and retrieving all Windows Services instances with their properties with the System.Management classes from C#
Sample 5.24: Connecting and retrieving all Windows Services instances with their properties with a WQL data query with the System.Management classes from C#
Sample 5.25: Connecting and performing a WQL event query to display Windows Services instances subject to a modification with the System.Management classes from C#

Appendix A: Appendix

Sample 4.6: Retrieving all instances of the Win32_Service class with their properties
Sample 4.14: Setting one read/write property of a Win32_Registry class instance directly
Sample 4.15: Setting one read/write property of a Win32_Registry class instance indirectly
Sample 4.30: A generic routine to display the SWbemPropertySet object
Sample 4.31: Browsing the namespaces to find class definitions
Sample 4.32: A Windows Script File self-documenting the CIM repository classes in an Excel sheet
Sample 6.14: A generic script for synchronous event notification
Sample 6.17: A generic script for asynchronous event notification
Samples 6.18-6.21: Monitoring, managing, and alerting script for the Windows services




Leveraging WMI Scripting
Leveraging WMI Scripting: Using Windows Management Instrumentation to Solve Windows Management Problems (HP Technologies)
ISBN: 1555582990
EAN: 2147483647
Year: 2003
Pages: 82
Authors: Alain Lissoir

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