UserName NULL in WMI query

Started by Sayed

Sayed

UserName NULL in WMI query   27 December 2023, 18:06

Hello Team,
Hope you are doing well.
I used SoftPerfect Network Scanner in the past, and now we are using its trial version in a new company before purchasing. During our tests we found that in WMI the current logged-on user shows NULL in its username while we are trying to scan a range of IPs.
Please help us find reason for this and solve it. We appreciate your support.

We enter the following in WMI Query Builder:
Item Name: 
UserName
Name Space: 
CIMV2
WQL Statement: 
SELECT UserName FROM Win32_ComputerSystem
WMI Class: 
Win32_ComputerSystem
SoftPerfect Support forum - Ann avatar image
Ann

Re: UserName NULL in WMI query   27 December 2023, 18:21

If the UserName is coming back as NULL, it could indicate that there is no user currently logged into the system, or there might be an issue with permissions or WMI on the target machine.

Here is how you can use wbemtest to test WMI queries and possibly diagnose the issue:
  1. Open wbemtest.
    On the machine where you want to test WMI, go to Start and type wbemtest, then press Enter. This opens the Windows Management Instrumentation Tester.
  2. Connect to namespace.
    In wbemtest, click Connect. To connect to the local computer, enter root\cimv2 in the namespace field and click Connect. If you are connecting to a remote computer, you should use \\ComputerName\root\cimv2
  3. Run the query.
    Click on Query, then enter your WQL statement SELECT UserName FROM Win32_ComputerSystem and then click Apply.

If wbemtest returns the same NULL value for UserName, then the issue is consistent and not specifically related to the Network Scanner software. Here are some steps you could take to troubleshoot it:
  • Check if a user is logged on.
    If the computer is on a login screen or locked, the UserName may be NULL. Make sure that there is an active user session.
  • Check WMI permissions.
    The account you are using to run the WMI query must have permissions to access WMI on the target machine. You might need to adjust the DCOM and WMI permissions.
  • Firewall and network issues.
    Ensure that the firewall settings on the target machine allow for remote WMI requests.
  • WMI repository health.
    Sometimes the WMI repository can become corrupt. You can check the consistency of the WMI repository by running the command winmgmt /verifyrepository from an elevated Command Prompt.
  • WMI service status.
    Make sure the Windows Management Instrumentation service is running on the target machine.

Reply to this topic

Sometimes you can find a solution faster if you try the forum search, have a look at the knowledge base, or check the software user manual to see if your question has already been answered.

Our forum rules are simple:

  • Be polite.
  • Do not spam.
  • Write in English. If possible, check your spelling and grammar.

Author:

Email:

Subject

A brief and informative title for your message, approximately 4–8 words:

     

Spam prevention: please enter the following code in the input field below.

 **      **  **    **  ********  ********  ********  
 **  **  **   **  **   **           **     **     ** 
 **  **  **    ****    **           **     **     ** 
 **  **  **     **     ******       **     **     ** 
 **  **  **     **     **           **     **     ** 
 **  **  **     **     **           **     **     ** 
  ***  ***      **     **           **     ********  

Message: