Inherit/push/replace ownership on files/folders

By dcrew ·
I use SetACL to change most of the permissions on ascript i am writing but from what i have found it will not change the owner on a large scale. Only on a small scall like one folder, but not anything in that folder. Or one file all by its self. I am looking for a tool that will allow me to change the owner on a folder and have i change all the files in that folder to have the same owner.

Also if anyone knows of a tool that would allow me to change the permissions on the root of C: and the power users folder I could use info on that as well. I cannot get SetACL to do those things.

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Script to help setting ownership

by Fred123456 In reply to Inherit/push/replace owne ...

Your gonna need a script to do what you want..

I wrote this in 2003 to help me out..

The script gets the user name to set the permissions on from the containing folder itself. The AD User name is the same as the folder name for the user.

'This script must be run on a server logged in as mid.server.admin *
'This script will access the user directories on the server entered*
'and set the ownership of files in a users directory to the user *
'themselves. *
08/20/03 *

Const UserPath = "\e$\users\" ' Location of users directory on all File Servers

'This asks the user what server they want to run the set ownership on.
Server = InputBox("This Program will set ownership on all of a users " & _
"files, in their home directory, on a File" & _
"Server. Please enter the name of the Server on which you " & _
"wish to perform the change. Please be sure to use "& _
"just the name of the Server,for example: MIDFP1", "Server?", "MIDFP")

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set Folder = objFSO.GetFolder("\\" & Server & UserPath)
Set colFolders = Folder.SubFolders

Set errFile = objFSO.OpenTextFile("\\" & Server & "\c$\OwnErr.txt",8, True)

Set objShell = Wscript.CreateObject("Wscript.Shell")

'For Next Loop to process all user directories in the folder
For Each objFolder In colFolders
User = objFolder.Name
Wscript.Echo objFolder.Path
Set objExecObject = objShell.Exec("C:\subinacl.exe /noverbose /subdirectories " & objFolder.Path & "\ /setowner=Courts\" & User)
If strline = "" Then
errFile.WriteLine ("Their was a problem when setting ownership on files in " & User & "'s folder.")
End If
Loop Until objExecObject.StdOut.AtEndOfStream

MsgBox "Set ownership is complete. Their is a log file of all errors located on " & _
"the root of " & Server & " and its called OwnErr.txt. Have a nice day.",0,"Done!"

Collapse -

Check this out

by Anthony Waters In reply to Inherit/push/replace owne ...

Here is a link to a program called subinacl. It may be what you are looking for.

Back to Software Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums