Take Ownership of paths from PowerShell

Posted by robd on April 25, 2023


Had a requirement to take ownership of a long list of windows file paths which were conviently in a csv file like this:



So I used the following PowerShell and NTFSSecurity module.

#import this first (run powershell as Admin)
#Install-Module -Name NTFSSecurity

#Fill out the csv with all the paths you want to change

Import-CSV "C:\Temp\scripts\permissions.csv" |
    Add-NTFSAccess -Path $_.path -Account admin@domain.com -AccessRights FullControl
    Set-NTFSOwner -Path $_.path -Account  admin@domain.com



Tags: , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.