This guide provides how to enable and test WMI access with a regular domain user without generic admin rights.
Make sure you have followed the steps in the article Setting WMI access through Active Directory & Group Policy Object. This ensures you have configured DCOM access, WMI namespace permissions, and firewall exceptions precisely.
Let’s define two machines:
Client – The machine you are discovering from (for example, your machine running APM)
Target – The machine you are attempting to discover
Open up a PowerShell prompt on the Client. We will now test if we can get hold of the ComputerSystem object from the Target system through WMI. Run the following on the Client system:
Get-WmiObject -Class Win32_ComputerSystem -ComputerName Target -Credential apmclu\wmiuser
If successful, the output should be details about the Target system:
Domain : apmclu.com
Manufacturer : VMware, Inc.
Model : VMware Virtual Platform
Name : Target
PrimaryOwnerName : Windows User
TotalPhysicalMemory : 12589463552
If an error occurs it might look like below. The first error (E_ACCESSDENIED) is most likely due to insufficient DCOM rights. See step 2 in Setting WMI access through Active Directory & Group Policy Object.
Get-WmiObject : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
At line:1 char:1
+ Get-WmiObject -Class Win32_ComputerSystem -ComputerName Target - ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-WmiObject], UnauthorizedAccessException
+ FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
The second error (GetWMIManagementException) is most likely due to insufficient rights on the WMI namespace. See step 3 in Setting WMI access through Active Directory & Group Policy Object.
Get-WmiObject : Access denied
At line:1 char:1
+ Get-WmiObject -Class Win32_ComputerSystem -ComputerName Target - ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Get-WmiObject], ManagementException
+ FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
Once you have managed to resolve all errors by running the above commands, we will also verify that you have permission to get installed Windows quick-fix engineering (QFE) updates. These are system-wide updates for the operating system. These updates are not listed in the registry so it is vital that vScope has access to them in order to correctly display updated information.
To try it out, run the following command in your PowerShell on the Client system:
Get-WmiObject -Class Win32_QuickFixEngineering -ComputerName Target -Credential apmclu\wmiuser
You should now get back a list of installed QFE. Example:
Source Description HotFixID InstalledBy InstalledOn
------ ----------- -------- ----------- -----------
If this list is empty, you either don’t have any updates installed or wmiuser lacks permissions to retrieve the information. To troubleshoot an empty list, attempt to run the same command as a domain administrator:
Get-WmiObject -Class Win32_QuickFixEngineering -ComputerName Target -Credential apmclu\administrator
If you now have a non-empty list then there is a permission problem. If the list is still empty then you most likely do not have any updates installed. Please verify that this is the case.
If the list differs when running as wmiuser compared to administrator we need fix some permissions on the Target system.
RDP (Remote Desktop) to the Target system as an administrator with sufficient rights (account set up depending on your local policy).
Open up the Event Viewer on the Target system and select Windows Logs -> System. Look for event ID 10016 which occured at the time you attempted to run the PowerShell command to retrieve QFE.
If you find a matching event then we will continue troubleshooting below.
The General tab for the event will say something like below. Don’t worry if the APPID part is missing.
The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID
{752073A1-23F2-4396-85F0-8FDB879ED0ED}
and APPID
{752073A2-23F2-4396-85F0-8FDB879ED0ED}
to the user APMCLU\wmiuser SID (S-1-5-21-XXXXXXXX-XXXXXXXXX) from address LocalHost (Using LRPC) running in the application container Unavailable SID (Unavailable). This security permission can be modified using the Component Services administrative tool.
The description can also look like this if there is no parsing of the ID available. The first ID is the CLSID and the second one is the APPID:
The following information was included with the event:
application-specific
Local
Activation
{752073A1-23F2-4396-85F0-8FDB879ED0ED}
{752073A2-23F2-4396-85F0-8FDB879ED0ED}
APMCLU
wmiuser
S-1-5-21-XXXXXXXX-XXXXXXXXX
LocalHost (Using LRPC)
What this means is that the user attempted to activate a COM Server application and did not have sufficient privileges to do this. Note the two IDs in the description.
CLSID: {752073A1-23F2-4396-85F0-8FDB879ED0ED}
APPID: {752073A2-23F2-4396-85F0-8FDB879ED0ED} (this one might be missing)
If you only have CLSID in your description then that is fine, we will find the APPID in the registry.
NOTE: These IDs may not be the same on your system. Use your own IDs below.
To find out which application this is we need to go to the registry. Open up the registry with administrator rights by typing in “regedit” into the Run field and then right-click and choose “Run as Administrator”.
Do a search for the CLSID in Regedit. You should find a key with the path:HKEY_CLASSES_ROOT\CLSID\{752073A1-23F2-4396-85F0-8FDB879ED0ED}
In that key you will have a property named AppID. It will read something like:{752073A2-23F2-4396-85F0-8FDB879ED0ED}
Do a search for this key in the registry. You should find a key with the path:HKEY_CLASSES_ROOT\AppID\{752073A2-23F2-4396-85F0-8FDB879ED0ED}
It will have a property named LocalService and the value should be TrustedInstaller.
This means that it is TrustedInstaller which the user wmiuser does not have activation or launch rights for. TrustedInstaller is the service that will provide the list of QFE (updates). This is why the output is empty for wmiuser.
To summarize the problem:
There are a couple of ways to solve this without using a domain administrator:
The first option is easy but will make the user an administrator on that particular system. The second option is harder but will not make the user an administrator.
This guide makes the domain non-admin user a local administrator on the Target system. By doing this, the user receives the same permissions as a domain administrator but limited to the particular machine.
First, we must add our user (wmiuser) to a new group which we later will use to make the user a local admin.
In your domain, add a group named Local Admins:
The next step is to create a GPO which will add the Local Admins group as a member of the local administrators group. Open Group Policy Management to create a new GPO.
The GPO should apply on the machines but if you want to force an update, use gpupdate /force on the Target system.
After confirming that the GPO has applied, attempt to run the PowerShell command again (on the Client system):Get-WmiObject -Class Win32_QuickFixEngineering -ComputerName Target -Credential apmclu\wmiuser
You should now see the same output as when you executed the command as a domain admin.
If you do not wish to make the user a local administrator, you must continue on reading.
If we need to use a non-administrator to access TrustedInstaller we need to perform a set of tasks. Read on for instructions.
On the target system, run dcomcnfg.
{752073A2-23F2-4396-85F0-8FDB879ED0ED}
It should match the Trusted Installer Service.
Your Security page might now look all grayed out without the possibility to click any buttons. This means the current user (Administrator since you logged in to Target with it) does not have permission to update the settings.
In order to fix this permissions problem, we need to go back to regedit. Jump to the section Fix TrustedInstaller service registry key permissions. If your Security page does not look grayed out, jump to Set TrustedInstaller service permissions.
HKEY_CLASSES_ROOT\AppID\{752073A2-23F2-4396-85F0-8FDB879ED0ED}
Now we open dcomcnfg again to see if we have access to the Security tab. Open the Security tab for TrustedInstaller Service described under Find the TrustedInstaller application in dcomcnfg headline.
It should no longer be grayed out.
Now we will add launch and access permissions for wmiuser on the TrustedInstaller service. The Security tab should look like this:
Now we need to restart the Trusted Installer service to make sure the changes are applied.
This is optional but probably good practice: To restore ownership of the registry key to TrustedInstaller we need to find the key for the AppID in the registry restore TrustedInstaller as owner.
HKEY_CLASSES_ROOT\AppID\{752073A2-23F2-4396-85F0-8FDB879ED0ED}
Now we have updated the permissions for launching the TrustedInstaller Service so that wmiuser has launch and activation permissions. The final step is to try it out. Open a PowerShell prompt on the Client system and run the following:
Get-WmiObject -Class Win32_QuickFixEngineering -ComputerName Target -Credential apmclu\wmiuser
You should now get back a list of installed QFE. It should be the same list returned when you ran the command as an administrator.
Source Description HotFixID InstalledBy InstalledOn
------ ----------- -------- ----------- -----------
Target Update KB2843630 NT AUTHORITY\SYSTEM 11/14/2013 12:00:00 AM
Target Update KB2884101 NT AUTHORITY\SYSTEM 11/14/2013 12:00:00 AM
Target Security Update KB2888505 NT AUTHORITY\SYSTEM 4/4/2017 12:00:00 AM
If you still are missing information, make sure that UAC is not filtering the results. See step 5 in Setting WMI access through Active Directory & Group Policy Object.
Currently, we do not have instructions on how to implement these changes through a GPO but if and when we do they will become available here.