We help IT Professionals succeed at work.

user lost ownership on many folder and file need command line to attribute ownership

High Priority
156 Views
Last Modified: 2019-05-13
hello,

i have a problem with user redirected/home folder, he lost access on many file and sub folder , when i see those file and folder not have owner.

how i can use a command line to take the user owneship on all those filer and folder and may be need to add him full controll access on it.

the home folder file is located on \\server\users\jhon.smith\subfolder....

thanks for help
Comment
Watch Question

JohnBusiness Consultant (Owner)
Most Valuable Expert 2012
Expert of the Year 2018

Commented:
You should first determine what happened and how. I do not see users losing ownership of their own folders.

To regain ownership, see below

https://www.oreilly.com/library/view/windows-server-cookbook/0596006330/ch04s18.html

Author

Commented:
hello,

yes but i need the right command line to get all file and folder...
JohnBusiness Consultant (Owner)
Most Valuable Expert 2012
Expert of the Year 2018

Commented:
When you assign ownership (or permissions) there is a setting / option to apply to all subfolders.  Start at the top and you should be able to do this in a single operation.

As I noted, what happened and why as that may possible have a bearing on re-assigning ownership.
JohnBusiness Consultant (Owner)
Most Valuable Expert 2012
Expert of the Year 2018

Commented:
See also this:

https://community.spiceworks.com/topic/293108-how-to-take-ownership-of-fileserver-folder-and-reset-all-ntfs-permissions

Quote "... was to go the parent folder right above the problematic folder go into the Sharing properties, advanced and take ownership but be sure to mark the check box to have it populate to all child/subfolder objects. "
Business Consultant (Owner)
Most Valuable Expert 2012
Expert of the Year 2018
Commented:
If powershell serves your needs better, here is a script from TechNet

https://gallery.technet.microsoft.com/scriptcenter/Set-Owner-ff4db177

Explore More ContentExplore courses, solutions, and other research materials related to this topic.