+ Post New Thread
Results 1 to 14 of 14
Windows Thread, File ownership pita! in Technical; Hi - I was using robocopy to move user's folders around onto some new diskspace today (W2003) - when it ...
  1. #1

    SpuffMonkey's Avatar
    Join Date
    Jul 2005
    Posts
    2,230
    Thank Post
    54
    Thanked 278 Times in 186 Posts
    Rep Power
    134

    File ownership pita!

    Hi - I was using robocopy to move user's folders around onto some new diskspace today (W2003) - when it burped on one user's folders. This kid had contrived to remove permissions from everyone but himself - meaning I (as administrator) couldn't move the files. I managed to take ownership and change the perms back - but only one file at a time - very irritating and time consuming - anyone know of a way to do bulk changes on ownership should this happen again - and even better - prevent them fiddling in the first place (I thought I had - but there you go)

    See some of you guys tomorrow

    Cheers

  2. #2

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,803
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224

    Re: File ownership pita!

    1. Don't give them full control. Just read/write/modify.
    2. Set the permissions on the top level folder then go into advanced and set the inheritance up.
    3. There's also a button in the advanced controls to overwrite all the permissions on the sub folders/files in one go.

  3. #3
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    4,999
    Thank Post
    120
    Thanked 280 Times in 258 Posts
    Rep Power
    106

    Re: File ownership pita!

    I use a similar approach to when I have to apply mass permission changes using xcacls.

    You need the windows version of chown and this code:

    Code:
    rem sets permission on all files according to home directory name
    
    for /D %%i in (*) do (
    chown -r %%i "%%i\*.*"
    )
    Execute this at the same level as the users folders. You must take ownership yourself before hand. I just select all the folders and do it through the GUI.

    For file permissions I use:
    Code:
    for /D %%i in (*) do (
       xcacls %%i /T /E/G yourdomain\domain admins:F /y
       xcacls %%i /T /E /G yourdomain\%%i:C /y
    )
    This is obviously for a full folder worth of home directories though.

  4. #4
    sahmeepee's Avatar
    Join Date
    Oct 2005
    Location
    Greater Manchester
    Posts
    795
    Thank Post
    20
    Thanked 70 Times in 42 Posts
    Rep Power
    33

    Re: File ownership pita!

    You can also accomplish this with the subinacl resource kit tool from Microsoft

  5. #5
    ajbritton's Avatar
    Join Date
    Jul 2005
    Location
    Wandsworth
    Posts
    1,632
    Thank Post
    23
    Thanked 75 Times in 45 Posts
    Rep Power
    34

    Re: File ownership pita!

    You can remove the 'security' tab from explorer via a group policy setting, but you would also need to prevent access to the command line (use of cacls, xcacls or similar).

    Any file/folder created by any user becomes 'owned' by that user and when a user 'owns' a file/folder, they can always modify the permissions, regardless of the permissions set on the parent folder.

    The only suggestion I have ever seen to prevent this is to modify the permissions on the share that users connect via such that they are limited to 'modify'. I always redirect 'My Documents' to the home directory and XP refused to do this when it realised that the user did not have full access to the folder.

  6. #6
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    4,999
    Thank Post
    120
    Thanked 280 Times in 258 Posts
    Rep Power
    106

    Re: File ownership pita!

    Quote Originally Posted by sahmeepee
    You can also accomplish this with the subinacl resource kit tool from Microsoft
    I tried this and found it hard to work with Ownership. Thats when I found the Windows version of chown.

  7. #7

    SpuffMonkey's Avatar
    Join Date
    Jul 2005
    Posts
    2,230
    Thank Post
    54
    Thanked 278 Times in 186 Posts
    Rep Power
    134

    Re: File ownership pita!

    Quote Originally Posted by ChrisH
    Execute this at the same level as the users folders. You must take ownership yourself before hand. I just select all the folders and do it through the GUI.
    Alas - the GUI wouldn't let me select more than one file at a time - and selecting the folder just changed the folder ownership - but not the files within - real pita - I'll have a play with the scripts suggested tho' - thanks

  8. #8
    DMcCoy's Avatar
    Join Date
    Oct 2005
    Location
    Isle of Wight
    Posts
    3,427
    Thank Post
    10
    Thanked 488 Times in 428 Posts
    Rep Power
    111

    Re: File ownership pita!

    Quote Originally Posted by SpuffMonkey
    Quote Originally Posted by ChrisH
    Execute this at the same level as the users folders. You must take ownership yourself before hand. I just select all the folders and do it through the GUI.
    Alas - the GUI wouldn't let me select more than one file at a time - and selecting the folder just changed the folder ownership - but not the files within - real pita - I'll have a play with the scripts suggested tho' - thanks
    Properties, Security, Advanced. See attached picture, the tickbox
    Attached Images Attached Images

  9. #9
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    4,999
    Thank Post
    120
    Thanked 280 Times in 258 Posts
    Rep Power
    106

    Re: File ownership pita!

    ^^^^^ Thats what I meant select all folders then tick that box.
    If your going to change their permissions as suggested you will need to do things in this order.
    1. Take ownership of all their files and folders.
    2. Run the permission batch file.
    3. Run the ownership batch file.

  10. #10

    SpuffMonkey's Avatar
    Join Date
    Jul 2005
    Posts
    2,230
    Thank Post
    54
    Thanked 278 Times in 186 Posts
    Rep Power
    134

    Re: File ownership pita!

    Quote Originally Posted by ChrisH
    ^^^^^ Thats what I meant select all folders then tick that box.
    If your going to change their permissions as suggested you will need to do things in this order.
    1. Take ownership of all their files and folders.
    2. Run the permission batch file.
    3. Run the ownership batch file.
    Doh! ops:

  11. #11
    sahmeepee's Avatar
    Join Date
    Oct 2005
    Location
    Greater Manchester
    Posts
    795
    Thank Post
    20
    Thanked 70 Times in 42 Posts
    Rep Power
    33

    Re: File ownership pita!

    Quote Originally Posted by ChrisH
    Quote Originally Posted by sahmeepee
    You can also accomplish this with the subinacl resource kit tool from Microsoft
    I tried this and found it hard to work with Ownership. Thats when I found the Windows version of chown.
    True enough. Subinacl is pretty powerful, but not much fun to work with.

  12. #12
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    4,999
    Thank Post
    120
    Thanked 280 Times in 258 Posts
    Rep Power
    106

    Re: File ownership pita!

    When I tried it just wasnt doing what I asked very frustrating. CHOWN is far easier to work with and involves less teeth grinding and hair pulling

  13. #13
    DMcCoy's Avatar
    Join Date
    Oct 2005
    Location
    Isle of Wight
    Posts
    3,427
    Thank Post
    10
    Thanked 488 Times in 428 Posts
    Rep Power
    111

    Re: File ownership pita!

    Quote Originally Posted by ChrisH
    When I tried it just wasnt doing what I asked very frustrating. CHOWN is far easier to work with and involves less teeth grinding and hair pulling
    I forget which command line util it was, but one of the ownership tools that shipped with 2003 original cd completed sucessfully but didn't do anything, there was a kb about it.

    Was quite frustrating at the time and forced me to abandon the ms quota system and go for quota server.

  14. #14
    tarquel's Avatar
    Join Date
    Jun 2005
    Location
    Powys, Mid-Wales, UK
    Posts
    1,740
    Thank Post
    13
    Thanked 44 Times in 34 Posts
    Rep Power
    29

    Re: File ownership pita!

    I use xcalcs in my usermaker script - it does need tweaking tho

    its a pain at the moment because I've got 98 machines so i precreate the profile so that 98 is happy when logging on.

    Still get the "you havent logged on to this machine before. Would you like windows to remember you" type window appearing on 98

    but it works and thats all that matters lol

    N.

SHARE:
+ Post New Thread

Similar Threads

  1. User drive permissions and ownership
    By OutLawTorn in forum Scripts
    Replies: 0
    Last Post: 30th November 2007, 12:15 AM
  2. Total Cost of Ownership
    By Face-Man in forum General Chat
    Replies: 24
    Last Post: 19th November 2007, 10:07 AM
  3. Ownership and Permissions
    By TechSupp in forum How do you do....it?
    Replies: 2
    Last Post: 5th October 2007, 10:38 PM
  4. Got a folder I cannot delete or take ownership of
    By sidewinder in forum Windows
    Replies: 2
    Last Post: 20th March 2007, 02:49 PM
  5. Replies: 4
    Last Post: 23rd March 2006, 06:27 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •