Skip to main content
Jorge Bernhardt Jorge Bernhardt
  1. Posts/

How to force a network profile in Windows using PowerShell

·184 words·1 min· 100 views · 5 likes ·
Get-NetConnectionProfile Microsoft Microsoft Windows PowerShell

Windows classifies the networks into three different types: public, private and domain, and this allows different firewall configurations to be applied according to the established profile. If you want to force a network to be of a different profile, my recommendation is that you use PowerShell. This time we will use the cmdlet Set-NetConnectionProfile.

 Set-NetConnectionProfile
To establish a network profile with PowerShell, use the Set-NetConnectionProfile cmdlet with the following syntax:

Set-NetConnectionProfile `
    -Name <String[]> `
    -InterfaceIndex <UInt32[]> `
    -NetworkCategory <NetworkCategory>

The Get-NetConnectionProfile cmdlet gets a connection profile associated with the physical network adapters. A connection profile represents a network connection.

Get-NetConnectionProfile

Get-NetConnectionProfile
Run the PowerShell console as administrator, and then type:

Set-NetConnectionProfile `
    -InterfaceIndex 9 `
    -NetworkCategory Private

This command set the network category, using the -InterfaceIndex parameter.

Set-NetConnectionProfile
It is important to know that you can not set the DomainAuthenticated type by using this cmdlet. The computer automatically sets the Domain value when the network is authenticated to a domain controller.

Thanks for reading my post. I hope you find it useful.

If you want to know more about the Set-NetConnectionProfile cmdlet, check out this link.