Forum Discussion

ABill1's avatar
ABill1
Iron Contributor
Oct 24, 2023
Solved

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...
  • Harm_Veenstra's avatar
    Harm_Veenstra
    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

    } 

Resources