Configure WMI
π₯οΈ WMI Prerequisitesβ
π― Purposeβ
Ensure information collection from Windows machines via WMI (Windows Management Instrumentation), a key component for remote administration.
Save time by using our automatic installation script with a single command.
How to use:β
-
Download the installation script.
-
Edit the environment variables in the file to match your network.
-
Make the script executable depending on your system:
-
Linux
chmod +x watchman-wmi-configuration.sh
-
Windows
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
-
-
Run the script on each target machine in your network.
-
Done! π
πͺ Configuration Stepsβ
1. β Enable the WMI serviceβ
- Open
services.msc
- Find Windows Management Instrumentation
- Make sure the service is running
- If not, right-click > Start
2. π₯ Configure Windows Firewallβ
WMI uses multiple dynamic ports. To ensure it works properly:
Option 1: Enable predefined rulesβ
- Open Windows Defender Firewall with Advanced Security
- Go to Inbound Rules
- Enable the following rules if disabled:
Windows Management Instrumentation (WMI-In)
Remote Administration (RPC)
DCOM-In
Option 2: Manually add required portsβ
π By default, WMI uses TCP port 135 for DCOM, plus a dynamic range of RPC ports.
For more control, restrict WMI to a specific port:
New-Item -Path "HKLM:\Software\Microsoft\Rpc\Internet" -Force
New-ItemProperty -Path "HKLM:\Software\Microsoft\Rpc\Internet" -Name "Ports" -PropertyType MultiString -Value "5985"
New-ItemProperty -Path "HKLM:\Software\Microsoft\Rpc\Internet" -Name "PortsInternetAvailable" -Value "Y" -PropertyType String
New-ItemProperty -Path "HKLM:\Software\Microsoft\Rpc\Internet" -Name "UseInternetPorts" -Value 1 -PropertyType DWord
Then create a firewall rule allowing inbound TCP traffic on the chosen port (e.g., 5985
).
3. π Required access rightsβ
The account used for WMI access must:
- Be a local administrator on the remote machine, or
- Have the necessary permissions to query WMI objects.
Best practices:β
- Create a dedicated account for WMI collection with restricted rights if needed
- Test WMI access with:
Get-WmiObject -Class Win32_OperatingSystem -ComputerName <MACHINE_NAME> -Credential (Get-Credential)
β οΈ If you encounter issues, verify that the DCOM service is enabled and that the machine is reachable on the network.