Configuring WMI on Windows Servers
Windows Management Instrumentation (WMI) is a set of specifications for managing devices and applications on Windows-based operating systems (OSs). WMI provides the status of local or remote computer systems, and comes installed with most of the Windows OSs.
You have to configure WMI on Windows servers to monitor them using Site24x7. This configuration involves the following steps:
- Checking if the WMI service is running
- Enabling WMI in a remote monitor
- Allowing firewall
- Checking and connecting to a WMI remote monitor
Checking if the WMI service is running
- From your Windows machine, open services.msc.
- Search for the Windows Management Instrumentation service.
- Check if the Status is Running. If not, Start the service.
Enabling WMI in a remote monitor
- Go to Control Panel > Administrative Tools > Computer Management.
- In the Computer Management screen, expand Services and Applications.
- Right click WMI Control and click Properties.
- In the WMI Control Properties screen, go to the Security tab.
- Click the Security button.
- Under Group or user names, select the user that will be requesting WMI data and click Add.
- Under Permission for Administrators, ensure that Remote Enable is checked for Allow.
Allowing firewall
All users will be able to query or read WMI data on local machines. To read WMI data on a remote server, you've set the following some to allow firewall. For this, open Command Prompt with Administrator privileges, and execute the following commands:
For Windows XP, Windows Vista, and Windows 7
netsh firewall set service RemoteAdmin enable
For Windows 8, Windows 8.1, and Windows 10
netsh advfirewall firewall set rule group="Windows Remote Management" new enable=yes
netsh advfirewall firewall set rule group="windows management instrumentation (wmi)" new enable=yes
Checking and connecting to a WMI remote monitor
Connecting to WMI remotely with PowerShell
Use the -ComputerName parameter common to most WMI cmdlets, such as Get-WmiObject.
$strComputer = "Computer_B"
$colSettings = Get-WmiObject Win32_OperatingSystem -ComputerName $strComputer
Connecting to WMI Remotely with VBScript
Use a moniker that contains the name of the remote system in the call to GetObject.
strComputer = "Computer_B"
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSettings = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
Refer to Microsoft's documentation to learn more.