通过官方PowerShell脚本应用Shell Launcher配置失败求助
通过官方PowerShell脚本应用Shell Launcher配置失败求助
各位好,我现在碰到个Shell Launcher配置的问题,想请大家帮忙看看。
我需要给一批PC配置Shell Launcher,目前先在一台测试机上做验证。我已经跟着官方文档完成了XML配置文件的编写,但在用文档里提供的PowerShell脚本应用配置时出现了错误,脚本执行到Set-CimInstance那一步就卡壳了,只提示部分错误信息,看不到完整内容,也搞不清问题出在哪。
我用的官方脚本大致是这样的:
$shellLauncherConfiguration = @" # content of the XML configuration file "@ $namespaceName="root\cimv2\mdm\dmmap" $className="MDM_AssignedAccess" $obj = Get-CimInstance -Namespace $namespaceName -ClassName $className $obj.Configuration = [System.Net.WebUtility]::HtmlEncode($shellLauncherConfiguration) $obj = Set-CimInstance -CimInstance $obj -ErrorVariable cimSetError -ErrorAction SilentlyContinue if($cimSetError) { Write-Output "An ERROR occurred. Displaying error details:" Write-Output $cimSetError }
(注:我把原本截断的错误输出逻辑补全了,方便大家理解)
有没有大佬能指点下我该从哪些方面排查问题?比如权限、XML格式、脚本本身的逻辑之类的?
备注:内容来源于stack exchange,提问作者gbos
相关产品推荐
相关产品推荐

