Jump to content

Recommended Posts

Posted (edited)

Hi,

 

I've just re-enabled Quotas on my Server 2012 and noticed that loads of home areas were using 0%. This means that when the data was robocopied across the files and folders have lost ownership permissions.

 

Our Home folders are structured as following:

 

I:\UserHomes\Borough_-_School Name\Staff\Username
                                  \Student\Year 7\Username
                                           \Year 8\Username
                                           \Year 9\Username
                                           \Year 10\Username
                                           \Year 11\Username
                                           \Year 12\Username

 

Domain Administrator has ownership of all the top level folders.

 

Is there a feature in Server 2012 that will set ownership of the folder to what the folder is named? Or alternatively does anyone have any scripts that will do this.

 

Thanks,

 

Michael

Edited by linkazoid
Posted

The little utility chown.exe will do this for you, with this batch script:

 

for /D %%i in (*) do (
chown -r %%i "%%i\*.*"
)

 

Place chown.exe and the batch file in each root directory, and run it - it sets ownership to the folder name. It's ace, we run it every year when new users are created as the utility we use does not set ownership automatically.

  • Thanks 2
Posted (edited)

I have a GNU version, I will try that one instead

 

Edit - that version seems to be better. Lots of access denied messages now. hmmm

 

Edit 2 - Ran it in elevated powershell instead of elevated cmd and it worked great.

 

Thanks

Edited by CHR1S

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...