The following PowerShell script provides a way to change network profiles.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # Run as Administrator # Get all network profiles set as public $publicNetworks = Get-NetConnectionProfile | Where-Object { $_ .NetworkCategory -eq "Public" } if ( $publicNetworks ) { foreach ( $network in $publicNetworks ) { try { Set-NetConnectionProfile -InterfaceIndex $network .InterfaceIndex -NetworkCategory Private Write-Host "Network $($network.Name) changed to Private." } catch { Write-Error "Failed to change network $($network.Name) to Private." } } } |
0 Comments