โ07-15-2022 03:14 AM
I've started at a new company recently who use JumpCloud, so I'm also extremely new to JumpCloud.
Our staff are using a new app which needs to get through the Windows 10 firewall. I've written a powershell script that works perfectly on my PC.
I've added it as a Command under Device Management, uploaded the approprirate CSV, created a group and bound a couple of laptops to it.
It executes on my laptop with no issue, when I run the cmd from the portal my laptop received the updated firewall rules within a couple of minutes. For another test user it does not deploy. I'm assuming this may be because I have admin rights on my laptop, but I also assumed the JumpCloud Agent would run the script locally with admin rights?
Any advice would be appreciated!
The script:
Set-ExecutionPolicy Unrestricted -force
Install-Module -Name Firewall-Manager
Import-Module Firewall-Manager
Remove-NetFirewallRule -DisplayName "app.exe"
Import-FirewallRules "C:\Windows\Temp\appfw.csv"
Solved! Go to Solution.
โ07-19-2022 01:31 AM
Figured it out. Checking the Results tab of the Command section I could see that the script was failing with error:
"user declined to install module Firewall-Manager".
Added the -force switch to a couple of lines of code, and it now runs without any issues:
Set-ExecutionPolicy Unrestricted -force
Install-Module -Name Firewall-Manager -force
Import-Module Firewall-Manager -force
Remove-NetFirewallRule -DisplayName "app.exe"
Import-FirewallRules "C:\Windows\Temp\appfw.csv"
โ07-15-2022 10:56 AM
Hello @paul-mb ,
JumpCloud has a very granular policy for Windows Firewall (local). Would it be helpful to use the pre-built policy?
I'm flagging this with a colleague to address your PowerShell question.
-d
โ07-16-2022 10:04 AM
Hi JC,
Thanks for replying. As I'm so new to JumpCloud I'm not sure if this will work. I'm not sure if my powershell solution is best practice or not though! Happy to be advised otherwise.
I just need to add an exception for one application (a softphone app) which is hosted in the C:\users\%userprofile%\appdata\Remote\ folder
Cheers,
Paul
โ07-19-2022 01:31 AM
Figured it out. Checking the Results tab of the Command section I could see that the script was failing with error:
"user declined to install module Firewall-Manager".
Added the -force switch to a couple of lines of code, and it now runs without any issues:
Set-ExecutionPolicy Unrestricted -force
Install-Module -Name Firewall-Manager -force
Import-Module Firewall-Manager -force
Remove-NetFirewallRule -DisplayName "app.exe"
Import-FirewallRules "C:\Windows\Temp\appfw.csv"
New to the site? Take a look at these additional resources:
Ready to join us? You can register here.