我正在尝试更改大约 100 台装有 Windows 10 Pro/DC 2012 R2 的计算机的 Wmi 安全描述符。我发现在我的案例中可以使用以下方法:微软
使用域管理员帐户在 Windows 10 计算机上本地执行这些步骤没有得到预期的结果。命名空间的导出工作正常,但使用脚本更改描述符根本没有效果。导出命令:
wmic /namespace:\\root\CIMV2 /output:sd.txt path __systemsecurity call getSD
导入脚本:
arrSD = array(1,0,4,129,148,0,0,0,164,0,0,0,0,0,0,0,20,0,0,0,2,0,128,0,5,0,0,0,0,0,36,0,1,0,0,0,1,5,0,0,0,0,0,5,21,0,0,0,216,37,44,114,11,95,44,7,34,199,223,9,83,4,0,0,0,18,24,0,63,0,6,0,1,2,0,0,0,0,0,5,32,0,0,0,32,2,0,0,0,18,20,0,19,0,0,0,1,1,0,0,0,0,0,5,20,0,0,0,0,18,20,0,19,0,0,0,1,1,0,0,0,0,0,5,19,0,0,0,0,18,20,0,19,0,0,0,1,1,0,0,0,0,0,5,11,0,0,0,1,2,0,0,0,0,0,5,32,0,0,0,32,2,0,0,1,2,0,0,0,0,0,5,32,0,0,0,32,2,0,0)
' Connect to WMI and the root namespace.
'
Set objWMI = GetObject("winmgmts:root\CIMV2")
' Get the single __SystemSecurity object in this namespace.
'
Set objSecurity = objWMI.Get("__SystemSecurity=@")
' Change the namespace security.
'
nReturn = objSecurity.SetSD(arrSD)
WScript.Echo “返回值 = ” & nReturn 有什么想法吗?
谢谢