Search code examples
powershellwmidcom

How to change AuthenticationLevel attribute from Win32_DCOMApplicationSetting class using powershell?


I'm trying to change the AuthenticationLevel attribute from Win32_DCOMApplicationSetting using the following poweshell code:

$wmi = Get-WMIObject -Class Win32_DCOMApplicationSetting -Filter "AppID='{00020906-0000-0000-C000-000000000046}'" -EnableAllPrivileges
$wmi.AuthenticationLevel = 1

The script runs without errors, but the change isn't applyed in DCOM configurations.

I appreciate any help.


Solution

  • I solved it!

    Just call the put method from $wmi instance.

    $wmi = Get-WMIObject -Class Win32_DCOMApplicationSetting -Filter "AppID='{00020906-0000-0000-C000-000000000046}'" -EnableAllPrivileges
    $wmi.AuthenticationLevel = 2
    $wmi.put()