Прокси сервер для windows server 2019

In this blog, we are covering steps on how to configure proxy settings using group policy preferences in windows server 2019 Active Directory. A proxy serve

In this blog, we are covering steps on how to configure proxy settings using group policy preferences in windows server 2019 Active Directory.

A proxy server can act as an intermediary between the user’s computer and the Internet to prevent the attack and unauthorized access.

For this demo, as usual, I used my existing Domain Controller VM (ws2k19.dc01.mylab.local) and my Windows 10 Client VM (ws10-cli01.mylab.local).

For this example, I have created one OU name TechSupport. We are going to link the group policy object to this OU.

  • User: Tech Support1
  • Group: TechSupportUsers

Create a Group Policy Object to apply proxy server settings:

On server manager console, click on Tools and select Group Policy Management.

In the Group Policy Management Console, right-click on group policy objects and select new.

Specify a proper name (Configure Proxy Settings GPO) to the new group policy object. Click on OK.

On the newly created group policy object right-click and select the edit option.

(Note: You can apply this group policy setting to the User account and Computer account. But for this guide, we will apply this policy on user account only)

Navigate to User Configuration -> Preferences -> Windows Settings -> Registry.

1. Enable Proxy Settings:

Right-click on Registry, Select New –> Registry Item.

This step will enable proxy settings in the web browser.

In the New Registry Properties, fill the information fields as below:

  • Key path: SoftwareMicrosoftWindowsCurrentVersionInternet Settings.
  • Value name: ProxyEnable
  • Value type: REG_DWORD
  • Value data: 00000001

Click on Apply and OK to save the settings.

2. Specify the Proxy Server Address:

Right-click on Registry, Select New –> Registry Item.

This step will specify the proxy server’s IP address and port number.

In the New Registry Properties, fill the information fields as below:

  • Key path: SoftwareMicrosoftWindowsCurrentVersionInternet Settings
  • Value name: ProxyServer
  • Value type: REG_SZ
  • Value data: 172.18.72.3:8080 (Where 172.18.72.3 is the IP address of the proxy server and 8080 is the port of the proxy service.)

Click on Apply and OK to save the settings.

3. Bypass Proxy Server for Local Addresses:

Right-click on Registry, Select New –> Registry Item.

This step will enable the bypass proxy server for the local address setting. This step is optional.

  • Key path: SoftwareMicrosoftWindowsCurrentVersionInternet Settings
  • Value name: ProxyOverride
  • Value type: REG_SZ
  • Value data: <local>

Click on Apply and OK to save the settings.

Once configured, close the group policy editor console.

Link group policy object:

In the Group Policy Management Console, right-click on the Domain/OU where you want to link the group policy object. (In our case, OU will be TechSupport.)

Select Link an existing GPO. Select the GPO (In our, case it will be Configure Proxy Settings GPO).

Click on the OK button.

Test the result:

On the client computer, Login with the user account Tech Support1.

Open the Microsoft Edge web browser.

Click on three dots to open the settings menu.

Click on the Advanced button.

Click on open proxy settings.

Under Manual proxy setup, we can verify the proxy settings which we have configured using group policy preferences.

If the policy is not applying on the user account, manually update the group policy by using the gpupdate /force command.

Thank you for reading this blog post.

Post Views: 4,511

Client’s with a need to secure legacy servers behind a reverse proxy server have an option to use Microsoft IIS. While we typically recommend using a Linux server that has NGINX installed, we understand the need for such a use case and feel it’s important to demonstrate this basic technique.  

We’ll be using a VM running Windows Server 2019 with IIS 10 installed. The IIS extension we’ll use is called URL Rewrite and has been around since IIS 7, so this technique should work well with older versions of IIS.

Assumptions

We won’t cover the basics of spinning up a VM running Windows Server on Microsoft Azure in this article. For more information on that topic, check out this great Microsoft Quickstart Tutorial on setting up a VM and installing IIS.

This article assumes you have the following items setup prior to starting this tutorial:

  • Azure Portal — you will need a Microsoft Azure account.
  • Azure Windows VM — we will be running Windows Server 2019 for this tutorial.
  • IIS — we have installed IIS 10.
  • Domain Name — you will need access to a domain or use a dynamic DNS service.
  • DNS — we have setup azure-test.tevpro.com to point to the public IP of our VM.

Step 1: Install URL Rewrite

We have installed IIS 10 using a simple PowerShell command.

Doing so will setup and configure IIS using all the basic defaults that come with IIS.

Install-WindowsFeature -name Web-Server -IncludeManagementTools

The first thing we need to do is install an IIS extension called URL Rewrite. This will allow us to configure IIS to act as a reverse proxy server.

On the server you choose as your reverse proxy, download and install the URL Rewrite extension taking all the defaults when installing.

Step 2: Setup a Website

To begin, open up IIS manager and create a new website to use as your reverse proxy end-point. It should look like this:

Right click on Sites, then select Add Website.

Figure 1: Add Website

Next, fill in some details about the website. For our example, we will create a new sub-domain for our Tevpro.com website.

Note: Even though we aren’t setting up an actual website, we still need to create a folder somewhere for our dummy site. Here, we created a test folder under our websites folder.

Once you have completed the form, click OK.

Figure 2: Add Website Form

After clicking OK, we should see our website.

When selected, we should see the following options. Notice the URL Rewrite option that shows up after we successfully installed the extension. This is what we will use to configure our reverse proxy.

Figure 3: URL Rewrite

Step 3: Configure URL Rewrite

After we have setup our new website, that will act as our public end-point, we need to configure it as our reverse proxy.

To do this, double click on the URL Rewrite option under our website (shown in Figure 3).

Figure 4: Open URL Rewrite

Next, click the Add Rule(s) item from the Actions section on the far right.

This will bring up the following dialog, under Inbound rules. Select Blank rule and click OK.

Figure 5: Add Rule

For our example, the configuration is pretty straightforward. It’s outside of the scope of this article, but know you can get more complex in the pattern matching and route handling.

First, we need to provide a name for our rule, add a pattern for how we want to match incoming request, and set the rewrite URL.

Figure 6: Inbound Rule

Breaking this step down a bit further, the pattern is how we want to handle capturing incoming request to the website we setup to act as our reverse proxy (azure-test.tevpro.com).

Since we want to be very broad and capture everything, our regex is quite simple. We want to match everything after the domain name, which is what «.*» will do for us.

Click the Test pattern… button and a tool dialog pops up that allows us to test our pattern. We want to make sure that anytime someone visits azure-test.tevpro.com/blog, we capture anything after the domain name. This way we ensure when we rewrite the URL, we can point to the right location.

Take note of the capture group {R:0}. We will use this to configure our rewrite URL.

Figure 7 — Test Pattern

Taking a closer look at our action section, we see the Rewrite URL input field. This field indicates where we want our website to point. Since we want to route back to our website, we put in the URL and append the regex capture group {R:0} from the previous test pattern.

This will forward any request coming into our reverse proxy to the origin server tevpro.com keeping the URL fully intact.

Figure 8 — Action Rewrite URL

Once you have finished setting up the new rule, click Apply.

And viola. We have configured our new website to act as a reverse proxy.

Note: Since we require SSL for our website, we configured SSL for our test server. That’s beyond the scope of this article, however we used Let’s Encrypt.

Step 4: Test the Reverse Proxy

Now that we have completed the reverse proxy configuration, we need to test our new website.

We expect that anytime a user visits the URL, azure-test.tevpro.com, we’ll automatically reroute the corresponding request to tevpro.com.

As you can see below, when we type the URL into our web browser, we see the Tevpro.com website. It is actually being masked behind our reverse proxy website. Pretty cool, right?

Figure 9: Reverse Proxy Test

Conclusion

As you can see, it’s pretty simple technique to set up a reverse proxy server using IIS. The IIS extension does most of the heavy lifting and can be used for more complex routing when needed.

Whether you’re trying to protect a legacy system or add an extra layer in front of your existing website to make migrations easier, this approach has worked well over the years.

At Tevpro, we have helped countless clients improve their business with even the most basic techniques and technology solutions. We’re here to help clients discover their potential in a range of solutions, and weigh pros/cons, so that they are empowered to make the best decision for their business.

Feel free to reach out to us on Twitter or via email with any questions.

Photo by Science in HD

В этой статье мы рассмотрим, как централизованно задать настройки прокси на компьютерах с Windows 10 в домене Active Directory с помощью групповых политик. Большинство распространенных браузеров (таких как Microsoft Edge, Google Chrome, Internet Explorer, Opera) и большинство приложений автоматически используют для доступа в интернет параметры прокси сервера, заданные в Windows. Также мы рассмотрим, как задать параметры системного WinHTTP прокси.

Содержание:

  • Как задать параметры прокси сервера в Windows через GPO?
  • Настройка параметров прокси через реестр и GPO
  • Настройка параметров WinHTTP прокси групповыми политиками

В этой статье мы рассмотрим особенности настройки прокси сервера политиками в поддерживаемых версиях Windows (Windows 10, 8.1 и Windows Server 2012/2016/2019). Обратите внимание, что в снятых с поддержки Windows 7/Server 2008R2, Windows XP/Windows Server 2003 параметры прокси сервера задаются по другому.

Как задать параметры прокси сервера в Windows через GPO?

До выхода Windows Server 2012/Windows 8 для настройки параметров Internet Expolrer (и в том числе настроек прокси) использовался раздел Internet Explorer Maintenance (IEM) из пользовательской секции GPO (User configuration –> Policies –> Windows Settings –> Internet Explorer Maintenance). В современных версиях Windows 10 /Windows Server 2016/2019 этот раздел отсутствует. Internet Explorer Maintenance - настройка IE через групповые политики

В новых версиях Windows для настройки параметров IE и прокси в редакторе GPO нужно использовать предпочтения групповых политик GPP (Group Policy Preferences). Также есть вариант использования специального расширения Internet Explorer Administration Kit 11 (IEAK 11) – но применяется он редко.

Откройте консоль редактора доменных GPO (Group Policy Management Console –
GPMC.msc
), выберите OU с пользователями, для которых нужно назначить параметры прокси-сервера и создайте новую политику Create a GPO in this domain, and Link it here.

создать групповую политику с настройками прокси сервера для windows 10

Перейдите в раздел User Configuration -> Preferences -> Control Panel Settings -> Internet Settings. В контекстном меню выберите пункт New -> и выберите Internet Explorer 10.

создать доменную политику с настройками Internet Explorer 10

Для настройки параметров прокси в Windows 10/Windows Server 2016 нужно использовать пункт Internet Explorer 10.

Совет. Несмотря на то, что отдельной настройки для Internet Explorer 11 нет, политика Internet Explorer 10 будет применяться на все версии IE >=10 (в файле политики InternetSettings.xml можно увидеть, что опция действительна для всех версии IE, начиная c 10.0.0.0 и заканчивая 99.0.0.0). Все версии Internet Explorer ниже 11 на данный момент сняты с поддержки Microsoft и более не обновляются.

<FilterFile lte="0" max="99.0.0.0" min="10.0.0.0" gte="1" type="VERSION" path="%ProgramFilesDir%Internet Exploreriexplore.exe" bool="AND" not="0" hidden="1"/>

файл InternetSettings.xml

Перед вами появится специальная форма, практически полностью идентичная настройкам параметра обозревателя в панели управления Windows. Например, вы можете указать домашнюю страницу (Вкладка General, поле Home page).

задать домашнюю страницу в IE групповой политикой

Важно. Не достаточно просто сохранить внесенные изменения в редакторе политики. Обратите внимание на красные и зеленые подчеркивания у настраиваемых параметров Internet Explorer 10. Красное подчеркивание говорит о том, что эта настройка политики не будет применяться. Чтобы применить конкретную настройку, нажмите F5. Зеленое подчеркивание у параметра означает, что этот параметр IE будет применяться через GPP.

Доступные функциональные клавиши

  • F5 – Включить все настройки на текущей вкладке
  • F6 – Включить выбранный параметр
  • F7 – Отключить выбранный параметр
  • F8 – Отключить все настройки на текущей вкладке

Чтобы указать параметры прокси-сервера, перейдите на вкладку Connections и нажмите кнопку Lan Settings). Прокси сервер можно настроить одним из следующих способов:

  • Automatically detect settings — автоматическое определение настроек прокси с помощью файла wpad.dat;
  • Use automatic configuration script — скрипт автоконфигурации (proxy.pac);
  • Proxy Server – можно вручную указать IP адрес или DNS имя прокси сервера и порт подключения. Это самый простой способ настроить прокси в Windows, его и будем использовать.

Поставьте галку Use a proxy server for your LAN, а в полях Address и Port соответственно укажите IP/FQDN имя прокси-сервера и порт подключения.

задать параметры прокси сервера в windows 10 через доменную gpo

Включив опцию Bypass Proxy Server for Local Addresses можно запретить приложениям (в том числе браузеру) использовать прокси-сервер при доступе к локальным ресурсам (в формате
http://intranet
). Если вы используете адреса ресурсов вида
https://winitpro.ru
или
http://192.168.20.5
, то эти адреса не распознаются Windows как локальные. Эти адреса и адреса других ресурсов, для доступа к которым не нужно использовать прокси, нужно указать вручную. Нажмите кнопку Advanced и в поле Exceptions введите адреса в формате:
10.*;192.168.*;*.loc;*.contoso.com

не использовать прокси для следующих адресов

Совет. Параметры прокси-сервера в Google Chrome можно задать централизованно через GPO с помощью специальных административных шаблонов. Для Mozilla Firefox можно использовать такое решение.

После сохранения политики вы можете просмотреть XML файл с заданными настройками браузера в каталоге политики на контроллере домена \DC1SYSVOLwinitpro.ruPolicies(PolicyGuiID) UserPreferencesInternetSettingsInternetSettings.xml

InternetSettings.xml файл с настройками IE в групповых политиках

В GPP есть возможность более тонко нацелить политику на клиентов. Для этого используется GPP Item Level Targeting. Перейдите на вкладку Common, включите опцию Item-level targeting -> Targeting.

В открывшейся форме укажите условия применения политики. В качестве примера я указал, что политика настройки прокси будет применена только к пользователям, которые состоят в доменной группе ruspb_proxy_users. Вы можете использовать собственную логику назначения параметров прокси (в зависимости от IP подсети, сайта AD и т.д.).

применить настройки прокси только к определенной группе AD

Осталось назначить политику IE на контейнер с пользователями и обновить политики на них. После обновления политики на компьютерах пользователей должны примениться новые настройки прокси в IE. В Windows 10 текущие параметры прокси можно посмотреть в разделе Settings -> Network and Internet -> Proxy. Как вы видите, на компьютере теперь заданы настройки прокси, указанные в доменной политике.

windows 10 применились настройки прокси сервера из групповой политики

Чтобы запретить пользователям менять настройки прокси-сервера, воспользуйтесь этой статьей.

Настройка параметров прокси через реестр и GPO

Кроме того, настроить параметры IE можно и через реестр, политиками GPP. К примеру, чтобы включить прокси для пользователя нужно настроить следующие параметры реестра в ветке HKEY_CURRENT_USERSoftwareMicrosoft WindowsCurrentVersionInternet Settings.

Перейдите в редакторе GPO в раздел User Configuration -> Preferences -> Windows Settings -> Registry и создайте три параметра реестра в указанной ветке:

  • ProxyEnable
    (REG_DWORD) =
    00000001
  • ProxyServer
    (REG_SZ) =
    192.168.0.50:3128
  • ProxyOverride
    (REG_SZ) =
    *winitpro.ru;https://*.contoso.com;192.168.*;<local>

Здесь также можно использовать Item level targeting для более тонкого нацеливания политик. задать настройки прокси сервера в домене через реестр

Если вам нужно создать политики не для каждого пользователя (per-user), а для всех пользователей компьютера (per-computer), используйте параметры GPP из раздела GPO Computer Configuration -> Preferences -> Windows Settings -> Registry. Используйте аналогичные параметры реестра в ветке HKEY_LOCAL_MACHINESoftwarePoliciesMicrosoftWindowsCurrentVersionInternet Settings.

Настройка параметров WinHTTP прокси групповыми политиками

Некоторые системные сервисы или приложения (например, служба обновлений Wususerv или PowerShell) по-умолчанию не используют пользовательские настройки прокси сервера из параметров Internet Explorer. Чтобы такие приложения работали корректно и получали доступ в интернет, вам нужно задать в Windows настройки системного прокси WinHTTP.

Чтобы проверить, настроен ли на вашем компьютере WinHTTP прокси, выполните команду:

netsh winhttp show proxy

Ответ “
Direct access (no proxy server)
” говорит о том, что прокси не задан, система использует прямой интернет доступ.

netsh winhttp show proxy Direct access (no proxy server)

Вы можете задать на компьютере прокси для WinHTTP вручную командой:

netsh winhttp set proxy 192.168.0.50:3128 "localhost;192.168.*;*.winitpro.com"

Или импортировать настройки прокси из параметров Internet Explorer теекщего пользователя:

netsh winhttp import proxy source=ie

netsh winhttp import proxy source=ie

Однако настроить WinHTTP через GPO не получится – в редакторе GPO нет соответствующего параметра, а в реестре параметры хранятся в бинарном виде и не подходят для прямого редактирования.

параметр реестра WinHttpSettings

Единственный вариант задать параметры WinHTTP прокси – настроить их на эталонном компьютере, выгрузить значение параметра WinHttpSettings в ветке реестра HKLMSOFTWAREMicrosoftWindowsCurrentVersionInternet SettingsConnections в reg файл и распространить этот параметр на компьютеры в домене через GPP registry.

настройка winhttp proxy в windows через GPO

The article shows how to use Active Directory Group Policies (GPOs) to configure proxy server settings on domain-joined computers running Windows 10/11 and Windows Server 2022/2019/2016/2012R2. These proxy server settings are used by all modern browsers, including Internet Explorer 11 (reached end of support on June 2022), Google Chrome, Microsoft Edge, Opera, and Mozilla Firefox (with the option Use system proxy settings enabled by default).

How to Set Proxy Settings via Group Policy?

To manage the browser’s proxy server settings on a Windows computer, you can use Group Policy Preferences (GPP) or Internet Explorer Administration Kit 11 (IEAK 11). In order to set proxy settings via GPO on users’ computers in the AD domain, perform the following actions:

  1. Open Group Policy Management Console (gpmc.msc);
  2. Select the Active Directory OU for which you want to apply the new proxy settings. In this example, we want to apply a proxy settings policy to user OU (OU=Users,OU=California,OU=USA,DC=theitbros,DC=com);
  3. Right-click on OU and select Create a GPO in this domain and link it here;
    gpo proxy settings
  4. Specify a policy name, for example, CA_Proxy;
    gpo proxy
  5. Click on the policy and select Edit;
    group policy proxy settings
  6. Expand the following section: User Configuration > Preferences > Control Panel Settings > Internet Settings. Right-click and select New > Internet Explorer 10 (this policy will also be applied for the IE 11);

    Note
    . In previous versions of Internet Explorer (6, 7, and 9) to configure Internet Explorer settings you needed to use the following section in the Group Policy Editor console: User configuration > Policies > Windows Settings > Internet Explorer Maintenance. However, in Internet Explorer 10 (which firstly appeared on Windows Server 2012 and Windows 8) the Internet Explorer Maintenance (IEM) section was removed from GPO Editor. Moreover, this section also disappeared in Windows 7/Windows Server 2008 R2 after Internet Explorer 10 or 11 was installed. If you try to apply the IEM policy to a computer with IE 10 or 11, it won’t work;
    proxy settings gpo
  7. On the standard window with the Internet Explorer settings, go to the Connections tab and press the LAN Settings button;
    proxy gpo
  8. Tick the checkbox “Use a proxy server for your LAN” and specify the Address and Port of your proxy server (for example, 192.168.1.11, port 3128). To enable this option, press the F6 button (underline for that setting will change the color from red to green). To disable a specific policy setting press F7 (disable the option “Automatic detect settings” this way).Tip. The green underscore for the IE parameter means this setting is enabled and will be applied through Group Policy. Red underlining means the setting is configured, but disabled. To enable all settings on the current tab, press F5. To disable all policies on this tab use the F8 key. Note the Bypass Proxy Server for Local Addresses option. When this policy setting is enabled, local resources are always accessed directly, not through a proxy server. Windows automatically recognizes the address of the format http://theitbros as local and IE when accessing them bypasses the proxy (Local addresses are all URLs without a domain suffix). However, it is important to note that the addresses of the format http://forum.theitbros.local or http://192.168.0.50 can’t be recognized by the system as a local. In order to avoid using a proxy to access such resources, you need to configure exceptions for them using the policy Do not use proxy servers for addresses beginning with (see below);
    gpo proxy settings windows 10
  9. If you need to specify the list of address exceptions, click Advanced. In the field Do not use proxy servers for addresses beginning with specify the list of IP addresses or domains (this option allows you to bypass the proxy for the specified domains/IP addresses). You can use the wildcards in proxy exception list. The exclusion list is a simple string with the list of DNS names and/or IP addresses (values in the list must be separated by a semicolon). For example:
    192.*;*.theitbros.com

    gpo set proxy

  10. Press OK twice to save settings.

Note. This rule only works for Internet Explorer 10 and Internet Explorer 11. For earlier IE versions, you need to create separate rules.

It remains to update group policy settings on client computers (with the gpupdate command: gpupdate /force), and check proxy settings in IE (Control Panel > Network and Internet > Internet Options > Connections > LAN Settings).

gpo proxy windows 10

If you want the proxy server settings to be applied to users based on the IP subnet where their devices are located, you can use the GPP Item Level-Targeting. To do this, switch to the Common tab in the policy settings and check the Item-Level Targeting option. Click on the Targeting button.

windows 10 proxy gpo

Select New Item > IP address ranges. Specify the range of IP addresses in your subnet for which you want to apply proxy settings.

group policy proxy settings windows 10

Save the policy settings. Similarly, create several IE policies with proxy settings for different IP subnets.

windows 10 gpo proxy settings

As a result, the proxy settings for the users will be applied depending on the IP network (office) in which they work (convenient for mobile employees with laptops).

Tip. To configure the new IE policy from Windows Server 2008/R2, you need to download Administrative Templates for Internet Explorer, and copy files Inetres.admx and Inetres.adml to the folder %SYSTEMROOT%PolicyDefinitions.

When a policy with proxy server settings is applied to a user computer, it changes the values of the registry settings under the following key: HKEY_CURRENT_USERSOFTWAREMicrosoftWindowsCurrentVersionInternet Settings.

group policy proxy

Accordingly, you can directly configure the IE proxy settings in registry. In order to configure proxy setting for a current user on your computer, you can use the following PowerShell script:

$proxyregkey = "HKCU:SoftwareMicrosoftWindowsCurrentVersionInternet Settings"

Set-ItemProperty -Path $proxyregkey -Name ProxyEnable -Value 1

Set-ItemProperty -Path $proxyregkey -Name ProxyServer -Value "192.168.1.11:3128"

Set-ItemProperty -Path $proxyregkey -Name ProxyOverride -Value '10.*;192.168.*;*.theitbros.com;<local>'

Set-ItemProperty -Path $proxyregkey-Name AutoDetect -Value 0

set proxy gpo

This means that you can deploy the same registry settings with your proxy configuration to domain-joined computers using GPO (Group Policy Preferences, to be more precise).

Create a new GPO and expand the GPP section User Configuration > Preferences > Registry and create 3 registry parameters in the registry key HKCUSOFTWAREMicrosoftWindowsCurrentVersionInternet Settings]:

  • ProxyEnable (REG_DWORD) = 00000001;
  • ProxyServer (REG_SZ) = 192.168.1.11:3128;
  • ProxyOverride (REG_SZ) = 192.*;*.theitbros.com.

proxy group policy

Proxy Settings for Computers in Group Policy

By default, IE proxy settings are per user. However, you can use the different GPO to apply proxy settings to all users of the computer. To do this, go to the following section in the GPO Editor console: Computer Configuration > Administrative Templates > Windows Components > Internet Explorer. Enable the policy Make proxy settings per-machine (rather than per user).

Note. The same setting can be enabled through the registry:

$proxyregkey = "HKLMSoftwarePoliciesMicrosoftWindowsCurrentVersionInternet Settings"
New-ItemProperty -Path $proxyregkey -Name ProxySettingsPerUser  -Value 0

set proxy via gpo

To apply settings to computer objects, also enable the policy Configure user Group Policy loopback processing mode under the Computer Configuration > Policies > Administrative Templates > System > Group Policy. Select the Merge mode in the policy settings.

How to Apply WinHTTP Proxy Settings via GPO?

By default, the WinHTTP service does not use the proxy settings configured in Internet Explorer. As a result, some system services (including the Windows Update service: Wususerv) won’t be able to access the Internet.

Check current WinHTTP proxy settings with the command:

netsh.exe winhttp show proxy

windows 10 proxy settings gpo

Current WinHTTP proxy settings: Direct access (no proxy server).

To enable WinHTTP proxy for a computer through a GPO, you must configure a special registry parameter.

First, you need to configure a proxy for WinHTTP on the reference computer. The easiest way is to import proxy settings from IE:

netsh winhttp import proxy source=ie

gpo edge proxy settings

These settings will be saved in the WinHttpSettings parameter under the registry key HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionInternet SettingsConnections.

gpo for proxy settings

Now open your proxy GPO and go to Computer Configuration > Preferences > Windows Settings > Registry > New > Registry Wizard.

Select Local computer and specify the full path to the WinHttpSettings parameter.

internet explorer proxy settings gpo

It remains to click Finish, update the policy on computers, and make sure the WinHTTP proxy settings are applied successfully.

How to Prevent Users from Changing Proxy Settings in Browsers?

By default, if you configure the proxy server settings in Windows through the GPO, computer users can change the proxy settings themselves.

Note that proxy settings in Windows can be edited using both IE options and the modern Settings control panel.

windows gpo proxy settings

You can prevent users from changing proxy settings in Windows using the “Prevent changing proxy settings” additional GPO option. This parameter is present in both the user and computer GPO sections.

  • Computer Configuration > Policies > Administrative Templates > Windows Components – Internet Explorer
  • User Configuration > Policies > Administrative Templates > Windows Components Internet Explorer

configure proxy gpo

If you enable this policy and apply it to the domain computer, then the fields with proxy settings in Windows will be blocked, and the caption will appear below: Some settings are managed by your system administrator.

apply proxy settings to computer gpo

Hint. Settings in the Computer Configuration section take precedence over user settings.

Typically, you want to use a more flexible way of granting permissions to change proxy settings on computers. For example, you can restrict proxy settings for all users except members of the ca_workstation_admins Active Directory group.

  1. Create a new GPO with proxy settings (or edit an existing one);
  2. Go to Group Policy Preferences (User Configuration > Preferences > Windows Settings > Registry) and create two registry values:

The first parameter prohibits changing proxy settings:

Hive: HKEY_CURRENT_USER

Key Path: SoftwarePoliciesMicrosoftInternet ExplorerControl Panel

Value name: Proxy

Value type: REG_DWORD

Value data: 00000001

The second parameter blocks the launch of the IE window with proxy settings:

Hive: HKEY_CURRENT_USER

Key Path: SoftwarePoliciesMicrosoftInternet ExplorerRestrictions

Value name: NoBrowserOptions

Value type: REG_DWORD

Value data: 00000001
  1. These policies will apply to all computer users;
  2. To prevent policies from applying to a specific security group, you need to copy these two parameters, set a larger Order, and change their values to 00000000;
  3. Then open the properties of each of these two registry settings, go to Common > Item level targeting > Targeting;
  4. Create a new targeting rule: New > Security Group > provide a group name (ca_workstation_admins);
    proxy server gpo
  5. Create a similar targeting rule for the second registry parameter;
  6. As a result, if a user from the specified group logs on to the computer, the proxy settings for him won’t be locked.

It is also worth noting that for .NET Core 3.0 applications (including PowerShell Core 7.x) you can set proxy server settings using the following Windows environment variables:

  • HTTP_PROXY:
  • HTTPS_PROXY
  • ALL_PROXY
  • NO_PROXY

You can create and distribute these environment variables to domain user computers using GPP. Just create the required environment variables under Computer Configuration > Preferences > Windows Settings > Environment.

gpedit proxy settings

  • About
  • Latest Posts

I enjoy technology and developing websites. Since 2012 I’m running a few of my own websites, and share useful content on gadgets, PC administration and website promotion.


In this article, we’ll take a look at how to centrally configure proxy settings on Windows 10 computers in a domain using Group Policy. Most popular browsers (such as Microsoft Edge, Google Chrome, Internet Explorer, Opera) and most applications automatically use the proxy settings set in Windows to access the Internet. We’ll also look at how to set up WinHTTP proxy settings on Windows.

Contents:

  • How to Set Proxy Settings on Windows via GPO?
  • Configure Proxy Setting via Registry and GPO
  • Change WinHTTP Proxy Settings via GPO

In this article, we will look at the specifics of configuring a proxy server through Group Policy in supported versions of Windows (Windows 10, 8.1, and Windows Server 2012/2016/2019). Note that proxy settings are set differently in Windows 7/Server 2008R2, Windows XP/Windows Server 2003 with discontinued support.

How to Set Proxy Settings on Windows via GPO?

Originally, to centrally configure Internet Explorer settings (including proxy settings) using Group Policies in the Active Directory domain environment, the Internet Explorer Maintenance (IEM) policy was used. This policy option was located in the user GPO section: User configuration –> Policies –> Windows Settings –> Internet Explorer Maintenance. But since Windows Server 2012/Windows 8, the IEM policy has been deprecated. This section is missing in modern versions of Windows 10/Windows Server 2016/2019.

Internet Explorer Maintenance section in GPO Editor

On the latest Windows versions, you must use Group Policy Preferences (GPP) to configure IE and proxy settings in the GPO Editor. There is also the option of using a special extension of Internet Explorer Administration Kit 11 (IEAK 11) – but it is rarely used.

Open the domain GPO Editor console (Group Policy Management Console – GPMC.msc), select the OU with the users to which you want to apply proxy settings, and create a new policy Create a GPO in this domain, and Link it here.

create proxy gpo in an active directory domain

Go to User Configuration -> Preferences -> Control Panel Settings -> Internet Settings. In the context menu, select New ->  Internet Explorer 10.

create internet explorer 10 policy preference

To configure proxy settings on Windows 10/Windows Server 2016, you need to use the Internet Explorer 10 item.

Tip. Although there is no separate option for Internet Explorer 11, the Internet Explorer 10 policy should apply to all versions of IE above 10 (in the InternetSettings.xml policy file, you can see that the option is valid to all IE versions from 10.0.0.0 to 99.0.0.0).

<FilterFile lte="0" max="99.0.0.0" min="10.0.0.0" gte="1" type="VERSION" path="%ProgramFilesDir%Internet Exploreriexplore.exe" bool="AND" not="0" hidden="1"/>

ie version support in gpo config file

A special Group Policy Preferences IE form will appear in front of you, almost completely identical to the Internet Options settings in the Windows Control Panel. For example, you can specify a home page (General tab -> Home page field).

ie set homepage

Important. It is not enough to simply save your changes in the Group Policy Editor. Notice the red and green underlines for the Internet Explorer 10 configurable settings. A red underline indicates that the setting won’t be applied. To save and apply a specific setting, press F5. A green underline of a parameter means that this IE parameter will be applied via GPP.

The following function keys are available:

  • F5 – Enable all settings on the current tab
  • F6 – Enable the selected setting
  • F7 – Disable the selected setting
  • F8 – Disable all settings in the current tab

To specify proxy settings, go to the Connections tab and click the Lan Settings button. The proxy server can be configured in one of the following ways:

  • Automatically detect settings – automatic detection of settings using the wpad.dat file;
  • Use automatic configuration script – auto-configuration script (proxy.pac);
  • Proxy Server – the IP address or DNS name of the proxy server is specified directly in the policy settings. This is the easiest way, and we will use it.

Check the option Use a proxy server for your LAN, and specify the IP/FQDN name of the proxy server and the connection port in the corresponding Address and Port fields.

enable and configure proxy server settings using GPO

By enabling the Bypass proxy server for local addresses option, you can prevent applications (including the browsers) from using a proxy server when accessing local resources (in the format http://localnetwork). If you use resource addresses like http://web1.woshub.loc or http://192.168.1.5, then these addresses are not recognized by the Windows as local ones. These addresses and addresses of other resources, for access to which you do not need to use a proxy, must be specified manually. Press Advanced button and add this addresses to the field Do not use proxy servers for addresses beginning with in the following format:  10.1.*;192.168.*;*.woshub.loc;*.local.net.

do not use proxy servers for addressing begining with - proxy exclusions

Tip. Proxy settings in Google Chrome also can be set through the GPO using special administrative templates. Also, you can install the ADMX templates for Mozilla Firefox.

After you save the policy, you can view the InternetSettings.xml file with the specified browser settings in the policy folder on the domain controller:

\UKDC1SYSVOLwoshub.comPolicies{PolicyGuiID}UserPreferencesInternetSettingsInternetSettings.xml

InternetSettings.xml config file in gpo

GPP allows you to more finely target policy to users/computers. For this, GPP Item Level Targeting is used. Go to the Common tab, enable the option Item-level targeting -> Targeting.

In the form that opens, specify the conditions for applying the policy. As an example, I indicated that the proxy configuration policy will be applied only to users who are members of the proxy_users domain security group. You can use your own logic for assigning proxy parameters.

proxy server item level gpo targeting

It remains to link the proxy policy to the AD container with the users and update policy settings on them. After applying policies on the users’ computers, new IE settings should be used. You can check the current proxy settings on Windows 10 in the Settings -> Network and Internet -> Proxy. As you can see, the computer now uses the proxy settings specified in the domain policy.

check proxy server settings on windows 10

To prevent users from changing the proxy server settings, you can use this article.

Configure Proxy Setting via Registry and GPO

In addition, you can configure IE settings through the registry using GPP policies. For example, to enable proxy server, you need to configure the following registry parameter in the registry key HKEY_CURRENT_USERSoftwareMicrosoft WindowsCurrentVersionInternet Settings. In the GPO editor go to the section User Configuration -> Preferences -> Windows Settings -> Registry and create three registry parameters under the specified reg key:

  • ProxyEnable (REG_DWORD) = 00000001
  • ProxyServer (REG_SZ) = 192.168.0.11:3128
  • ProxyOverride (REG_SZ) = https://*.woshub.com;192.168.*;10.1.*;*.contoso.com;<local>

You can also use Item-level targeting here to target your policy settings for specific users/devices.

set proxy settings via the registry

If you need to create proxy policies not per-user, but for the entire computer (per-computer), use the GPP settings from the GPO section Computer Configuration -> Preferences -> Windows Settings -> Registry. Set the same registry parameters under the registry key HKEY_LOCAL_MACHINESoftwarePoliciesMicrosoftWindowsCurrentVersionInternet Settings.

Change WinHTTP Proxy Settings via GPO

Some system services or applications (for example, the Wususerv update service or PowerShell) don’t use user’s proxy settings by default. For such applications to work correctly and access the Internet, you need to configure the WinHTTP proxy settings in Windows.

To check if WinHTTP proxy is configured on your computer, run the command:

netsh winhttp show proxy

The answer “Direct access (no proxy server)” means that no proxy is set. netsh winhttp show proxy Direct access (no proxy server)

You can manually set a proxy for WinHTTP on your computer with the command:
netsh winhttp set proxy proxy.woshub.com:3128 "localhost;10.1.*;192.168.*;*.woshub.com"

Or import proxy settings from user’s Internet Explorer settings:

netsh winhttp import proxy source=ie

winhttp proxy server import from IE

However, you won’t be able to configure WinHTTP through the GPO – there is no corresponding parameter in the GPO editor, and the parameter are stored in binary registry attribute that is not suitable for direct editing.

WinHttpSettings registry parameter

The only way to set WinHTTP proxy settings on Windows via GPO is to configure WinHTTP proxy on the reference computer, export the value of the WinHttpSettings parameter from the registry key HKLMSOFTWAREMicrosoftWindowsCurrentVersionInternet SettingsConnections, and deploy this parameter to domain computers through the GPP registry extension.

deploy WinHttp proxy settings via GPO

  • Remove From My Forums
  • Вопрос

  • Добрый день. Чтобы не создавать еще один вопрос, как разрешить в Serve  2019 выполнение GPO для IE 1011 (прописать настройки proxy сервера), есть параметр реестра?

    • Разделено

      2 марта 2019 г. 17:09
      вопрос находился внутри несвязанного обсуждения

Ответы

  • Добрый день. Чтобы не создавать еще один вопрос, как разрешить в Serve  2019 выполнение GPO для IE 1011 (прописать настройки proxy сервера), есть параметр реестра?

    думаю что для 2019 сервера
    ничего не поменялось в настройках прокси

    найти ваш вопрос про прокси и ответ на него проще, когда он выделен в отдельное обсуждение, поэтому если вопрос не касается вашего старого обсуждения лучше создайте новое

    текущий вопрос я выделю сам в новое обсуждение


    The opinion expressed by me is not an official position of Microsoft

    • Предложено в качестве ответа
      Vector BCOModerator
      5 марта 2019 г. 14:49
    • Помечено в качестве ответа
      Petko KrushevMicrosoft contingent staff, Owner
      6 марта 2019 г. 9:19

В этой статье мы рассмотрим, как централизованно настроить параметры прокси на компьютерах с Windows 10 в домене Active Directory с помощью групповой политики. Наиболее распространенные браузеры (такие как Microsoft Edge, Google Chrome, Internet Explorer, Opera) и большинство приложений автоматически используют настройки прокси-сервера, установленные в Windows, для доступа в Интернет. Мы также увидим, как настроить системные параметры WinHTTP-прокси.

В этой статье мы рассмотрим особенности настройки прокси-сервера с политикой в ​​поддерживаемых версиях Windows (Windows 10, 8.1 и Windows Server 2012/2016/2019). Обратите внимание, что в снятых с производства Windows 7 / Server 2008R2, Windows XP / Windows Server 2003 настройки прокси-сервера устанавливаются по-другому.

Как задать параметры прокси сервера в Windows через GPO?

До выпуска Windows Server 2012 / Windows 8 для настройки параметров Internet Explorer (включая настройки прокси). Этот раздел отсутствует в современных версиях Windows 10 / Windows Server 2016/2019.

Обслуживание Internet Explorer: настройка IE с помощью групповой политики

В более новых версиях Windows необходимо использовать настройки групповой политики (GPP) для настройки параметров Internet Explorer и прокси-сервера в редакторе GPO. Также есть возможность использовать специальное расширение Internet Explorer Administration Kit 11 (IEAK 11), но оно используется редко.

Откройте редактор GPO домена консоли управления групповой политикой (

GPMC.msc

), выберите подразделение с пользователями, которым вы хотите назначить параметры прокси-сервера, и создайте новую политику. Создайте GPO в этом домене и подключите его здесь.

создать групповую политику с настройками прокси-сервера для Windows 10

Перейдите в Конфигурация пользователя -> Настройки -> Настройки панели управления -> Настройки Интернета. В контекстном меню выберите New -> и выберите Internet Explorer 10.

создать политику домена с настройками Internet Explorer 10

Для настройки параметров прокси в Windows 10 / Windows Server 2016 необходимо использовать пункт Internet Explorer 10.

Совет. Хотя для Internet Explorer 11 нет отдельной настройки, политика Internet Explorer 10 будет применяться ко всем версиям IE> = 10 (в файле политики InternetSettings.xml можно увидеть, что этот параметр действителен для всех версий IE, начиная с 10.0).0.0 и заканчивая 99.0.0.0). Все версии Internet Explorer до 11 больше не поддерживаются Microsoft и больше не обновляются.

<FilterFile lte="0" max="99.0.0.0" min="10.0.0.0" gte="1" type="VERSION" path="%ProgramFilesDir%Internet Exploreriexplore.exe" bool="AND" not="0" hidden="1"/>

файл InternetSettings.xml

Перед вами появится специальный модуль, практически полностью идентичный настройкам опции Интернет в Панели управления Windows. Например, вы можете указать домашнюю страницу (вкладка «Общие», поле «Домашняя страница).

установить домашнюю страницу в IE в соответствии с групповой политикой

Важный. Недостаточно просто сохранить изменения в редакторе политик. Обратите внимание на красные и зеленые подчеркивания для настраиваемых параметров Internet Explorer 10. Красное подчеркивание означает, что этот параметр политики не будет применяться. Чтобы применить определенный параметр, нажмите F5. Зеленое подчеркивание рядом с параметром означает, что параметр IE будет применяться через GPP.

Доступны функциональные клавиши

  • F5 – включить все настройки в текущей вкладке
  • F6 – включить выбранную опцию
  • F7 – отключить выбранную опцию
  • F8 – отключить все настройки в текущей вкладке

Чтобы указать параметры прокси, перейдите на вкладку «Подключения» и нажмите кнопку «Параметры локальной сети»). Прокси-сервер можно настроить одним из следующих способов:

  • Автоопределение настроек – автоматическое определение настроек с помощью файла wpad.dat;
  • Использовать скрипт автоматической настройки – скрипт автоматической настройки (proxy.pac);
  • Прокси-сервер: вы можете вручную указать IP-адрес или DNS-имя прокси-сервера и порт подключения. Это самый простой способ настроить прокси в Windows, и мы будем его использовать.

Установите флажок Использовать прокси-сервер для вашей локальной сети и в полях Адрес и Порт, соответственно, укажите IP / FQDN прокси-сервера и порт подключения.

установить параметры прокси-сервера в Windows 10 через домен gpo

Включив параметр Обход прокси-сервера для локальных адресов, вы можете запретить приложениям (включая браузер) использовать прокси-сервер при доступе к локальным ресурсам (в формате

http://intranet

). Если вы используете адреса ресурсов, такие как

https://winitpro.ru

или

http://192.168.20.5

, эти адреса не распознаются Windows как локальные. Эти адреса и адреса других ресурсов, для доступа к которым прокси не требуется, необходимо указать вручную. Нажмите кнопку «Дополнительно» и в поле «Исключения» введите адреса в формате:

10.*;192.168.*;*.loc;*.contoso.com

не используйте прокси для следующих адресов

Совет. Настройки прокси-сервера в Google Chrome можно настроить централизованно через GPO с помощью специальных административных шаблонов. Для Mozilla Firefox вы можете использовать это решение.

После сохранения политики вы можете просмотреть XML-файл с указанными настройками браузера в каталоге политики на контроллере домена \ DC1 ​​ SYSVOL winitpro.ru Policies (PolicyGuiID) User Preferences InternetSettings InternetSettings xml

Файл InternetSettings.xml с настройками IE в групповой политике

GPP имеет возможность более тонко нацеливать политику на клиентов. Для этого используется таргетинг на уровне элемента GPP. Перейдите на вкладку Общие, включите параметр Таргетинг на уровень элемента -> Таргетинг.

В открывшейся форме укажите условия применения политики. Например, я указал, что политика конфигурации прокси будет применяться только к пользователям, которые являются членами доменной группы ruspb_proxy_users. Вы можете использовать собственную логику для назначения параметров прокси (в зависимости от IP-подсети, сайта AD и т.д.).

применять настройки прокси только к определенной группе AD

Осталось назначить политику IE контейнеру с пользователями и обновить политики для них. После обновления политик на компьютерах пользователей следует применить новые настройки прокси в IE. В Windows 10 текущие настройки прокси-сервера можно посмотреть в разделе «Настройки» -> «Сеть и Интернет» -> «Прокси-сервер». Как видите, теперь компьютер настроен с параметрами прокси, указанными в политике домена.

принудительные настройки прокси-сервера Windows 10 из групповой политики

Используйте эту статью, чтобы запретить пользователям изменять настройки прокси-сервера.

Настройка параметров прокси через реестр и GPO

Кроме того, вы можете настроить параметры IE через реестр, используя политики GPP. Например, чтобы включить прокси для пользователя, вам необходимо настроить следующие параметры реестра в ветке HKEY_CURRENT_USER Software Microsoft Windows CurrentVersion Internet Settings.

Перейдите в редактор GPO в разделе User Configuration -> Preferences -> Windows Settings -> Registry и создайте три значения реестра в указанной ветке:

  • ProxyEnable

    (REG_DWORD) =

    00000001

  • ProxyServer

    (REG_SZ) =

    192.168.0.50:3128

  • ProxyOverride

    (REG_SZ) =

    *winitpro.ru;https://*.contoso.com;192.168.*;<local>

Здесь вы также можете использовать таргетинг на уровне элементов, чтобы точно настроить таргетинг по критериям.

установить настройки прокси-сервера в домене через реестр

Если вам нужно создать политики не для каждого пользователя (для каждого пользователя), а для всех пользователей компьютера (для каждого компьютера), используйте настройки GPP из GPO Computer Configuration -> Preferences -> Windows Settings -> Registry section. Используйте те же параметры реестра в ветке HKEY_LOCAL_MACHINE Software Policies Microsoft Windows CurrentVersion Internet Settings.

Настройка параметров WinHTTP прокси групповыми политиками

Некоторые системные службы или приложения (например, служба обновлений Wususerv или PowerShell) по умолчанию не используют настраиваемые параметры прокси-сервера из параметров Internet Explorer. Чтобы эти приложения работали должным образом и имели доступ к Интернету, параметры прокси-сервера системы WinHTTP должны быть настроены в Windows.

Чтобы проверить, настроен ли на вашем компьютере прокси WinHTTP, выполните команду:

netsh winhttp show proxy

Ответ «

Direct access (no proxy server)

» означает, что прокси не установлен, система использует прямой доступ в Интернет.

netsh winhttp show proxy Прямой доступ (без прокси-сервера)

Вы можете вручную настроить прокси для WinHTTP на своем компьютере с помощью команды:

netsh winhttp set proxy 192.168.0.50:3128 "localhost;192.168.*;*.winitpro.com"

Или импортируйте настройки прокси из настроек Internet Explorer текущего пользователя:

netsh winhttp import proxy source=ie

netsh winhttp import proxy source = ie

Однако вы не сможете настроить WinHTTP через GPO – в редакторе GPO нет соответствующего параметра, а параметры хранятся в реестре в двоичном формате и не подходят для прямого редактирования.

параметры реестра WinHttpSettings

Единственный способ установить параметры прокси WinHTTP – это настроить их на эталонном компьютере, загрузить значение параметра WinHttpSettings в ветку реестра HKLM SOFTWARE Microsoft Windows CurrentVersion Internet Settings Connections в reg-файле и передать его параметр на компьютер в домене через реестр GPP.

конфигурация прокси winhttp в Windows через GPO

Источник изображения: winitpro.ru

Понравилась статья? Поделить с друзьями:
  • Прокси сервер для windows server 2016
  • Пропадает связь с роутером wifi на ноутбуке windows 10
  • Прокрутку полосы в окне windows выполняют следующими способами
  • Пропадает связь с мышкой windows 10
  • Прокрутка неактивных окон в windows 7