以LocalSystem权限执行时Powershell 进程卡死 1


用Task Scheduler定义执行一段Powershell脚本,用LocalSystem执行的,结果发现进程经常卡死。

后来发现可以使用 -noProfile 强制执行时候不依赖当前用户的profile,卡死的问题就解决了。

%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -InputFormat None -ExecutionPolicy Bypass .\Scripts\YourScript.ps1
本文链接: https://www.pstips.net/powershell-process-gets-stuck-when-under-localsystem-account.html
请尊重原作者和编辑的辛勤劳动,欢迎转载,并注明出处!

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

一条评论 “以LocalSystem权限执行时Powershell 进程卡死