slmgr and wmic os get return differing results

Jetzer, Todd 21 Reputation points
2021-08-24T13:32:41.837+00:00

Hello,

I have many computers on my network whose licenses were changed from Pro the Enterprise. On some of those computers, when running wmic os get Caption the return still shows "Microsoft Windows 10 Pro" however slmgr.vbs /dli shows Windows Enterprise. Does anyone know a way to get wmic os get to show the proper license?

126067-discrepency.png

Windows 10 Network
Windows 10 Network
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Network: A group of devices that communicate either wirelessly or via a physical connection.
2,282 questions
0 comments No comments
{count} votes

Accepted answer
  1. Limitless Technology 39,416 Reputation points
    2021-08-25T09:48:46.093+00:00

    Hello Jetzer,

    It might seem a WMI repository issue. Please follow next instructions to fix it or update it.

    Solving WMI repository problems
    Using winmgnt
    If the repository is inconsistent you may try to rebuild the repository by either salvaging or resetting the repository. On Vista and newer you can use the following command from an elevated command prompt to salvage the repository:

    winmgmt /salvagerepository
    The command will attempt to salvage the content of the inconsistent repository and merge it into a rebuilt repository. If that fails you may try to reset the repository.

    Warning This will result is third party products not working until you re-run their setup which will re-add their MOF-files to the WMI repository.

    winmgmt /resetrepository
    This will reset the repository to the initial state of the OS from when it was first installed. Note the warning before you do this.
    Rebuilding repository MOF files and re-registering DLLs

    If salvaging using winmgmt does not help or you do not wish to reset the repository you can try to recompile all MOF files found in the WMI repository folder and re-register all DLL files, WMI service and provider. Copy the following lines to a BAT file:

    @Echo off
    sc config winmgmt start= disabled
    net stop winmgmt /y
    %systemdrive%
    cd %windir%\system32\wbem
    for /f %%s in (‘dir /b *.dll’) do regsvr32 /s %%s
    wmiprvse /regserver
    winmgmt /regserver
    sc config winmgmt start= auto
    net start winmgmt
    for /f %%s in (‘dir /s /b *.mof *.mfl’) do mofcomp %%s

    Execute the BAT in an elevated command prompt and when it has completed, reboot the machine. After the reboot, attempt to scan the machine with vScope.

    Updating WMI performance counters
    To make sure performance information in the WMI is consistent you may attempt to use the following techniques to refresh, resync or reload the performance counters.

    Refresh
    WMIADAPT (http://msdn.microsoft.com/en-us/library/aa394528(VS.85).aspx) command to refresh the performance counters. To use wmiadapt, open an elevated command prompt.

    wmiadapt /f
    Parses all the performance libraries on the system and refreshes the classes derived from Win32_PerfRawData and Win32_PerfFormattedData.

    wmiadapt /r
    Parses all the Windows Driver Model drivers on the system to create performance objects.

    Resync
    Using winmgmt you can attempt to correct corrupted performance counters. Using an elevated command prompt:

    winmgmt /clearadap (not needed on systems newer than Windows Server 2003)
    winmgmt /resyncperf
    Reload
    Using lodctr you can attempt to reload the performance counters. In an elevated command prompt, type:

    lodctr /r

    Hope it helps you!

    Do not forget to vote if helpful or mark as an answer if it resolved your query.

    Best regards!
    Luis P

    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Castorix31 82,031 Reputation points
    2021-08-24T13:58:44.717+00:00

    Maybe you can try with SoftwareLicensingProduct, like :

    wmic path SoftwareLicensingProduct where "LicenseStatus = 1 AND Name like '%Windows%'" get Name, Description
    

  2. cthivierge 4,056 Reputation points
    2021-08-24T15:02:58.683+00:00

    Does your organization has the E3 or E5 license ?

    https://learn.microsoft.com/en-us/windows/deployment/windows-10-subscription-activation

    My guess is if the initial installation was a Windows 10 Pro and the computer was added to Azure, the Windows was automatically upgraded to Windows 10 Enterprise.

    Maybe wmic does not return the same data as slmgr...