Proxy settings without login
If we have a machine that needs to use a proxy for all users, we need to setup that proxy first in the settings. For a user to be able to use the proxy settings we defined, we need to first login as the user, launch Internet Explorer interactively in order to configure the changes.
If we have a service account that needs to use it, we can login in the machine manually. However, if we have hundreds of machines this can be unpractical. Luckily there is a workaround that will enable us to use the defined proxy without needing to login manually or open Internet Explorer in all of these machines.
We are describing These ones only need to be performed once:
- Login as a user
- Open Internet Explorer
- Open the Registry Editor
- Access
HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections
- Copy the value under the key
DefaultConnectionSettings
These steps need to be performed on each machine:
- Run the Registry Editor as the service account
- Access
HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections
- Copy the saved value to
DefaultConnectionSettings
of binary type
The second part of the workflow can be automated with Ansible:
- name: Set proxy settings
become: yes
become_user: "{{ user }}"
become_method: runas
win_regedit:
path: HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Connections
name: DefaultConnectionSettings
data: "{{ data }}"
type: binary
state: present