Folder Ownership

M

Mladen Portak

Hi,

does enyone know how to change ownersip on folders via script. I would like
to set 1500 user's home directory owership how can I be able to set quota
management on it. Is it possible to do with automated script?
--
Thank You
Mladen
 
T

ThatsIT.net.au

This script will give you ownership, but if you want to give owner ship to
each user I don't think you can

/f = file or folder name

/r means recurse take owner ship of all sub folders and files

dim oShell:Set oShell = CreateObject("WScript.Shell")

dim res
res = oShell.Run("takeown /f c:\test /r")

WScript.Echo res



here is a number of quota scripts
http://dev.thatsit.net.au/samples/wsh/storage/quotas/



"Mladen Portak" <MladenPortak@discussions.microsoft.com> wrote in message
news:717BF91B-11CB-4B87-AB24-8AE35C12E171@microsoft.com...
> Hi,
>
> does enyone know how to change ownersip on folders via script. I would
> like
> to set 1500 user's home directory owership how can I be able to set quota
> management on it. Is it possible to do with automated script?
> --
> Thank You
> Mladen
 
P

Pegasus \(MVP\)

"Mladen Portak" <MladenPortak@discussions.microsoft.com> wrote in message
news:717BF91B-11CB-4B87-AB24-8AE35C12E171@microsoft.com...
> Hi,
>
> does enyone know how to change ownersip on folders via script. I would
> like
> to set 1500 user's home directory owership how can I be able to set quota
> management on it. Is it possible to do with automated script?
> --
> Thank You
> Mladen


If the users' home directory names are the same as their
account names then you can run these commands from the
parent directory of the users' home directories:

Command No. 1:
for /d %a in (*.*) do subinacl /file "%a" /setowner="%a"

Command No. 2:
for /d %a in (*.*) do subinacl /subdirectories "%a\*.*" /setowner="%a"

In view of the large number of folders it would be best if
you performed some trial runs on a disposable test folder.

Subinacl.exe is included with the Windows Resource Kit.
 
M

Mladen Portak

Thank you Pegasus,

You've saved me a lot of time!

Mladen
--
Thank You
Mladen


"Pegasus (MVP)" wrote:

>
> "Mladen Portak" <MladenPortak@discussions.microsoft.com> wrote in message
> news:717BF91B-11CB-4B87-AB24-8AE35C12E171@microsoft.com...
> > Hi,
> >
> > does enyone know how to change ownersip on folders via script. I would
> > like
> > to set 1500 user's home directory owership how can I be able to set quota
> > management on it. Is it possible to do with automated script?
> > --
> > Thank You
> > Mladen

>
> If the users' home directory names are the same as their
> account names then you can run these commands from the
> parent directory of the users' home directories:
>
> Command No. 1:
> for /d %a in (*.*) do subinacl /file "%a" /setowner="%a"
>
> Command No. 2:
> for /d %a in (*.*) do subinacl /subdirectories "%a\*.*" /setowner="%a"
>
> In view of the large number of folders it would be best if
> you performed some trial runs on a disposable test folder.
>
> Subinacl.exe is included with the Windows Resource Kit.
>
>
>
 
P

Pegasus \(MVP\)

Thanks for the feedback.

"Mladen Portak" <MladenPortak@discussions.microsoft.com> wrote in message
news:F43AC807-0490-4BD1-B732-712012674060@microsoft.com...
> Thank you Pegasus,
>
> You've saved me a lot of time!
>
> Mladen
> --
> Thank You
> Mladen
>
>
> "Pegasus (MVP)" wrote:
>
>>
>> "Mladen Portak" <MladenPortak@discussions.microsoft.com> wrote in message
>> news:717BF91B-11CB-4B87-AB24-8AE35C12E171@microsoft.com...
>> > Hi,
>> >
>> > does enyone know how to change ownersip on folders via script. I would
>> > like
>> > to set 1500 user's home directory owership how can I be able to set
>> > quota
>> > management on it. Is it possible to do with automated script?
>> > --
>> > Thank You
>> > Mladen

>>
>> If the users' home directory names are the same as their
>> account names then you can run these commands from the
>> parent directory of the users' home directories:
>>
>> Command No. 1:
>> for /d %a in (*.*) do subinacl /file "%a" /setowner="%a"
>>
>> Command No. 2:
>> for /d %a in (*.*) do subinacl /subdirectories "%a\*.*"
>> /setowner="%a"
>>
>> In view of the large number of folders it would be best if
>> you performed some trial runs on a disposable test folder.
>>
>> Subinacl.exe is included with the Windows Resource Kit.
>>
>>
>>
 
Back
Top Bottom