---
title: "Resolve 'Invalid Namespace' WMI Errors in Nodinite Windows Server Monitoring Agent"
description: "Nodinite Windows Server Monitoring Agent—resolve 'Invalid Namespace' WMI errors with step-by-step troubleshooting, WBEMTEST, IIS, and repository repair guidance."
---

# Troubleshooting System.Management.ManagementException: Invalid Namespace  

If you encounter the `System.Management.ManagementException: Invalid Namespace` error, you are likely facing missing Windows features, incompatible server versions, or a broken WMI repository. This guide provides actionable steps to resolve these issues and ensure seamless monitoring with :Nodinite:.  

✅ Step-by-step troubleshooting for WMI namespace issues  
✅ Visual WBEMTEST and PowerShell instructions for fast resolution  
✅ [IIS][] and repository repair guidance for robust monitoring  

The `System.Management.ManagementException: Invalid Namespace` error can be caused by incompatibilities in Windows Server versions and features installed on the target server. Please read [this][InvalidClass] user guide if you see '**Invalid Class**' in the diagnostics files.  

The :Nodinite: [Windows Server Monitoring Agent][] uses **WMI** queries, and the Namespaces must exist on the target server. This also means the WMI repository cannot be broken. You may have to repair a broken WMI repository.  

<div class="mermaid">  
graph LR  
    subgraph "Server A"  
        roAgent1(fa:fa-monitor-waveform Nodinite Windows Server Agent)  
    end  
    subgraph "Server B"  
        roAgent1 <---> | INVALID NAMESPACE | roWMI("WMI Query")  
    end  
</div>  

*This diagram shows a failed WMI query between two servers, resulting in an 'Invalid Namespace' error.*  

## :fa-plug: Ensure the Namespace exists  

1. Use a **Remote Desktop** session and connect with the **target** Windows server. **NOTE**: This may be a **remote** Windows Server.  
2. Click on the **Start** menu item and type '`WBEMTEST`'.  
    ![WBEMTEST.exe on start menu][1]  
    *Example of WBEMTEST found in the Windows Start menu.*  
3. Next, launch the program.  
    ![WBEMTEST Application][2]  
    *Here's an example of the look of the **WBEMTEST** application.*  
4. Click the '**Connect**' button.  
5. Enter **'`root\WebAdministration`'** in the '**Namespace**' text box.  
    ![Connect with Namespace][3]  
    *Example of the Connect dialog with namespace entry.*  

✅ If there are no error messages, the Namespace exists on the target server.
:fa-times: If the namespace does not exist you should be presented with an error message:
    ![Invalid Namespace][4]  
    *Here's an example of a missing namespace.*  
6. If the namespace does not exist, please retry steps 4 and 5, using **'`root\MicrosoftIISv2`'** this time.  

As an alternative to **WBEMTEST**, you can use **PowerShell**.  

  ```powershell  
  Get-WmiObject -Namespace "root" -Class "__Namespace" | Where-Object { $_.Name -eq "WebAdministration" }  
  ```  

* If the namespace is missing, IIS WMI components might not be installed.  

>[!NOTE]
>[Report][Reports] these findings to the :Nodinite: [Support]  

___  

## Possible Causes and Solutions  

### 1. IIS Management Scripts and Tools Are Not Installed

* The `WebAdministration` namespace is part of the **IIS Management Scripts and Tools** feature.  
* Check if it's installed by running:  

    ```powershell  
    Get-WindowsFeature Web-Scripting-Tools  
    ```  

* If it's missing, install it with:  

    ```powershell  
    Install-WindowsFeature Web-Scripting-Tools  
    ```  

### 2. WMI Repository Corruption  

* Sometimes, the WMI repository gets corrupted, causing namespaces to disappear.  
* Try rebuilding WMI:  

  ```cmd  
  winmgmt /resetrepository  
  ```  

* If that doesn’t work, try:  

  ```cmd  
  winmgmt /salvagerepository  
  ```  

### 3. IIS WMI Provider Not Registered  

* The WMI provider for IIS might not be properly registered. You can re-register it by running:  

  ```cmd  
  mofcomp %windir%\system32\inetsrv\iiswmi.mof  
  ```  

## :fa-check-circle: Verification Steps

1. **Confirm IIS is fully installed** using:  

   ```powershell  
   Get-WindowsFeature *Web*  
   ```  

2. **Ensure IIS Management Scripts and Tools (`Web-Scripting-Tools`) is installed.**  
3. **Re-register the WMI provider (`mofcomp` command above).**  
4. **If all else fails, try resetting WMI.**  

## :fa-hand-point-right: Next Steps

:fa-triangle-exclamation: [Troubleshooting the Windows Server Monitoring Agent][]  

## :fa-link-horizontal: Related Topics

:fab fa-windows: [Windows Server Monitoring Agent][]
:fa-bug: [Invalid Class][]  
:fa-life-ring: [Support][]  

[1]:{ndm}/Documentation%20Pictures/MonitorAgent/WindowsServer/Troubleshooting/wbemtest_startmenu.png
[2]:{ndm}/Documentation%20Pictures/MonitorAgent/WindowsServer/Troubleshooting/wbemtest_application.png
[3]:{ndm}/Documentation%20Pictures/MonitorAgent/WindowsServer/Troubleshooting/wbemtest_connect_namespace.png
[4]:{ndm}/Documentation%20Pictures/MonitorAgent/WindowsServer/Troubleshooting/wbem_namespace_notfound.png

[IIS]:{ndr}/Install%20and%20Update/Troubleshooting/IIS/Overview.md
[Invalid Class]:{ndr}/Logging%20and%20Monitoring/Windows%20Server/Troubleshooting/Invalid%20Class.md
[InvalidClass]:{ndr}/Logging%20and%20Monitoring/Windows%20Server/Troubleshooting/Invalid%20Class.md
[Reports]:{ndr}/Core%20Services/Web%20API/Features/Reports/Overview.md
[Support]:https://support.nodinite.com
[Troubleshooting the Windows Server Monitoring Agent]:{ndr}/Logging%20and%20Monitoring/Windows%20Server/Troubleshooting/Overview.md
[Windows Server Monitoring Agent]:{ndr}/Logging%20and%20Monitoring/Windows%20Server/Overview.md