Difference between revisions of "Windows Firewall"

From UVOO Tech Wiki
Jump to navigation Jump to search
 
Line 4: Line 4:
 
Get-NetFirewallProfile -Name Private | Get-NetFirewallRule | select -first 3 -property action,direction
 
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
  }
}

Ref