积极答复者
求教,域控制器的组策略添加logoff脚本用于安装软件,Win7成功,Win10失败

问题
-
求教各位大佬,域控制器的组策略添加logoff脚本用于安装软件,Win7成功,Win10失败。
PowerShell组策略中已经允许运行所有脚本。使用gpresult命令,也可以看到组策略已经应用到Win10客户端。
脚本很简单,用于安装微信企业版:
$UserName = 'domain\user' $Password = ConvertTo-SecureString 'password' -AsPlainText –Force $Cred = New-Object System.Management.Automation.PSCredential($UserName,$Password) $ReportFile = '\\DC\Software\WXWork\Report.csv' $ShareFolder = "\\DC\Software\WXWork\WXWork_2.7.0.1558.exe" $FileServer = 'DC' $SoftwareFolder = "C:\WXWorkTemp" New-Item -Name WXWorkTemp -ItemType Directory -Path 'C:\' -Force -Credential $Cred Copy-Item -Path $ShareFolder -Destination $SoftwareFolder -Container -Recurse -Force Get-Process -Name *WeChat*, *WXWork* | Stop-Process -Force Start-Process $ShareFolder -ArgumentList "/S" -Wait -Credential $Cred Remove-Item -Path 'C:\WXWorkTemp' -Force -Recurse -Credential $Cred
答案
-
你好,
1. 在有问题的机器上,在 “%windir%\debug\”目录下创建“usermode”文件夹。
2. 创建以下注册表键值:
在 HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion 路径下创建"Diagnostics" key。
3. 在"Diagnostics"key下创建一个新的值“GPSvcDebugLevel”
Entry: GPSvcDebugLevel
Type: REG_DWORD
Value data: 30002 (Hexadecimal)
4. 然后重新运行“gpupdate /force”
5. 在客户端检查C:\windows\debug\usermode\gpsvc.log
6. 在客户端,事件查看器中,“Applications and Services Logs” - “Microsoft” - “Windows” - “Group Policy” - Operational Event log
最好的祝福,
Lee
Just do it.
- 已标记为答案 npc.xiao 2019年10月29日 2:14
全部回复
-
你好,
1. 在有问题的机器上,在 “%windir%\debug\”目录下创建“usermode”文件夹。
2. 创建以下注册表键值:
在 HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion 路径下创建"Diagnostics" key。
3. 在"Diagnostics"key下创建一个新的值“GPSvcDebugLevel”
Entry: GPSvcDebugLevel
Type: REG_DWORD
Value data: 30002 (Hexadecimal)
4. 然后重新运行“gpupdate /force”
5. 在客户端检查C:\windows\debug\usermode\gpsvc.log
6. 在客户端,事件查看器中,“Applications and Services Logs” - “Microsoft” - “Windows” - “Group Policy” - Operational Event log
最好的祝福,
Lee
Just do it.
- 已标记为答案 npc.xiao 2019年10月29日 2:14