在Intune中创建本地管理员用户帐户失败

时间:2019-08-16 15:56:39

标签: powershell intune

下面的PowerShell脚本在我在一台机器上手动运行时可以正常运行,但是在使用Intune部署时无法运行。它只是显示一个错误。

我已使用带有以下设置的Intune部署了此脚本- (1)使用登录的凭据运行此脚本:。 (2) 强制执行脚本签名检查:。 (3) 在64位PowerShell主机中运行脚本:

通过以管理员身份启动CMD在Windows 10计算机中测试了脚本,它可以正常工作。创建本地帐户(如果不存在),如果存在,则更改密码。

foo

在Intune注册的Windows 10计算机中,我找不到任何事件日志(在DeviceManagement-Enterprise-Diagnostics-Provider下)或MDMDiagnostics日志下的错误。

dic =  {
  "br": "red",
  "comp": "green"
}

fig, axs = plt.subplots(nrows = 4, ncols = 2, sharex = True, sharey = True, figsize = (20,20))
axs = axs.flatten()
for j in range(5):
    axs[j].scatter([i[2] for i in devs[j]], [i[4] for i in devs[j]], c = [dic[str(i[3])] for i in devs[j]])
plt.show()

1 个答案:

答案 0 :(得分:0)

@ mathias-r-jessen建议有效。更改为在64位主机中启动PS,并且可以正常工作。

enter image description here

相关问题