Windows 200x File Ownership
Mar 9th, 2005 by ShaunO
Having spent a little time beating my head against the XCACLS and SUBINACL wall to fix a problem I was having I did what we always do and went looking for a good third party freeware tool to solve the problem.
The problem is I am migrating my users home drives to a new server on which I wish to run quotas. If I copy all the files from one server to another, I (or actually the Administrators group) end up owning them; not much use as quotas are strictly ownership based. This has already happened in the past actually so most files are actually owned by ‘administrators’.
The problem is two-fold:
- firstly one needs to change ownership on the users folder and all its contents, and
- secondly when the copy happens it must take the ownership information with it.
The solution to first problem turned out to be quite simple with the right tool; and that tool is ‘pvt’ included in ‘Danger Tools‘ from Peter Verhás.
To change ownership on the contents of a directory is as simple as:
pvt /RECURSE CHOWN /domain="domain" /owner="username" directoryname\*.*
The second problem is simple too; ‘robocopy’ from the Windows 2003 Resource Kit is capable of doing everything correctly with regard to file permissions, attributes and ownerships during copying which other programs like copy and xcopy do not. ‘robocopy’ is also capable of doing some pretty sophisticated syncronisation things too.
Problem solved.