Configuring Proxy Settings via GPO on Windows – TheITBros |
您所在的位置:网站首页 › excel表格里的图片批量导出 › Configuring Proxy Settings via GPO on Windows – TheITBros |
516
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). [ez-toc] 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: Open Group Policy Management Console (gpmc.msc); 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); Right-click on OU and select Create a GPO in this domain and link it here;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). 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. Select New Item > IP address ranges. Specify the range of IP addresses in your subnet for which you want to apply proxy settings. Save the policy settings. Similarly, create several IE policies with proxy settings for different IP subnets. 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_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings. Note. Learn how to configure Edge GPO settings. 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:\Software\Microsoft\Windows\CurrentVersion\Internet 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;' Set-ItemProperty -Path $proxyregkey-Name AutoDetect -Value 0This 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 HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings]: ProxyEnable (REG_DWORD) = 00000001; ProxyServer (REG_SZ) = 192.168.1.11:3128; ProxyOverride (REG_SZ) = 192.*;*.theitbros.com.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 = "HKLM\Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings" New-ItemProperty -Path $proxyregkey -Name ProxySettingsPerUser -Value 0To 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 proxyCurrent 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=ieThese settings will be saved in the WinHttpSettings parameter under the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Connections. 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. 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. 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 ExplorerIf 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. 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. Create a new GPO with proxy settings (or edit an existing one); 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: Software\Policies\Microsoft\Internet Explorer\Control Panel Value name: Proxy Value type: REG_DWORD Value data: 00000001The second parameter blocks the launch of the IE window with proxy settings: Hive: HKEY_CURRENT_USER Key Path: Software\Policies\Microsoft\Internet Explorer\Restrictions Value name: NoBrowserOptions Value type: REG_DWORD Value data: 00000001 These policies will apply to all computer users; 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; Then open the properties of each of these two registry settings, go to Common > Item level targeting > Targeting; Create a new targeting rule: New > Security Group > provide a group name (ca_workstation_admins);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_PROXYYou 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. |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |