creative555
asked on
powershell script to switch ownership of the files.
Hello,
Could you please recommend powershell script to switch ownership of the files.
For example from user@Source.com to the user@TARGET.com
Our users were re-created from scratch in the target forest, so we need to have a script to change ownerships of files from source users to target users.
We have a different naming convention in the target for users, so the script would need to read the input excel file where I have listed the directories and new owners for the files.
Is it possible? Please help. Thank you very much!
Could you please recommend powershell script to switch ownership of the files.
For example from user@Source.com to the user@TARGET.com
Our users were re-created from scratch in the target forest, so we need to have a script to change ownerships of files from source users to target users.
We have a different naming convention in the target for users, so the script would need to read the input excel file where I have listed the directories and new owners for the files.
Is it possible? Please help. Thank you very much!
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
thanks!!
ASKER
I will just run it line by line and copy from excel. this will work. Thank you
ASKER
hello,
Solution is just to do a batch file and run line by line like this. It is easier just to copy and paste from excel all the shares and save it as the batch file.
subinacl /file test.txt /setowner=domain\foo
subinacl /file test.txt /setowner=domain\foo
subinacl /file test.txt /setowner=domain\foo
Solution is just to do a batch file and run line by line like this. It is easier just to copy and paste from excel all the shares and save it as the batch file.
subinacl /file test.txt /setowner=domain\foo
subinacl /file test.txt /setowner=domain\foo
subinacl /file test.txt /setowner=domain\foo
ASKER
This was a resolution. I just didn't realize i can run many lines in the batch file. :) THank you
ASKER
What would be a command use input excel file with current owners and directories that I need to change ownerships for?