Difference between revisions of "Windows Firewall"
Jump to navigation
Jump to search
(Created page with "``` (Get-NetFirewallProfile -Name Domain | Get-NetFirewallRule | select DisplayName | findstr "Skype" | Measure-Object).Count ((Get-NetFirewallProfile -Name Domain | Get-NetFi...") |
|||
(One intermediate revision by the same user not shown) | |||
Line 2: | Line 2: | ||
(Get-NetFirewallProfile -Name Domain | Get-NetFirewallRule | select DisplayName | findstr "Skype" | Measure-Object).Count | (Get-NetFirewallProfile -Name Domain | Get-NetFirewallRule | select DisplayName | findstr "Skype" | Measure-Object).Count | ||
((Get-NetFirewallProfile -Name Domain | Get-NetFirewallRule | select DisplayName | findstr "Skype" | Measure-Object) | select Count).Count | ((Get-NetFirewallProfile -Name Domain | Get-NetFirewallRule | select DisplayName | findstr "Skype" | Measure-Object) | select Count).Count | ||
+ | Get-NetFirewallProfile -Name Private | Get-NetFirewallRule | select -first 3 -property action,direction | ||
``` | ``` | ||
+ | |||
+ | ``` | ||
+ | function get_vpn_netcat() { | ||
+ | $netcat=(Get-NetConnectionProfile -InterfaceAlias (Get-NetAdapter -Name "*" | Where-Object {$_.InterfaceDescription -Match "^Cisco.*"} | select Name,InterfaceDescription,ifIndex,Status,MacAddress,LinkSpeed).Name).NetworkCategory | ||
+ | if ($netcat -eq "DomainAuthenticated"){ | ||
+ | write-host 1 | ||
+ | }elseif($netcat -eq "Private"){ | ||
+ | write-host 2 | ||
+ | }elseif($netcat -eq "Public"){ | ||
+ | write-host 3 | ||
+ | }else{ | ||
+ | write-host 4 | ||
+ | } | ||
+ | } | ||
+ | ``` | ||
+ | |||
+ | # Ref | ||
+ | - https://social.technet.microsoft.com/Forums/en-US/1d896fe3-5d22-45b1-ab17-393f58d6dc47/internet-nic-wont-change-from-domain-network-to-public?forum=ws16essentials |
Latest revision as of 19:47, 19 November 2020
(Get-NetFirewallProfile -Name Domain | Get-NetFirewallRule | select DisplayName | findstr "Skype" | Measure-Object).Count ((Get-NetFirewallProfile -Name Domain | Get-NetFirewallRule | select DisplayName | findstr "Skype" | Measure-Object) | select Count).Count Get-NetFirewallProfile -Name Private | Get-NetFirewallRule | select -first 3 -property action,direction
function get_vpn_netcat() { $netcat=(Get-NetConnectionProfile -InterfaceAlias (Get-NetAdapter -Name "*" | Where-Object {$_.InterfaceDescription -Match "^Cisco.*"} | select Name,InterfaceDescription,ifIndex,Status,MacAddress,LinkSpeed).Name).NetworkCategory if ($netcat -eq "DomainAuthenticated"){ write-host 1 }elseif($netcat -eq "Private"){ write-host 2 }elseif($netcat -eq "Public"){ write-host 3 }else{ write-host 4 } }