22. november 2022

Skift fra Public til Privare network (Powershell)

Sommetider starter Windows servere op med Public Network og er derfor ikke kontaktbar (pga. firewall indstillinger)

Dette kan som regel løses ved at genstarte Network Location Awareness servicen.
Sæt den herefter til "Delayed start" og alle 3 recovery til "Restart service"

Powershell

Get-NetConnectionProfile


If you have only one network connection you can change the profile to private by typing:

Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory Private


If you have multiple network interfaces and would like to change a specific adapter use the Interface Index Property like this:

Set-NetConnectionProfile -InterfaceIndex 3 -NetworkCategory Private


The same command also works to switch back to a public profile

Set-NetConnectionProfile -InterfaceIndex 3 -NetworkCategory Public