# Using Win-regedit module to change ie hardening

**URL:** <https://forum.ansible.com/t/using-win-regedit-module-to-change-ie-hardening/23754>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [February 17, 2017, 3:32am UTC](https://forum.ansible.com/t/using-win-regedit-module-to-change-ie-hardening/23754 "2017-02-17T03:32:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![challa.tek](https://avatars.discourse-cdn.com/v4/letter/c/b38774/32.png) [@challa.tek](https://forum.ansible.com/u/challa.tek)\
**Post date:** [February 17, 2017, 3:32am UTC](https://forum.ansible.com/t/using-win-regedit-module-to-change-ie-hardening/23754/1 "2017-02-17T03:32:31Z")

</div>

currently i am using power shell  
Set-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap' -Name ‘IEHarden’ -Value ‘0’

so , i am trying this:

- win\_regedit:  
path: 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap'  
name: IEHarden  
data: 0  
type: dword

Error:

“msg”: “Missing required argument: key”

If i debug more:

Name Used (GB) Free (GB) Provider Root

* * *

HKCR Registry HKEY\_CLASSES\_ROOT  
HKU Registry HKEY\_USERS  
HCCC Registry HKEY\_CURRENT\_CONFIG  
{“msg”:“Missing required argument: key”,“failed”:true}

If i change path to key then it executes, but doesn’t change, output shows as:

“changed”: false,  
“data\_changed”: false,  
“data\_type\_changed”: false,  
“invocation”: {  
“module\_name”: “win\_regedit”

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [February 18, 2017, 9:26pm UTC](https://forum.ansible.com/t/using-win-regedit-module-to-change-ie-hardening/23754/2 "2017-02-18T21:26:36Z")

</div>

I think maybe your module args might be indented too far. I suggest using something like yamllint.com to check your playbook yaml.

Other suggestion is to loose the trailing \ on the path: argument value.

Hope this helps,

Jon

---

<div class="post-metadata">

**Author:** ![Trent\_Scholl](https://avatars.discourse-cdn.com/v4/letter/t/43a26b/32.png) [@Trent\_Scholl](https://forum.ansible.com/u/Trent_Scholl)\
**Post date:** [March 2, 2017, 1:52am UTC](https://forum.ansible.com/t/using-win-regedit-module-to-change-ie-hardening/23754/3 "2017-03-02T01:52:16Z")

</div>

Did you end up getting this working? I’m having the same issue with win\_regedit

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [March 15, 2017, 2:37pm UTC](https://forum.ansible.com/t/using-win-regedit-module-to-change-ie-hardening/23754/4 "2017-03-15T14:37:36Z")

</div>

Ah, I think I know what is going on here…

If you are using an ansible version before 2.3 devel ‘path’ should be called ‘key’, ‘name’ should be called ‘entry’ and ‘type’ should be called ‘datatype’

The parameter names were changed (and backward compatible aliases were added for the old names) during 2.3 development as the older names didn’t match the terms used by Microsoft.

If you can, please try using ansible 2.3 development version, which is now in feature freeze, so should be stable enough to test against. I believe Release Candidates are due to start appearing soon.

All the best,

Jon
