Guest Mladen Portak Posted August 11, 2007 Posted August 11, 2007 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
Guest ThatsIT.net.au Posted August 11, 2007 Posted August 11, 2007 Re: Folder Ownership 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
Guest Pegasus \(MVP\) Posted August 11, 2007 Posted August 11, 2007 Re: Folder Ownership "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.
Guest Mladen Portak Posted August 11, 2007 Posted August 11, 2007 Re: Folder Ownership 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. > > >
Guest Pegasus \(MVP\) Posted August 11, 2007 Posted August 11, 2007 Re: Folder Ownership 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. >> >> >>
Recommended Posts