# Changing Local Security Policies using Powershell

**URL:** <https://forums.powershell.org/t/changing-local-security-policies-using-powershell/1829>\
**Category:** PowerShell Help\
**Created:** [August 22, 2013, 4:35am UTC](https://forums.powershell.org/t/changing-local-security-policies-using-powershell/1829 "2013-08-22T04:35:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![steve-soares](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@steve-soares](https://forums.powershell.org/u/steve-soares)\
**Post date:** [August 22, 2013, 4:35am UTC](https://forums.powershell.org/t/changing-local-security-policies-using-powershell/1829/1 "2013-08-22T04:35:05Z")

</div>

I was wondering if was possible to write a script to change local security policies such as account policy and audit policy.Some guidance would be appreciated.

Thanks,

Steve

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/1X/385e4f9fe133561ad30a814262fe0e0ae6bc3ef0.png) [@system](https://forums.powershell.org/u/system)\
**Post date:** [August 22, 2013, 4:42am UTC](https://forums.powershell.org/t/changing-local-security-policies-using-powershell/1829/2 "2013-08-22T04:42:09Z")

</div>

I don’t know, off the top of my head, if there are cmdlets to do this (and if there are, they probably only exist in Windows 8 / Server 2012). You can always use the old command-line utilities from a PowerShell script, though (net accounts, and auditpol.exe).

---

<div class="post-metadata">

**Author:** ![steve-soares](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@steve-soares](https://forums.powershell.org/u/steve-soares)\
**Post date:** [August 22, 2013, 7:21am UTC](https://forums.powershell.org/t/changing-local-security-policies-using-powershell/1829/3 "2013-08-22T07:21:53Z")

</div>

Is it possible to do it with a batch file?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/1X/385e4f9fe133561ad30a814262fe0e0ae6bc3ef0.png) [@system](https://forums.powershell.org/u/system)\
**Post date:** [August 22, 2013, 7:39am UTC](https://forums.powershell.org/t/changing-local-security-policies-using-powershell/1829/4 "2013-08-22T07:39:03Z")

</div>

Yep. Same commands I mentioned before: “net accounts” and “auditpol.exe”.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:57pm UTC](https://forums.powershell.org/t/changing-local-security-policies-using-powershell/1829/5 "2024-05-16T20:57:38Z")

</div>


