you could also save this as resetacl.cmd and run it
Main Topics
Browse All Topicsunable to use subinacl.exe to change ownership of files I used a script from this site but i get the error ActiveX component can't create object: 'AdsSecurity' code 800A01AD. how can i make it work. it appears to be dependant on mwmapi.dll. Trying to do this on server 2003
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
still the same error. when i just use the subinacl command to change ownership of 1 file it works when i run the script it fails. below is the script
path = "c:\"
Const oldOwner = "BUILTIN\Administrators"
Const newOwner = "domain\user"
'do not change below this point
Recurse(path)
Public Sub Recurse(path)
Set fso = CreateObject("Scripting.Fi
Set fldr = fso.GetFolder(path)
dim subfolders,files,folder,fi
Set subfolders = fldr.SubFolders
Set files = fldr.files
'Display the path and all of the folders.
Wscript.Echo ""
Wscript.Echo fldr.Path
For Each folder in subfolders
Wscript.Echo folder.path
'WScript.Echo folder.path
setOwner oldOwner,newOwner,folder.p
Next
'Display all of the files.
For Each file in files
wscript.echo file.path
setOwner oldOwner,newOwner,file.pat
Next
'Recurse all of the subfolders.
For Each folder in subfolders
Recurse folder
Next
Set subfolders = Nothing
Set files = Nothing
End Sub
Sub setOwner(oldOwner,newOwner
Set sec = CreateObject("AdsSecurity"
Set sd = sec.GetSecurityDescriptor(
WScript.Echo " - Old Owner: " & sd.owner
If lcase(sd.owner) = lcase(oldOwner) Then
WScript.Echo " - New Owner: " & newOwner
Set CommandLine = CreateObject("WScript.Shel
commandline.run "subinacl /file " & path & " /setowner=" & newOwner
End if
Set sd = Nothing
Set sec = nothing
End Sub
See if the script on this discussion works better for you
http://www.experts-exch
Also take a look at this script
Enumerate Folders and Files and Set File Permissions
the script file above works when you modify:
commandline.run "subinacl /file " & path & " /setowner=" & newOwner
to
commandline.run "subinacl /file """& path &""" /setowner=" & newOwner
Without the extra """ in the script it would only change file ownership if the file name was a single word with the extra """ it works well.
I found a more flexible program , subinacl.
The normally distributed version contained a bug. The fixed version can be downloaded from http://www.microsoft.com/d
For instance, the following command changes ownership and gives the new owner full control of the file.
subinacl /file "\data\allread\500.pdf" /setowner=jane.doe /grant=jane.doe=F
Plus, it has switches like /migratetodomain, so it might support migration, but I don't have time for much research. I think I will still just use a vba program.
Here are some other examples I noticed
* Allow the group "MYDOMAIN\Marketing" Read access to the folder "D:\Departments\Marketing"
SUBINACL /verbose=1 /subdirectories "D:\Departments\Marketing"
* Grant Read access to "Everyone" on a share:
SUBINACL /verbose=1 /share \\server\share /grant=Everyone=R
* Allow the group "MYDOMAIN\Marketing" to Print and Manage documents on the printer "Color Laser":
SUBINACL /verbose=1 /printer "Color Laser" /grant=MYDOMAIN\Marketing=
* Allow "Authenticated Users" to start and stop the "Printer Spooler" service (use its short name: "Spooler"):
SUBINACL /verbose=1 /service Spooler /grant="Authenticated Users"=LQSTOP
* Grant "Authenticated Users" write access to "HKEY_LOCAL_MACHINE\SOFTWA
SUBINACL /verbose=1 /keyreg "HKEY_LOCAL_MACHINE\SOFTWA
To check permissions, remove the /grant switch: if no "action" is specified, the default /display is used.
Business Accounts
Answer for Membership
by: dstewartjrPosted on 2009-02-25 at 16:58:46ID: 23740436
click start>>>run>>>wscript -regserver