如何使用 powershell 从 Win32_DCOMApplicationSetting class 更改 AuthenticationLevel 属性?

How to change AuthenticationLevel attribute from Win32_DCOMApplicationSetting class using powershell?

我正在尝试使用以下 poweshell 代码从 Win32_DCOMApplicationSetting 更改 AuthenticationLevel 属性:

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

脚本运行没有错误,但更改未应用到 DCOM 配置中。

感谢任何帮助。

我解决了!

只需从 $wmi 实例调用 put 方法。

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