Как изменить профиль сети в windows server 2019

При подключении к новой сети Windows предлагает вам выбрать ее тип (профиль или сетевое расположение): Public network (общедоступная) или Private (частная). Сетевые профили Windows являются частью Microsoft Defender Firewall и позволяют применять различные правила брандмауэра в зависимости от типа сети, к которой подключен компьютер. В зависимости от примененного профиля для вашего сетевого подключения, другие компьютеры могут видеть или не видеть ваш компьютер в сети (настройки сетевого обнаружения), использовать общие папки и сетевые принтеры.

В этой статье мы рассмотрим, как в Windows (и Windows Server) изменить назначенный профиль сети с “общедоступной” на “частную” и наоборот.

Содержание:

  • Типы (профили) сети в Windows
  • Как изменить профиль для сетевого подключения в Windows?
  • Изменить тип сети с Public на Private с помощью PowerShell
  • Изменить тип сети в реестре Windows
  • Сменить профиль сети через политику безопасности
  • Слетает доменный профиль сети на частную в Windows Server

Типы (профили) сети в Windows

Сетевому подключению в Windows (будь то Ethernet или Wi-Fi) можно назначить один из трех сетевых профилей.

  • Частная или домашняя сеть (Private) – профиль для доверенной сети (домашняя или рабочая сеть в офисе). В такой сети компьютер будет доступен для обнаружения другими устройствами, на нем можно использовать службы общего доступа к сетевым файлам и принтерам;
  • Общедоступная (общественная) сеть (Public / Guest) – профиль для недоверенной сети (кафе, публичная Wi-Fi сеть в метро, аэропорту). Вы не доверяете другим устройствам в такой сети, ваш компьютер будет скрыт для других устройств, нельзя получить удаленный доступ к опубликованным у вас сетевым папкам и принтерам;
  • Доменная сеть (Domain) – сетевой профиль для компьютеров, которые присоединены в домен Active Directory. Применяется автоматически после добавления Windows в домен. Для этого профиля вы можете применять доменные политики брандмауэра.

В зависимости от типа сети, к сетевому интерфейсу применяются разные правила брандмауэра Windows.

В Windows 10 и 11 вы можете увидеть текущий профиль, который назначен сетевому подключению, в меню Settings -> Network and Internet (команда быстрого доступа
ms-settings:network
). Сетевому интерфейсу Ethernet0 в моем примере назначен профиль Public.

просмотр назначенного типа сети в Windows

В классической панели управления Windows тип сети для активных сетевых подключений отображается здесь: Control Panel\All Control Panel Items\Network and Sharing Center.

профиль сети public в настройках панели управления windows 10

Профиль сети в Windows 10 выбирается пользователем при первом подключении к новой сети. Появляется запрос:

Network_name
Вы хотите разрешить другим компьютерам и устройствам в этой сети обнаруживать ваш ПК.
Рекомендуется делать это в домашней или рабочей сети, а не в общедоступных.

Если выбрать “Да”, сети присваивается профиль Private (домашняя), если “Нет” – public (общедоступная). При следующем подключении к этой же самой LAN или WiFi сети автоматически назначается выбранный ранее профиль.

Вы можете скрыть мастер подключения к новым сетям (Network Location wizard) в Windows. Для этого откройте редактор реестра и создайте раздел HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Network\NewNetworkWindowOff. После этого все новые сети при подключении будут определяться как общедоступные (Public).

reg add "HKLM\SYSTEM\CurrentControlSet\Control\Network\NewNetworkWindowOff" /f

В Windows вы можете сбросить все настройки и профили для всех сохраненных сетей, выбрав Параметры -> Сеть и Интернет -> Состояние -> Сброс сети. Перезагрузите компьютер.

сброс сети Windows 10

Теперь при подключении к сети опять появится запрос о включении сетевого обнаружения.

Как изменить профиль для сетевого подключения в Windows?

Вы можете изменить тип сети в Windows из современной панели управления Параметры: перейдите в раздел «Сеть и Интернет» -> «Состояние» -> Откройте свойства вашего сетевого подключения.

Здесь можно переключить сетевой профиль с Public на Private и наоборот.

изменить общедоступную сеть на частную в Windows 10

В Windows Server 2022/2019 опция Properties отсутствует на вкладке Status. Поэтому нужно в секции Network and Internet выбрать раздел Ethernet (или раздел Wi-Fi если в Windows Server включена поддержка беспроводных сетей). Выберите ваше подключение к сети.

сменить тип сетевого подключения в windows server

В классической панели управления Windows отсутствуют настройки для смены типа профиля сетевого подключения.

Также вы не можете сменить профиль на компьютере в домене AD. Для сетевого подключения к домену всегда будет использоваться профиль Domain.

Изменить тип сети с Public на Private с помощью PowerShell

В Windows 10/11 и Windows Server 2022/2019/2016 вы можете управлять профилями сетевых подключений из PowerShell. Запустите консоль PowerShell с правами администратора.

Выведите список сетевых интерфейсов Windows и применённые к ним сетевых профилей:

Get-NetConnectionProfile

В моем примере на компьютере имеется 4 сетевых подключения, с разными типами сетей (NetworkCategory: Public, Private и DomainAuthenticated).

Get-NetConnectionProfile

Чтобы изменить профиль сети, нужно указать номер сетевого интерфейса, назначанный сетевому адаптеру (InterfaceIndex). В этом примере InterfaceIndex = 19.

Name : Неопознанная сеть
InterfaceAlias : Ethernet 3
InterfaceIndex : 19
NetworkCategory : Public
IPv4Connectivity : NoTraffic
IPv6Connectivity : NoTraffic

Чтобы изменить тип сети для сетевого интерфейса с индексом 19 на Private, выполните команду:

Set-NetConnectionProfile -InterfaceIndex 19 -NetworkCategory Private

Проверим, что профиль сети изменился:

Get-NetConnectionProfile -InterfaceIndex 19

Set-NetConnectionProfile изменить профиль сети с public на private в powershell

Windows Defender Firewall автоматически применит к сетевому подключению правила в соответствии с назначенным профилем без перезагрузки.

По аналогии вы можете изменить местоположение сети на Public:

Set-NetConnectionProfile -InterfaceIndex 19  -NetworkCategory Public

Или доменный:

Set-NetConnectionProfile -InterfaceIndex 19 -NetworkCategory DomainAuthenticated

Также вы можете изменить профиль сети сразу для всех сетевых адаптеров компьютера:

Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory Private

На компьютерах в домене вы не сможете изменить профиль сетевого подключения с доменного на частный или публичный. Проверьте, что ваш компьютер добавлен в домен AD:

Get-CimInstance -ClassName Win32_ComputerSystem).PartOfDomain

Попробуйте изменить сетевой профиль:

Set-NetConnectionProfile -InterfaceIndex 19  -NetworkCategory Public –Verbose

Появится ошибка:

Set-NetConnectionProfile : Unable to set the NetworkCategory due to one of the following possible reasons: not running PowerShell elevated; the NetworkCategory cannot be changed from 'DomainAuthenticated'; user initiated changes to NetworkCategory are being prevented due to the Group Policy setting 'Network List Manager Policies'.

Set-NetConnectionProfile - нельзя сменить тип для доменной сети

Изменить тип сети в реестре Windows

Вы можете изменить тип сети через редактора реестра. Для этого нужно запустить regedit.exe и перейти в раздел HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles, в котором хранятся профили всех сетевых подключений. Для каждого сетевого подключения здесь присутствует отдельная ветка реестра с именем в формате GUID {xxxxxxxx-xxxx-……..}).

Чтобы найти нужную вам сеть, нужно просмотреть все ветки реестра и найти раздел, в котором указано имя нужной вам сети из панели управления (или значение Name из команды Get-NetConnectionProfile). В нашем случае компьютер подключен к сети Network 4.

изменить тип сети в windows с public на private через реестр

Имя сети указано в строковом параметре реестра ProfileName. Тип сети задается в параметре Category. Доступны следующие значения этого ключа:

  • 0 — Общественная сеть (Public Network)
  • 1 — Частная сеть (Private Network)
  • 2 — Доменная сеть (Domain Network)

Чтобы изменить тип сети, просто вручную изменить значение параметра Category. Перезагрузить компьютер чтобы применить изменения.

Сменить профиль сети через политику безопасности

Еще один способ смены типа сети — редактор локальной политики безопасности (Local Security Policy).

Запустите оснастку secpol.msc и перейдите в раздел Network List Manager Policies (Политики диспетчера списка сетей). В списке сетей справа найдите сеть по ее имени в Центре управления сетями. Откройте свойства сети и перейдите на вкладку Network Location, измените тип сети на Private и сохраните изменения. Чтобы пользователи не могли сменить профиль сети, выберите дополнительно опцию “User cannot change location” (Пользователь не может изменить расположение).

Network List Manager Policies задать тип сети в windows 10 через политику безопасности

Примечание. Если сервер или компьютер включены в домен, изменить тип сети на другой нельзя, при перезагрузке тип все равно сменится на Domain Network.

Слетает доменный профиль сети на частную в Windows Server

В новых версиях Windows Server 2022/2019 периодически встречается глюк, когда на доменном сервере (или даже контроллере домена) тип сети сам меняется с доменной на частную после перезагрузки.

Для решения проблемы достаточно перезапустить службу Network Location Awareness (из консоли
services.msc
) или командой:

Get-Service NlaSvc| Restart-Service -Force
(запускать от имени SYSTEM)

Чтобы служба Network Location Awareness при загрузке компьютера загружалась немного позже, можно задать для нее отложенный тип запуска. Для этого в свойствах службы нужно выбрать опцию Automatic (Delayed Start).

служба Network Location Awareness используется для определения типа сети

Проверьте, что после перезагрузки тип сети в Windows Server всегда определяется как доменный (вместо private).

Если проблема возникает на контроллере домена Active Directory, нужно изменить зависимости службу NlaSvc, чтобы она запускалась после службы DNS Server:

sc config nlasvc depend=DNS

Также в некоторых случаях вам может помочь принудительное указание DNS суффикса вашего домена в настройках сетевого адаптера (сетевой адаптера -> TCP/IPv4 -> Advanced -> DNS, укажите имя вашего домена в поле DNS suffix for this connection и проверьте, что включена опция «Use this connection’s suffix in DNS registration».

задать DNS суффикс для сетевого подключения

При подключении к новой сети Windows предлагает выбрать её тип: Общедоступная или Частная сеть. Профили сети в Windows являются частью Microsoft Defender Firewall и помогают применять разные правила брандмауэра в зависимости от профиля. В этой статье разберём, как сменить профиль сети с «общедоступной» на «частную» и наоборот.

Приобрести оригинальные ключи активации Windows всегда можно у нас в каталоге от 1099 ₽

Типы (профили) сети в Windows

Каждое подключение в Windows (будь то Ethernet или Wi-Fi) может быть отнесено к одному из профилей сети:

Частная сеть — для домашней или рабочей сети. Устройства видят ваш компьютер, доступен общий доступ к файлам и принтерам.

Общедоступная сеть — для недоверенных мест (кафе, аэропорт). Компьютер скрыт от других устройств, и сетевые папки недоступны.

Доменная сеть — для компьютеров, добавленных в домен Active Directory.

Профиль назначается автоматически при первом подключении. Чтобы повторно выбрать профиль для сети, выполните действия ниже.

Изменение профиля для сети в Windows

Панель параметров Windows

1. Откройте ПараметрыСеть и ИнтернетСостояние.

2. Перейдите к Свойствам сетевого подключения.

3. Выберите нужный профиль: Частная сеть или Общедоступная сеть.

Примечание: В Windows Server 2022/2019 пункт Свойства находится в разделе Ethernet (или Wi-Fi, если активированы беспроводные сети).

В Windows вы можете сбросить все настройки и профили для всех сохраненных сетей, выбрав Параметры > Сеть и Интернет > Дополнительные сетевые параметры > Сброс сети. Перезагрузите компьютер.

Изменение профиля сети с помощью PowerShell

Для управления профилями сетевых подключений можно воспользоваться PowerShell. Запустите консоль от имени администратора и введите:

1. Просмотрите список сетевых подключений, в нашем примере на компьютере имеется 4 сетевых подключения, с разными типами сетей:

Get-NetConnectionProfile

2. Найдите индекс (InterfaceIndex) нужного сетевого интерфейса, в нашем случае это 19.

3. Измените профиль для подключения на Частная сеть:

Set-NetConnectionProfile -InterfaceIndex 19 -NetworkCategory Private

4. Если необходимо вернуть Общедоступная сеть, выполните:

Set-NetConnectionProfile -InterfaceIndex 19 -NetworkCategory Public

5. Проверим, что профиль сети изменился:

Get-NetConnectionProfile -InterfaceIndex 19

Брандмауэр Windows Defender автоматически применит правила для сетевого подключения в соответствии с назначенным профилем без необходимости перезагрузки системы.

По аналогии, можно изменить тип сети на Общедоступная с помощью команды:

Set-NetConnectionProfile -InterfaceIndex 19 -NetworkCategory Public

или на Доменная сеть:

Set-NetConnectionProfile -InterfaceIndex 19 -NetworkCategory DomainAuthenticated

Также вы можете изменить профиль сети для всех сетевых адаптеров компьютера одновременно:

Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory Private

На устройствах в домене изменить профиль сетевого подключения с доменного на частный или общедоступный невозможно. Чтобы проверить, добавлен ли компьютер в домен AD, используйте команду:

(Get-CimInstance -ClassName Win32_ComputerSystem).PartOfDomain

Попробуйте изменить сетевой профиль:

Set-NetConnectionProfile -InterfaceIndex 19 -NetworkCategory Public -Verbose

Появится сообщение об ошибке, так как смена доменного профиля невозможна.

Изменение типа сети в реестре Windows

1. Откройте regedit.exe и перейдите в HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles.

2. Найдите GUID сети (в формате {xxxxxxxx-xxxx-……..} ), указанный в поле ProfileName.

3. Измените значение параметра Category на:

0 — Общедоступная сеть

1 — Частная сеть

2 — Доменная сеть

Перезагрузите компьютер, чтобы применить изменения.

Смена профиля через политику безопасности

Редактор локальной политики безопасности позволяет указать профиль сети:

1. Откройте secpol.msc и выберите Политики диспетчера списка сетей.

2. Найдите нужную сеть, откройте её свойства, перейдите на вкладку Сетевое расположение и выберите Частная сеть (Личное).

Примечание: для доменных компьютеров этот профиль сменить нельзя, так как при перезагрузке он вернётся на Доменная сеть.

Проблемы с доменным профилем в Windows Server

Иногда на Windows Server 2022/2019 профиль сети самопроизвольно меняется с доменного на частный. Решить это можно перезапуском службы Сведения о расположении в сети (NlaSvc):

Get-Service NlaSvc | Restart-Service -Force

Чтобы настроить отложенный запуск для службы NlaSvc, измените её параметры на Автоматически (отложенный запуск).

Для контроллеров домена добавьте зависимость службы NlaSvc от DNS:

sc config nlasvc depend=DNS

Также в некоторых случаях вам может помочь принудительное указание DNS суффикса вашего домена в настройках сетевого адаптера (сетевой адаптера -> TCP/IPv4 -> Дополнительно -> DNS, укажите имя вашего домена в поле DNS-суффикс подключение и проверьте, что включена опция Использовать DNS-суффикс подключения при регистрации в DNS.

Эти действия помогут управлять сетевыми профилями и решат проблему со сменой сетевого профиля в Windows Server.

Windows 10

In this article, I will explain how to switch a network profile from public to private on Windows 10 and Windows Server 2019. First, here’s a quick primer on the different types of network profiles on Windows computers (clients and servers). If you are not familiar with these profiles, I encourage you to read this section so you have a better understanding of the purpose of these profiles before learning how to switch between them.

What are Network Profiles?

Windows computers have three types of network profiles: Private, Domain, and Guest or Public.

  1. Private
    A private profile is meant for a computer at home or work connected to a private, internal network. This computer is part of a Workgroup and is not connected to the Active Directory domain. For private networks you can turn on Network Discovery as well as File & Print Sharing so that other computers can easily find your computer and access network shares and other resources that you have shared on your private network, such as network shares, printers, and scanners. If your computer is part of a business network, but is running in a Workgroup, rather than a domain, then your settings would depend on the security requirements.
  2. Domain
    A domain profile is designed for computers in a business network that have “joined” the Active Directory domain. This offers a much higher level of security and authentication for users and devices. For domain networks the Network Discovery and File & Print Sharing may or may not be turned on. These settings are determined by the network administrators and depend on how your network is configured. The domain profile is only applicable when a computer has joined a Windows domain, which is usually the case in a  business environment. Did you notice that I used the word applicable, rather than visible? That’s because users can’t switch their profile on a domain-joined computer so the option to switch to another profile doesn’t apply and therefore it isn’t visible. However, you can go to the Control Panel and configure a couple of options under Change advanced sharing options for your domain profile.
  3. Guest or Public
    A guest or public profile is designed for public networks that are not secure. This profile is used on mobile devices for wireless networks at a coffee shop or an Internet cafe. For security reasons, you want to turn off Network Discovery and File & Print Sharing on this profile because you don’t want hackers to easily access resources on your laptop or other mobile device.

The network profiles can be accessed by going to Settings -> Network and Internet -> Ethernet -> Change advanced sharing options.

Changing Advanced Sharing Options

As mentioned earlier, for Guest or Public networks you should turn off network discovery as well as file and print sharing, as follows.

Guest or Public Profile

The screen shots in this article are from Windows 10 Enterprise and Windows Server 2019 member servers. Your screen may look slightly different depending on the version and build of your operating system.

TIP: For security reasons, you can leave the network discovery off on all networks, public, private, and domain. Turn on file and printer sharing for your domain or private profile, but create all the shares as hidden shares by adding a dollar sign ($) at the end of share name. You won’t be able to browse them in your File Explorer, which uses the browser service, but because you know their names you will be able to connect to them easily or map a drive permanently. Using the browser service is very slow anyway, using universal naming convention (UNC) to map drives (e.g. \\servername\sharename) is much faster.

How to Switch Between Profiles

To switch between the profiles you need to click on the network icon, as shown below.

Network Connected

If you want to switch your profile from public to private, simply select the Private radio button.

NOTE: You can only switch between Private and Public profiles on computers in a Workgroup. Domain-joined computers are controlled by the domain administrator and for security reasons don’t allow users to change the network profile on a workstation.

Network Profiles - Public and Private

What if You Don’t See the Option to Switch Profiles?

Sometimes, when you click on the network icon, instead of the option to switch between network profiles (above screenshot) you may just see the Metered connection screen.

Metered Connection

The Control Panel will display the unidentified network profile as public.

Control Panel View

SOLUTION #1

One solution that worked for me and may be helpful to you is this. Temporary enable the Metered connection, close the Settings window and go back into the network icon. You will see the option to switch between profiles. Change the profile from public to private and go back and turn off the Metered connection. Your profile should stay as private. This solution worked for me on Windows 10.

SOLUTION #2

If the first solution doesn’t work then try this second solution. I have tested this solution several times on Windows 10 workstations and Windows Server 2019 member servers. The Windows Server 2019 Domain Controllers always have the Domain profile as their current (i.e. active) profile, so the issue doesn’t apply to them.

  1. Make sure you only have the Ethernet interface enabled for the public network that you are trying to switch. Disable all other interfaces temporarily.
  2. Go to File Explorer and click the blue Network icon in the navigation pane.
  3. You should see the following error message. Click OK.
    Network Discovery Error

  4. You will see the following message in the top bar. Click anywhere in the bar.
    Change Network Discovery Setting

    NOTE: If you don’t see the above message in the File Explorer, go to the Control Panel -> Network and Internet -> Network and Sharing Center -> Advanced sharing settings and make sure that network discovery and file and printer sharing are both turned off.

  5. From the drop-down message select Turn on network discovery and file sharing.
  6. When prompted to turn on network discovery and file sharing for all public networks, select No, make the network that I am connected to a private network.
    Make network private

  7. Now if you go to the Network and Sharing Center in the Control Panel you can verify that the profile has been switched to private.
    Private Network Profile

  8. To change the name of the network use the following PowerShell commands. The first command can be used to get the information about the connection profile and the second to change the name of the profile.
    Get-NetConnectionProfile
    Set-NetConnectionProfile -Name “NETWORK” -NetworkCategory Private
  9. You may also want to run the Get-NetConnectionProfile again to verify that the name has been updated.

Please let me and the readers know if either one of these solutions worked for you by posting a comment.

Update: September 21, 2020

I forgot to mention that you can turn off network discovery once your profile has been switched to private. Thanks to the reader Peter for pointing this out. You can turn off network discovery in Control Panel -> Network and Internet -> Network and Sharing Center -> Change advanced sharing settings. I prefer to leave network discovery off for both security and performance reasons for all three profiles (Private, Public, and Domain) because I have seen the profiles switched to public on Windows 10 workstations and Windows Server 2019 member servers. Domain Controllers will always have the Domain profile so you don’t have to worry about their profile switching to public.

Thanks for reading my article. If you are interested in IT training & consulting services, please reach out to me. Visit ZubairAlexander.com for information on my professional background.


Copyright © 2018 SeattlePro Enterprises, LLC. All rights reserved.

This div height required for enabling the sticky sidebar

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.

 Windows OS Hub / Windows 10 / How to Change the Network Profile (Location) to Public or Private on Windows

When connecting to a new network, Windows prompts you to select its network profile type (network location): Public or Private. Windows network profiles are part of Windows Defender Firewall with Advanced Security and allow you to apply different firewall rules depending on the type of network your computer is connected to. Depending on the profile used for your network connection, other computers may or may not see your computer on the network, use shared network folders and printers (network discovery settings).

In this article, we will look at how to change the Network profile type from “Public” to “Private” and vice versa in Windows (and Windows Server) using Windows Settings, PowerShell, Registry, and Security Policies.

Contents:

  • What is the Network Location (Profile) in Windows?
  • How to Change the Network Profile (Location) from Public to Private on Windows?
  • Change Network Location to Public or Private with PowerShell
  • How to Set Network Location via Windows Registry?
  • Change Network Type Using Local Security Policy
  • Private Network Instead of Domain on Windows Server

What is the Network Location (Profile) in Windows?

A network connection in Windows (whether Ethernet or Wi-Fi) can be assigned one of three network profiles.

  • Private or Home network – a profile for a trusted network (home or office network). In such a network, the computer will be available for discovery by other devices and you can share your files and printers;
  • Public network (Guest/Open) – a profile for untrusted networks (public Wi-Fi network in the subway, cafe, or airport). You don’t trust other devices on such a network, your computer will be hidden from other network devices, and no one will be able to access shared folders and printers on your computer;
  • Domain network – a profile for computers joined to an Active Directory domain. Applies automatically after joining the Windows device to the AD domain. You can apply domain firewall policies for this profile.

The Network Location Awareness (NLA) service is used in Windows to determine whether a network connection is on a Public, Private, or Domain network.

Depending on the type of network, different Windows Firewall rules apply to the network interface.

On Windows 10 and 11, you can see the current profile (location) assigned to the network connection in Settings -> Network and Internet -> Status (quick access command ms-settings:network ). The Ethernet0 network interface in my example is assigned the Public (Open) profile.

win 10 - network status open for ethernet0 NIC

You can check the network type for active network connections in Windows 10 using the classic Control Panel (All Control Panel Items\Network and Sharing Center).

public network in windows 10 control panel

The network profile in Windows 10 is selected by the user when the device is connected to the new network for the first time. A prompt appears:

Network 2
Do you want to allow your PC to be discoverable by other PCs and devices on this network?
We recommend allowing this on your home and work networks, but not public ones.

Do you want to allow your PC to be discoverable by other PCs and devices on this network? We recommend allowing this on your home and work networks, but not public ones

If you select “Yes”, the Private profile will be assigned to the network, or the Public profile if you select “No”. The next time you connect to the same LAN or WiFi network, the previously selected profile is automatically assigned.

You can hide the “Network Location Wizard” in Windows. Open the Registry Editor and create an empty registry key HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Network\NewNetworkWindowOff. After that, all new networks will be defined as public networks when connected.

reg add "HKLM\SYSTEM\CurrentControlSet\Control\Network\NewNetworkWindowOff" /f

You can reset all settings and profiles for all saved network connections in Windows by selecting Settings -> Network & Internet -> Status -> Network Reset. Then reboot the computer.

win 10 - reset network

Now when you connect to the network, a network discovery request appears again.

How to Change the Network Profile (Location) from Public to Private on Windows?

You can change the network profile type on Windows 10/11 using the modern Settings app. Go to “Network & Internet” -> “Status” and open your network connection settings.

Here you can switch the network location profile from Public to Private and vice versa.

network profile change from public to private in windows 10 settings

In Windows Server 2022/2019, the Properties option is missing from the Status tab. Therefore, select the Ethernet section in the Network and Internet section (or the Wi-Fi section if wireless networking is enabled in Windows Server). Select your network connection.

You cannot change the network connection profile type through the classical Control Panel in Windows.

If a server or a computer is joined to the AD domain, you cannot change the network type for a domain network connection. After the reboot, it will automatically change back to the Domain Network profile.

Change Network Location to Public or Private with PowerShell

On Windows 10/11 and Windows Server 2022/2019/2016, you can manage network connection locations from PowerShell. Open the elevated PowerShell console. List Windows network interfaces and the network profiles applied to them:

Get-NetConnectionProfile

In my example, there is only one physical network adapter (Ethernet0) on a computer with a Public network location (in the NetworkCategory value, you can see the following types of network profiles: Public, Private or DomainAuthenticated).

Get-NetConnectionProfile

Let’s try to change the assigned network profile for the NIC. You need to get the index assigned to this network adapter. In this example, InterfaceIndex = 8.

Name : Network 2
InterfaceAlias : Ethernet0
InterfaceIndex : 8
NetworkCategory : Public
IPv4Connectivity : Internet
IPv6Connectivity : NoTraffic

To change the network for the network adapter with index 8 to Private, run the command:

Set-NetConnectionProfile -InterfaceIndex 8 -NetworkCategory Private

Check that the network profile has changed:

Get-NetConnectionProfile -InterfaceIndex 8

Set-NetConnectionProfile NetworkCategory - powershell

Windows Defender Firewall will automatically apply firewall rules to the network connection according to the assigned network profile without rebooting.

Similarly, you can change the location of the network to Public:

Set-NetConnectionProfile -InterfaceIndex 8 -NetworkCategory Public

Or domain:

Set-NetConnectionProfile -InterfaceIndex 8 -NetworkCategory DomainAuthenticated

You can also change the network profile for all network adapters of the computer at once:

Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory Private

You won’t be able to change the network connection profile from domain to private or public on a domain-joined computer. Make sure your computer is joined to an AD domain:

Get-CimInstance -ClassName Win32_ComputerSystem).PartOfDomain

Try changing the network location:

Set-NetConnectionProfile -InterfaceIndex 8 -NetworkCategory Public –Verbose

An error will appear:

Set-NetConnectionProfile : Unable to set the NetworkCategory due to one of the following possible reasons: not running PowerShell elevated; the NetworkCategory cannot be changed from 'DomainAuthenticated'; user initiated changes to NetworkCategory are being prevented due to the Group Policy setting 'Network List Manager Policies'.

Set-NetConnectionProfile error: NetworkCategory cannot be changed from DomainAuthenticated

How to Set Network Location via Windows Registry?

You can change the network location using the Registry Editor. Open the regedit.exe and go to the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles. This registry section contains a list of all network connections on your computer. There is a separate registry key for each network connection with a name in GUID format ({xxxxxx-xxxxx-……..}).

To find the network you need, look through all the registry keys and find the key that contains the parameter ProfileName with the network you need from the Network and Sharing Center (or the Name value from the Get-NetConnectionProfile command). In our case, the computer is connected to Network 4.

change network profile on windows via registry

Check your network name in the ProfileName registry string value. The network type is specified in the Category parameter. The following values are available:

  • 0 — Public Network
  • 1 — Private Network
  • 2 — Domain Network

In order to change the network type, set the parameter value to the one you need and restart your computer.

Change Network Type Using Local Security Policy

Another way to change the network connection type is to use the Local Security Policy Editor.

Run the secpol.msc snap-in and go to the section Network List Manager Policies. On the right, find your network by its name as it is displayed in the Network and Sharing Center. Open the network properties and go to the Network Location tab, then change the network type from Not configured to Private and save the changes. To prevent users from changing the network location profile, check the option “User cannot change location”.

change network location using security policy

Private Network Instead of Domain on Windows Server

In the new versions of Windows Server 2022/2019, I have seen several times a bug where the domain server (or even a domain controller or RODC) itself changes the network type from domain to private.

To solve the problem, just restart the Network Location Awareness service (from the services.msc console) or with the PowerShell command:

Get-Service NlaSvc| Restart-Service -Force (run as SYSTEM account)

To fix this problem on Windows Server, you need to configure the delayed start type for the Network Location Awareness service. To do this, select the Automatic (Delayed Start) option in the service properties and save the changes.

set network location awareness service delayed start

Make sure that after a reboot, the network type in Windows Server is now always defined as domain (not private).

If the problem occurs on an Active Directory domain controller, you need to change the dependencies of the NlaSvc service so that it starts after the DNS Server service:

sc config nlasvc depend=DNS

Also, in some cases, it can help to force set the DNS suffix of your domain in the network adapter settings (network adapter -> TCP / IPv4 -> Advanced -> DNS, specify your domain name in the “DNS suffix for this connection”, and check the option “Use the suffix of this connection in the DNS registration”.

Изменение профиля сетевого подключения через Powershell (Проверено на Windows Server 2019 1803)

#Смотрим
имеющиеся подключения:

Get-NetConnectionProfile 

#Меняем тип профиль
сетевого подключения:

Set-NetConnectionProfile -InterfaceIndex НомерИндексаНужногоИнтерфейса -NetworkCategory Private

Популярные сообщения из этого блога

Как : Отключить/Включить Фаервол Iptables в CentOS/RHEL

Iptables  — это  фаервол , который по умолчанию встроен в большинство Linux дистрибутивов. Иногда возникает необходимость  остановить iptables  для устранения проблем связанных с сетью. Из этой статьи Вы узнаете как проверить текущий  статус фаервола iptables  и как  выключить  или  включить  его в  CentOS, RHEL (Red Hat Enterprise Linux), Fedora  и подобных дистрибутивах. Все команды должны выполняться с привилегиями пользователя  root . Проверка Состояния Iptables Firewall Узнать текущее состояние Iptables IPv4 Firewall Выполните следующую команду, чтобы проверить  состояние фаервола iptables для IPv4  протокола : # service iptables status Узнать текущее состояние Iptables IPv6 Firewall Выполните следующую команду, чтобы проверить  состояние фаервола iptables для IPv6  протокола : # service ip6tables status Отключить Iptables Firewall Используйте следующие команды для отк…

Powershell- иероглифы; Кодировка командной строки – иероглифы и кракозябры

Часто приходиться видеть ИЕРОГЛИФЫ и КРАКОЗЯБРЫ в консоли PowerShell или DOS-окна после выполнения кода? РЕШЕНИЕ ЕСТЬ! Поменять кодировку можно с помощью команды: chcp 1251 chcp в качестве параметра принимает номер кодовой страницы: 866    — установлена по умолчанию 1251    — Windows кодировка 65001    — UTF Для изменения кодовой страницы в консоли по умолчанию рекомендую прочитать статью: http://support.microsoft.com/kb/262283/ru

Как увидеть список выданных адресов в DHCP на Debian или CentOS.

В Debian: Информация о выданных адресах хранится в: dhcpd.leases внутри каталога /var/lib/dhcp/dhcpd.leases Открываем файл с помощью «cat» и смотрим, кто что получил. В CentOS: cd /var/lib/dhcpd cat dhcpd.leases OR TO EDIT nano dhcpd.leases

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Как удалить norton security ultra из windows 10
  • Как быстро удалить обновления windows
  • Как вывести звук на монитор компьютера windows 10
  • Как зайти под другим пользователем в windows 11
  • Uathelper packaging windows 64 bit error there can be only one game target per project