Skip to main content

Windows 10 - Changing network profile from public to private

Sometimes you need to make sure that your network profile are defined as “Private”, for instance when you want to connect to the computer with Remote desktop, or other firewall related configurations.

First time you connect to a network you will get a pop up that actually are asking you if you want the network to be used as a “Private” or “Public” network, it just ask in a bit “confusing” way.

(Domain profile” are only available for domain joined computers and will be automatic selected if there is a domain controller on the network).



 

If you select “No” or if you do not select anything, it will be set as a “Public” network. You will not be asked again, even if you do not answer anything.
The “Network and Sharing Center” will show it as a “Public network”

 

Changing it is easy as long as you know where to look or how to do it, but it is not located in the most obvious place.
You can do the changes from the graphical interface or the cool way that attracts the girls, the PowerShell way.
 

The Graphical Way

Go to setting on the “start menu”


 
Select “Network & Internet”

 

Select “Wi-Fi” of “Ethernet” based on the network type you are connected too. And then select “HomeGroup”
 

A faster way is to just type “HomeGroup” in the “start menu” and you will go directly in there
 
Event on a domain joined computer where “Homegroup” have been disabled you can select “Change network location”


You can now select “Yes” on the “Network profile wizard”
 
And now the network will now show up as a “Private network” in “Network and Sharing Center”




Going the other way from “Private” to “Public” profiles can be done by deleting/forgetting the network.
In Setting – “Network & Internet” – “Wi-Fi” select “Manage Wi-Fi Setting”


Select the network and press “Forget”
If you want to be cool and do it from command a prompt (elevated as administrator), you can do it with following commands.
To get the name of the network:
Netsh wlan show profiles
To delete the profile:
Netsh wlan delete profile name=”Getbox-xxxxx”
 

The Powershell way

The easiest and fastest way of doing this are with PowerShell.

To get info about the active network profile:

Get-NetConnectionProfile

To set the desired network category:

Set-NetConnectionProfile -NetworkCategory Private   (Or Public)  

Or combine them into:

Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory Private
 
 
 
A big thanks too Jan Egil Ring PowerShell MVP for getting me the lines
 

 

Popular posts from this blog

Changing Windows product key (license) for a MDT OS deployment task

Creating a new OS deployment task in MDT you will be asked to specify product key


That’s easy enough, but what if you type in the wrong key or just want to change it (add it) later? You might even have gotten a new MAK.

That is not as easy, you cannot do it from the graphical interface, you have to do it from one of the configuration files. Well you might to it from graphical interface by typing it in every time deploying a computer gets deployed but that is not a great solution.

MDT - The task sequence has been suspended. LiteTouch is trying to install applications

Every now and then I get this error message when fuelling a computer with MDT:
"The task sequence has been suspended. LiteTouch is trying to install applications. This cannot be performed in Windows PE."

How to get and use the Windows key from UEFI/BIOS

I found myself in the situation that I needed to get the Windows key out from the ACPI in the UEFI bios and preferable get to use it in a task sequence in MDT.

There are different ways of doing this, but I wanted to do this with little code and easy to understand.
There is a nice tool created to get the key on github, created by Christian Korneck, called get_win81key. This tool gives you the key in plane text. You can get it
HERE: https://github.com/christian-korneck/get_win8key


If I were supposed to do this manually, I now would just take that key and type it in with slmgr command or in the GUI. But I want to do this within a task in MDT.
Testing a couple of solutions without using the get_win8key with my great scripting guru colleague HÃ¥vard ( www.grondal.me) and figuring out that it cannot be done with default powershell stuff, it needs more code. Therefore, we quickly figured out that some use of the “get_win8key” files is the easiest way, but we need a way of setting the output fro…