不小心设置了只允许运行PowerShell的软件限制策略
创始人
2025-01-10 10:00:13
0
  1. 打开组策略编辑器:按下Win + R,输入 gpedit.msc,回车。

  2. 在左侧面板中依次展开“计算机配置”、“Windows设置”、“安全设置”、“软件限制策略”。

  3. 在右侧面板中找到限制应用程序执行的条目,然后双击它。

  4. 在打开的对话框中,切换到“执行受限制的应用程序”选项卡。

  5. 如果下面的选项中只有PowerShell.exe被列出,那么说明只允许运行PowerShell。点击“新建”按钮,在弹出的对话框中输入需要允许执行的程序路径和名称,例如:"C:\Windows\system32\notepad.exe",然后确定。

  6. 重新启动计算机,然后再次尝试运行被限制的程序,应该就能够正常运行了。

代码示例(使用PowerShell脚本):

$policyPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\safer\CodeIdentifiers\0\Paths" $notepadAllowedPath = "C:\Windows\system32\notepad.exe"

if (Test-Path $policyPath) { $existingPaths = Get-ItemProperty -Path $policyPath if ($existingPaths -match $notepadAllowedPath) { Write-Output "Notepad is already allowed to run." } else { Write-Output "Adding Notepad to allowed paths." New-ItemProperty -Path $policyPath -Name "C:\Windows\system32\notepad.exe" -Value 1 -PropertyType DWORD } } else { Write-Warning "Software restriction policy is not set." }

相关内容

热门资讯

透视经验!hhpoker有没有... 透视经验!hhpoker有没有作必弊挂(HHpoker透视器)一直有辅助app(哔哩哔哩)1、每一步...
透视烘培!WePOker有没有... 透视烘培!WePOker有没有透视方法(AApoker ai插件)一贯有辅助技巧(哔哩哔哩)1、用户...
透视举措!hhpoker软件安... 透视举措!hhpoker软件安装包(德普之星免费)本来是真的有辅助工具(哔哩哔哩)1、打开软件启动之...
透视窍门!hhpoker是真的... 透视窍门!hhpoker是真的吗(德普之星透视辅助)都是是有辅助方法(哔哩哔哩)运德普之星透视辅助辅...
透视演示!wepoker私人局... 透视演示!wepoker私人局辅助(WPK工具)都是真的是有辅助脚本(哔哩哔哩)透视演示!wepok...
透视要领!wepoker免费透... 透视要领!wepoker免费透视脚本(WePoKer看底牌)果然是有辅助工具(哔哩哔哩)1、实时we...
透视大纲!hh poker软件... 透视大纲!hh poker软件(HHpoker控制)真是有辅助插件(哔哩哔哩);1、hh poker...
透视秘籍!德普之星私人局透视(... 透视秘籍!德普之星私人局透视(德普之星透视辅助)本来存在有辅助脚本(哔哩哔哩)德普之星私人局透视透视...
透视要领!德普之星怎么设置埋牌... 透视要领!德普之星怎么设置埋牌(WPK俱乐部)一直真的是有辅助神器(哔哩哔哩)1)德普之星怎么设置埋...
透视经验!we-poker是什... 透视经验!we-poker是什么软件(AApoker辅助插件)本来真的是有辅助神器(哔哩哔哩)1、玩...