ChristianDavies Posted February 4, 2014 Posted February 4, 2014 Hi All, I have a problem where some files in some home folders are losing their inherited permissions, it is affecting over 200 home folder. Basically I need a script/batch file that can take the permissions from the Root folder (which are all fine) and propagate them down, this would resolve the issues we are having. I can do it individually and it resolves the issues however its a little impractical to do this 200 times, folder by folder. Any one have a batch file or something that can do this? I have used iCacls in the past but I can't seem to get this to work this time. Any help appreciated
nickbro Posted February 4, 2014 Posted February 4, 2014 (edited) This is the one I've used @echo off REM Create list of folders dir /a:d /b "c:\Home Directories" >C:\users.txt REM Read each line from just created text file... for /f "tokens=*" %%G in (C:\users.txt) do ( takeown /f "c:\Home Directories\%%G" /r /d y icacls "c:\Home Directories\%%G" /setowner "domain\%%G" /T /C /Q icacls "c:\Home Directories\%%G" /T /C /Q /RESET echo. ) Takeown takes ownership then you set the owner and reset the permissions Edited February 4, 2014 by nickbro 1
ChristianDavies Posted February 5, 2014 Author Posted February 5, 2014 Cheers! A bit of alteration and testing and that worked
mickeyh080 Posted February 25, 2014 Posted February 25, 2014 Any idea if this will work on server 2012. Just carried out a server upgrade from 2003 to 2012 and its randomly altered student home folders permissions and ownership. I used Robocopy for the transfer and previously it worked a treat from 2003 to 2008 but not this time.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now