Take ownership on all folders/subfolders and files

Posted on 2011-10-23
Medium Priority
Last Modified: 2012-06-27
Dear experts,

is there any possibility to change the "owner" for all folders/subfolders and files from text file using script with combination of takeown.exe with logging please?
The script reads a text file and it changes the owerships for all folders - subfolders and files for each specific folders.

Thanks in advance,

Question by:DigitBoy
LVL 13

Accepted Solution

lciprianionut earned 2000 total points
ID: 37015053
Hi, You can try next in POwerShell while you are in C:\Windows\system32 folder

Get-Content c:\files.txt | ForEach-Object { .\takeown.exe /f "$_" /A /R } | Tee-Object -FilePath c:\files_log.txt

Author Closing Comment

ID: 37016297
Thanks a lot it worked great :)

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A walk-through example of how to obtain and apply new DID phone numbers to your cloud PBX enabled users that are configured in Office 365. Whether you have 1, 10 or 100+ users in your tenant, it's quite easy to get them phone-enabled and making/rece…
Measuring Server's processing rate with a simple powershell command. The differences in processing rate also was recorded in different use-cases, when a server in free and busy states.
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question