I was wondering if I can get a powershell or vb script to take ownership of multiple files so that I can modify and add NTFS permissions using the script. I get access denied error when even trying to do NTFS inventory.
Below is what I need to do but not just manually for one folder, I need to fix thousands of folders. Thank you very much.
To take ownership of a file or folder, follow these steps:
Press and hold the folder that you want to take ownership of, then tap Properties. (If you are using a mouse, right-click the folder, and then click Properties.)
Tap or click the Security tab, tap or click Advanced, then tap or click Change. If you are prompted for an administrator password or for confirmation, type the password or provide confirmation.
Type the name of the person that you want to give ownership to, and then click Check Names.
Note The account name for the person that you are assigning ownership to is displayed.
If you want this person to be the owner of the files and subfolders that are contained in this folder, select the Replace owner on subcontainers and objects check box.