Domotz
Tips & Tricks

Troubleshooting WINRM Unlock in Domotz

By Muhammad Usman Updated 20 Nov 2026 13 min read
On this page
Images with text:
Markdown ↗
9 min

This article helps you troubleshoot the unlock of the OS Monitoring feature for Microsoft Windows, the feature behind the device’s System tab. It covers the original checks (how the enablement script is run, WinRM and WMI permissions). It also covers two problems that the standard checks don’t reveal:

  • The unlock never completes because the server refuses NTLM authentication by policy. The account and password are correct, and a PowerShell test by hostname still works.
  • The device unlocks, but logical and physical disk information stays empty because of a WMI “Provider failure”.

If the unlock option is missing: make sure the WinRM service is enabled on the device and has an HTTP listener. The Domotz Collector must be able to reach TCP port 5985 on the device. The OS Monitoring unlock always uses WinRM over HTTP on port 5985, and HTTPS (port 5986) is not used.

How Domotz connects to Windows

Understanding the connection path explains most unlock failures, so it’s worth reading this section first. This section describes the OS Monitoring unlock (the device’s System tab).

  • The Collector connects to the device over WinRM over HTTP, port 5985, using the device’s IP address.
  • The login method depends on the format of the username you enter when unlocking:
    • DOMAIN\username or COMPUTERNAME\username (with a backslash) → NTLM. This is the recommended setup.
    • Any username without a backslash → Basic authentication. This includes a plain username and the user@domain (UPN) format.
  • For the OS Monitoring unlock, Domotz does not use Kerberos or CredSSP.
  • Once logged in, Domotz runs read-only PowerShell and WMI/CIM queries: OS, CPU, memory, disks and so on.

Basic authentication sends the password unencrypted. Because the unlock uses HTTP, Basic authentication only works if the device’s WinRM service has both Basic and AllowUnencrypted set to true. The credentials then cross the network unencrypted, and Windows only accepts Basic for local accounts. Use the DOMAIN\username or COMPUTERNAME\username format (NTLM) whenever you can.

Domotz Collector connects by IP address WinRM HTTP, port 5985 Username format DOMAIN\user → NTLM no backslash → Basic Windows device 1. NTLM policy (LSA) “Restrict NTLM: Incoming NTLM traffic” 2. Account & password check failure logs Security event 4625 3. WinRM + WMI permissions set by the enablement script 4. Queries run (disks, services…) If NTLM is denied here: login refused before the password is checked, no 4625
Where a Domotz WinRM login can fail. The checks run from top to bottom.

Why a successful PowerShell test can be misleading: a test such as Enter-PSSession -ComputerName SERVER01 connects by hostname, so Windows uses Kerberos. Domotz connects by IP address, so Windows uses NTLM. If NTLM is blocked on the server, the hostname test succeeds while Domotz fails. Always test by IP address, as described in “Test the login the way Domotz does” below.

Run the enablement script correctly

1) Download the latest version of the WinRM enablement script: https://github.com/domotz/support_scripts/raw/main/os_monitoring/enable_winrm_os_monitoring.zip

2) Do not use PowerShell ISE. Run the script from a standard PowerShell console opened as Administrator.

3) Run the script for the type of account you’ll use to unlock the device: for local users, go to 3a; for domain users, go to 3b.

3a) Run the script for local Windows users: https://help.domotz.com/monitoring-management/os-monitoring-feature/#htoc-run-the-script-for-local-users

When you unlock the device in the Domotz portal with a local user, enter the username as COMPUTERNAME\username.

If you’re not sure of the computer name, open a Command Prompt and run hostname:

The hostname command returns the computer name

If you run the script with a username that doesn’t exist yet, the script creates that user with a random password and prints the password in the same PowerShell window. Use that password when you unlock the device, or the unlock won’t complete. You can change the password later in the machine’s Users and Groups settings.

3b) Run the script for domain users: https://help.domotz.com/monitoring-management/os-monitoring-feature/#htoc-run-the-script-for-domain-users

Enter the username as DOMAIN\username, for example contoso\Domotz.

Check the WinRM and WMI permissions

4) Make sure the account you use to unlock the device is a member of the group you granted permissions to. This is the group name you passed as a parameter when you ran the script.

5) Check that the group has both the WinRM and the WMI permissions.

WinRM permissions

From an Administrator PowerShell, run winrm configsddl default. In the window that opens, check that the group (by default DomotzWinRM, or the group name you used) has Read and Execute allowed:

WinRM permissions for the DomotzWinRM group: Read and Execute

WMI permissions

From an Administrator PowerShell, run compmgmt.msc. Expand Services and Applications, right-click WMI Control and select Properties. On the Security tab, expand Root, select CIMV2 and click Security. The group needs Execute Methods, Enable Account and Remote Enable:

WMI permissions on Root\CIMV2 for the DomotzWinRM group

Test the login the way Domotz does

The most reliable test is to repeat what the Collector does: connect by IP address, over HTTP port 5985, with the same account. Windows’ built-in winrs tool uses the same WinRM path as Domotz.

Where to run the test: winrs exists only on Windows. If your Collector is installed on Windows, run the test on the Collector host. If it runs on a Domotz Box, Docker or Linux, use any Windows machine on the same network as the Collector, with access to port 5985 on the device.

Step 1. Allow the test machine to connect by IP. When the test machine connects by IP address, Windows refuses the connection unless the device is listed in the client’s TrustedHosts. In PowerShell as Administrator on the test machine, note the current value first so you can restore it, then add the device’s IP address:

Get-Item WSMan:\localhost\Client\TrustedHosts
Set-Item WSMan:\localhost\Client\TrustedHosts -Value 192.0.2.10 -Force

If PowerShell reports that the WinRM service isn’t running on this machine, run Start-Service WinRM first. Without this step, winrs fails with “the destination machine must be added to the TrustedHosts configuration setting”. Setting TrustedHosts is only needed for this manual test. The Domotz Collector doesn’t need it.

Step 2. Run the test in Command Prompt (cmd.exe). This confirms that login works and shows the account being used. Replace the IP address and the username with your own. You’ll be asked for the password.

winrs -r:http://192.0.2.10:5985 -u:DOMAIN\Domotz whoami

Use Command Prompt, not PowerShell, for winrs. PowerShell expands $variables and quotes in the command before winrs receives it, which breaks the test. Open cmd or type cmd inside your PowerShell window first. Paste each command on a single line, and check that the quotes are straight (“), not curly.

  • It returns domain\domotz: login works. If the unlock still doesn’t complete, check the credentials saved in Domotz for typos and for the DOMAIN\ prefix.
  • “Access is denied”: this has more than one cause. Check the event logs at the time of the test and continue with “Match the error to its cause” below.
  • An error naming “the authentication mechanism”: continue with “Match the error to its cause” below.
  • Time-out or “cannot connect”: check the firewall, the WinRM HTTP listener (winrm enumerate winrm/config/listener) and port 5985 between the Collector and the device.
  • “Winrs error: The handle is invalid.” printed after the command’s output: this is harmless when winrs runs non-interactively. Ignore it.

Step 3. Restore TrustedHosts when you’ve finished testing. In PowerShell as Administrator, set it back to the value you noted in step 1, or clear it if it was empty:

Set-Item WSMan:\localhost\Client\TrustedHosts -Value '' -Force

This test reproduces the NTLM login only. Use the DOMAIN\username or COMPUTERNAME\username format in the test, the same as in Domotz. With a username without a backslash, winrs uses Negotiate rather than Basic, so it doesn’t reproduce how Domotz logs in with that format.

Match the error to its cause

What you seeWhat it meansWhere to look
The unlock stays pending and never completes, with no error shown in the portal. winrs returns “Access is denied”. NTLM event 4002 is logged and no 4625.The device refuses the NTLM login. Usually incoming NTLM is blocked by policy.“Incoming NTLM blocked by policy” below.
winrs returns “Access is denied” on whoami itself, and a Security event 4624 (successful logon) is logged at the same time.The login succeeded, but the account’s group isn’t in the WinRM permissions.“Check the WinRM and WMI permissions” (winrm configsddl default).
Unlock doesn’t complete and a Security event 4625 appears on the device at the same time.NTLM reached the server, but the account or password was rejected. Causes include a wrong password, a locked or disabled account, a missing DOMAIN\ prefix, or logon-hours or workstation restrictions.Read the Failure Reason, Status and Sub Status fields of the 4625 event.
Unlock doesn’t complete but no 4624, 4625 or NTLM 4002 is logged.The request may never reach the server’s login stage: firewall, listener, port 5985 or a proxy in between.Run the winrs test above and check the listener and port.
whoami works, but WMI queries return “Access denied”.WMI permissions are missing for the account’s group.“Check the WinRM and WMI permissions” (WMI Control).
Unlocked, but disks are empty (other OS data is fine).The WMI disk provider is failing.“Unlocked, but disk information is empty” below.

Filter the event logs to the moment of the test. Old or unrelated 4625 events, for example from other applications, are easy to mistake for the Domotz one. Retry the unlock or the winrs test, note the time, and filter the Security log to the last 15 minutes only. Check that the event’s account name and source IP match the Domotz account and the Collector.

Incoming NTLM blocked by policy

Typical symptoms:

  • The unlock stays pending and never completes on one or a few servers, while other servers with the same account unlock fine. The portal shows no error message.
  • The password is known to be correct, and a hostname-based PowerShell test works.
  • The winrs test above returns “Access is denied”.
  • No 4625 event is logged.

Confirm it (on the affected server, PowerShell as Administrator)

Check the policy value. 2 means “Deny all” incoming NTLM. 0 means “Allow all”.

Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0 | Select RestrictReceivingNTLMTraffic

Look for blocked NTLM attempts at the time of the unlock or the test:

Get-WinEvent -LogName "Microsoft-Windows-NTLM/Operational" -MaxEvents 20 | Where-Object Id -eq 4002 | Format-List TimeCreated, Message

Event 4002, “Incoming NTLM traffic to servers that is blocked”, logged at the time of the unlock attempt or the test confirms the cause. The event doesn’t name the Domotz account: it shows the WinRM service process (svchost.exe) and the machine account (COMPUTERNAME$), so match it by time. Optionally, check that WinRM itself allows Negotiate (NTLM). It should show Negotiate = true:

winrm get winrm/config/service/auth

Fix it

1) On the affected server, find which Group Policy sets the restriction. Open Command Prompt as Administrator and run the command below. Open the report and search for “Restrict NTLM: Incoming NTLM traffic”. The Winning GPO column names the policy.

mkdir C:\Temp & gpresult /h C:\Temp\gpresult.html

2) Ask your Group Policy or security team to set Computer Configuration → Windows Settings → Security Settings → Local Policies → Security Options → Network security: Restrict NTLM: Incoming NTLM traffic to Allow all for this server. Alternatively, they can exclude the server from that GPO. If no GPO sets it, change it in the server’s Local Security Policy (secpol.msc).

3) On the affected server, in PowerShell as Administrator, apply the policy and check the value. It should now be 0:

gpupdate /force
Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0 | Select RestrictReceivingNTLMTraffic

4) Repeat the winrs test, then unlock the device in Domotz.

Security consideration: this policy has no per-account exception list. The related “Add server exceptions” setting covers outgoing NTLM only. Allowing incoming NTLM applies to every connection to that server, so the decision belongs to your security team. If NTLM can’t be allowed, contact Domotz Support to discuss alternatives. The only other login method, Basic with a local account, needs AllowUnencrypted enabled on the device’s WinRM service and sends the credentials unencrypted, so it is rarely an acceptable alternative.

Unlocked, but disk information is empty

Symptoms: the device unlocks and OS, CPU and memory data appear, but the Logical Disks and Physical Disks sections stay empty. Domotz’s disk query suppresses errors so that one failing section doesn’t stop the others, so the real error isn’t visible in the portal.

Show the hidden error

From Command Prompt on the same Windows test machine as above (with TrustedHosts set as in step 1), run the disk queries as the Domotz account with errors shown. Replace the IP address and the username with your own:

winrs -r:http://192.0.2.10:5985 -u:DOMAIN\Domotz powershell.exe "whoami; 'Mode: ' + $ExecutionContext.SessionState.LanguageMode; try { Get-WmiObject Win32_LogicalDisk -ErrorAction Stop | Select DeviceID,Size | Out-String } catch { 'WMI LOGICAL ERROR: ' + $_ }; try { Get-WmiObject Win32_DiskDrive -ErrorAction Stop | Select Model,Size | Out-String } catch { 'WMI PHYSICAL ERROR: ' + $_ }; try { Get-CimInstance Win32_LogicalDisk -ErrorAction Stop | Select DeviceID,Size | Out-String } catch { 'CIM ERROR: ' + $_ }"
ResultMeaning and action
Disks are listedWMI is healthy now. Domotz picks up the disks at its next disk collection, within about 4 hours.
“Provider failure” (WBEM 0x80041004) on the disk queriesThis is not a permissions problem. The WMI provider that answers disk queries is stuck or failing. Restart the WMI service on the affected server, or reboot it in a maintenance window. Then run the test again.
“Access denied”Check the WMI permissions on Root\CIMV2 (see “Check the WinRM and WMI permissions”).
Mode: ConstrainedLanguageAppLocker or WDAC restricts PowerShell for this account. Some Domotz queries may not work, so review the policy for the Domotz account.

To restart WMI, run this on the affected server in PowerShell as Administrator. Dependent services restart automatically:

Restart-Service Winmgmt -Force

If the error comes back, check the WMI repository. Only salvage it if verification reports it as inconsistent:

winmgmt /verifyrepository
winmgmt /salvagerepository

Other troubleshooting

6) Individual PowerShell cmdlets inside the enablement script can fail. The errors are usually in the script’s log file. Run the failing cmdlets in the same context as the user who ran the script. If that user is SYSTEM, you can use PsExec64.exe. The WMI repository may be broken, or default security may have been changed by a GPO or another hardening tool.

To check for and rebuild a broken repository, see WMI: Repository Corruption, or Not? and the section “Unlocked, but disk information is empty” above.

7) If none of the above helps, open a ticket at support@domotz.com. Please include:

winrs … whoami (by IP, port 5985) Time-out / cannot connect TrustedHosts, firewall, port 5985 Access denied / auth error check event logs at that moment Returns domain\domotz login works, so check what is missing NTLM 4002, no 4625 RestrictReceivingNTLMTraffic = 2 → NTLM policy Security 4625 wrong password / account → read Failure Reason Security 4624 logon OK, no WinRM rights → Permissions Which symptom remains? pick the matching case below Unlock still fails WinRM / WMI rights → Permissions Disks empty “Provider failure” → Empty disks
Quick decision flow, starting from the winrs test.