我的公司推出了一项新的软电话服务,通过GPO成功地安装到每台机器上。问题是,软件安装在用户配置文件中,用户配置文件要求允许通过windows defender防火墙访问,而我很难允许需要管理员凭据的访问。像%localappdata%或%userprofile%这样的变量在GPO中不起作用。启动脚本不起作用,因为它将防火墙规则放在管理配置文件下。登录脚本不起作用,因为它需要管理员权限来添加新的新防火墙规则。
$username = $env:username
New-NetFirewallRule -Displayname "Five9Softphone" -Direction Inbound -Program C:\Users\$username\appdata\local\Five9\Five9Softphone-10.0\bin\10.2.16\five9softphone.exe这在运行任何管理用户时都是有效的,而不是我的普通用户。请帮帮我!
发布于 2019-06-26 17:56:22
您可以运行如下内容:
$profiles = Get-ChildItem -Path 'C:\Users' -Directory
Foreach ($profile in $profiles) {
$ExePath = Join-Path -Path $profile.Fullname -ChildPath 'appdata\local\Five9\Five9Softphone-10.0\bin\10.2.16\five9softphone.exe'
if (!(Get-NetFirewallApplicationFilter -Program $ExePath)) {
New-NetFirewallRule -Displayname "Five9Softphone" -Direction Inbound -Program $ExePath
}
}https://stackoverflow.com/questions/56777495
复制相似问题