atoato
Goto Top

Win7 firewall list von

hallo
in Win7 kann ich mit dem Befehl

netsh advfirewall firewall show rule status=enabled name=all

zeige alle Rules, die aktiv sind
wie kann ich alle auflisten, die den Status „Block“ haben?
danke
t

Content-Key: 307636

Url: https://administrator.de/contentid/307636

Printed on: April 19, 2024 at 04:04 o'clock

Mitglied: 129813
129813 Jun 19, 2016 updated at 09:45:41 (UTC)
Goto Top
Hi.
you should definitly use powershell for this
Get-NetFirewallRule -Action Block
The netsh > advfirewall context is deprecated and will be removed from the next versions of Windows. So hurry up and use modern scripting languages.

Regards
Member: AtoAto
AtoAto Jun 19, 2016 at 09:00:06 (UTC)
Goto Top
thx but im running win7 on and:

The term 'Get-NetFirewallRule' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was...

br
Mitglied: 129813
129813 Jun 19, 2016 updated at 09:46:02 (UTC)
Goto Top
This cmdlet is only supported on win8.x and above.

In win7 you could pipe the content to findstr and search for the term 'Block' to filter out the rules you want.
Mitglied: 129813
129813 Jun 19, 2016 updated at 09:31:36 (UTC)
Goto Top
You could also use netsh within Powershell to filter out the rules like this.
I have put in the german translation for analysing the output.
((netsh advfirewall firewall show rule name=all status=enabled) | out-string ) -split '(?=Regelname)' | ?{$_ -match 'Aktion:\s+Blockieren'}  
Member: AtoAto
AtoAto Jun 19, 2016 at 09:37:31 (UTC)
Goto Top
awesome, it works

((netsh advfirewall firewall show rule name=all status=enabled) | out-string ) -split 'Rule Name' | ?{$_ -match 'Action:\s+Block'} >c:\Block_Rule.txt

thx
br
Mitglied: 129813
129813 Jun 19, 2016 updated at 09:41:41 (UTC)
Goto Top
And i extra did the translation for nothing, ohh no face-smile
Have a nice sunday.

highload
Member: AtoAto
AtoAto Jun 19, 2016 at 10:00:44 (UTC)
Goto Top
you dont have to worry at all, ;)
have a great weekend too