# Windows SecPol

**URL:** <https://forum.ansible.com/t/windows-secpol/24602>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [May 30, 2017, 8:02pm UTC](https://forum.ansible.com/t/windows-secpol/24602 "2017-05-30T20:02:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Rose](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@David\_Rose](https://forum.ansible.com/u/David_Rose)\
**Post date:** [May 30, 2017, 8:02pm UTC](https://forum.ansible.com/t/windows-secpol/24602/1 "2017-05-30T20:02:12Z")

</div>

Hello all!  
Brand new to Ansible. I just successfully got the ad-hoc Windows ping/pong to work! I wanted to ask a question related to Windows secpol (Security Policy).

Is there a module to allow Ansible to set SecPol values for hosts specified in the inventory? For instance:  
[System Access]  
MinimumPasswordAge = 2  
MaximumPasswordAge = 30  
MinimumPasswordLength = 8  
PasswordComplexity = 1  
EnableGuestAccount = 0  
[System Log]  
MaximumLogSize = 81920  
AuditLogRetentionPeriod = 0  
RestrictGuestAccess = 1

Appreciate any feedback or direction you may be able to send to me!  
-dave

---

<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:** [June 1, 2017, 12:16pm UTC](https://forum.ansible.com/t/windows-secpol/24602/2 "2017-06-01T12:16:42Z")

</div>

Hi,

Not quite. There’s a not-yet-merged pull request for a secpol module.

[https://github.com/ansible/ansible/pull/22775](https://github.com/ansible/ansible/pull/22775)

However, there is a plan to break it up into more than one module,

If you are in a hurry you could

try out the above module (you can add custom modules to your ansible installation by setting the ‘library’ setting to point at somewhere (default is /etc/ansible/library) in your ansible.cfg and copying the module files into the library location.

use win\_template module to create the sec pol input file and use win\_shell or win\_command module to run secedit on the command line

Hope this helps,

Jon
