Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > Setting permissions on home folders

Reply
Thread Tools Display Modes

Setting permissions on home folders

 
 
HAL07
Guest
Posts: n/a

 
      07-16-2009
I have recently issued disk quotas on my home folders:

at server:
dirquota autoquota add /path:\Users /sourcetemplate:"max 6gb"

then to ensure that all files in subdirs actually belongs to users and not administrators (which might have changed ownership
during years), I want to replace ownership on all sub-folders using the following script:
(run from server):

for /f %%i in ('dir /b /a:d') do (
rem rd /s /q "%%i"
cscript xcacls.vbs %%i /o mydomain \%%i /T
)

however xcacls.vbs and any other script I've tested seem to return the following error on the users top-level folder:
Error: This security ID may not be assigned as the owner of this object. (Msg#543)

If I do this manually (right click users folder and click properties, Security tab, Advanced, Owner, and set the owner to the
correct user, and check Replace owner on subcontainers and objects), it works fine! However I need a command that do this.


--
-- HAL07, Engineering Services, Norway
 
Reply With Quote
 
 
 
 
HAL07
Guest
Posts: n/a

 
      07-16-2009
HAL07 wrote:
> I have recently issued disk quotas on my home folders:
>
> at server:
> dirquota autoquota add /path:\Users /sourcetemplate:"max 6gb"
>
> then to ensure that all files in subdirs actually belongs to users and
> not administrators (which might have changed ownership during years), I
> want to replace ownership on all sub-folders using the following script:
> (run from server):
>
> for /f %%i in ('dir /b /a:d') do (
> rem rd /s /q "%%i"
> cscript xcacls.vbs %%i /o mydomain \%%i /T
> )
>
> however xcacls.vbs and any other script I've tested seem to return the
> following error on the users top-level folder:
> Error: This security ID may not be assigned as the owner of this object.
> (Msg#543)
>
> If I do this manually (right click users folder and click properties,
> Security tab, Advanced, Owner, and set the owner to the correct user,
> and check Replace owner on subcontainers and objects), it works fine!
> However I need a command that do this.
>
>

@echo off
for /f %%i in ('dir /b /a:d') do (
subinacl.exe /subdirectories "%%i" /setowner="mydomain\%%i"
)


did the trick. thanks for listening

--
-- HAL07, Engineering Services, Norway
 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting Permissions to Home folders Masti Scripting 7 04-22-2008 08:58 PM
The default permissions for home folders Mark Windows Server 1 07-21-2006 10:33 AM
Setting permissions for user home folder confused Windows Server 1 06-11-2006 03:17 AM
Setting Security permissions on users personal folders Nikki Windows Small Business Server 4 07-24-2005 03:34 AM
Re: Home Folders Permissions? Todd J Heron Active Directory 2 06-27-2005 12:44 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59