Forum Discussion
ABill1
Oct 24, 2023Iron Contributor
Powershell as win32 not working
Hello everyone, I've been working on deploying a script to prevent a user from using Chrome: # Check if the script is running with administrator privileges if (-not ([Security.Principal.Wind...
- Oct 25, 2023
ABill1 Like this:
# Check if the "Block Chrome" firewall rule exists
$rule = Get-NetFirewallRule -DisplayName "Block Chrome"
if ($rule) {
Write-Host "Firewall rule 'Block Chrome' already exists."
Exit 0
} else {
Write-Host "Firewall rule 'Block Chrome' does not exist."
Exit 1}
ABill1
Oct 25, 2023Iron Contributor
Hi, So what would it look like?
Oct 25, 2023
ABill1 Like this:
# Check if the "Block Chrome" firewall rule exists
$rule = Get-NetFirewallRule -DisplayName "Block Chrome"
if ($rule) {
Write-Host "Firewall rule 'Block Chrome' already exists."
Exit 0
} else {
Write-Host "Firewall rule 'Block Chrome' does not exist."
Exit 1
}