When I run the below PowerShell command on a Windows Server 2016 Standard host I get the following error:
Get-WmiObject -query ('SELECT * FROM Win32_DCOMApplicationSetting WHERE AppId = "{00020906-0000-0000-C000-000000000046}"') -EnableAllPrivileges
Get-WmiObject : Invalid class "Win32_DCOMApplicationSetting"
At line:1 char:1
+ Get-WmiObject -query ('SELECT * FROM Win32_DCOMApplicationSetting WHE ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidType: (:) [Get-WmiObject], ManagementException
+ FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
The host has Microsoft Office 2016 installed and the AppId GUID refers to the Microsoft Excel Application DCOM application.
I have several other identical hosts, and the command completes successfully on those. What might be causing the problem on this host?
Get-WmiObject -Namespace "root\cimv2" -List | Where-Object { $_.Name -like "*DCOM*" }or not. Maybe the DCOM is removed or not registered for excel. You can also check indcomcnfgWmicmdlets have been deprecated since Powershell 3, use theCimones instead learn.microsoft.com/en-us/powershell/scripting/learn/ps101/…