# Set-Acl

**URL:** <https://forums.powershell.org/t/set-acl/6602>\
**Category:** PowerShell Help\
**Created:** [June 8, 2016, 12:50am UTC](https://forums.powershell.org/t/set-acl/6602 "2016-06-08T00:50:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrew-rasdell](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@andrew-rasdell](https://forums.powershell.org/u/andrew-rasdell)\
**Post date:** [June 8, 2016, 12:50am UTC](https://forums.powershell.org/t/set-acl/6602/1 "2016-06-08T00:50:38Z")

</div>

I recently had to perform several manual steps to start some DNS logging across our Domain PCs / Laptops. This basically involved the System32 directory and some dns.xxx files within. (Take ownership, changes permissions, rename, stop \> start the dnscache service.

(Windows 7 64bit, Powershell version 2.0).

As a challenge I attempted to script this in Powershell and came up against .NET for some pieces of my script. My question is, does anyone know if there is any difference between how set-acl performs between Powershell versions. I use Powershell Version 5 for testing and development - I can run my script within Powershell version 5.0 with no errors, but hit issues in version 2.0 - it looks like UAC or some type of access denied trying to set ACL?

set-acl attempted to perform an unauthorized operation

---

<div class="post-metadata">

**Author:** ![nigel-tatschner](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/nigel-tatschner/32/312_2.png) [@nigel-tatschner](https://forums.powershell.org/u/nigel-tatschner)\
**Post date:** [June 8, 2016, 9:08am UTC](https://forums.powershell.org/t/set-acl/6602/2 "2016-06-08T09:08:27Z")

</div>

This might be of no help, but I recently had this kind of issue.

It was to do with the elevation of the security token, all I did was to run the powershell console as Admin and it worked.

Might be worth research?

I was using this;

> **[Changing Ownership of File or Folder Using PowerShell](https://learn-powershell.net/2014/06/24/changing-ownership-of-file-or-folder-using-powershell/)**
>
> While working on a project recently, I needed to find an easy way to take ownership of a profile folder and its subfolders to allow our support staff to either delete the profile or be able to trav…

---

<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:41pm UTC](https://forums.powershell.org/t/set-acl/6602/3 "2024-05-16T20:41:04Z")

</div>

Closed on May 16, 2024, 8:41pm UTC


