Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


December 2002

Control ACEs and ACLs with Subinacl

More on what this handy tool can do for you
RSS
Subscribe to Windows IT Pro | See More Domains Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

The syntax for the /changedomain parameter is

subinacl [object] /changedomain=
olddomainname=newdomainname

where object is the type and name of the item for which you want to change the ACEs and olddomainname and newdomainname are the names of the old and new domains, respectively. Recall from the October column that the object type can be a file (/file), subdirectory (/subdirectory), registry key (/keyreg), share (/share), or other value. So, for example, to examine every file and folder on the C drive and change any SIDs from the ENGINEERING domain to their corresponding SIDs on the ALLOFUS domain, you use the command

subinacl /subdirectories c:\* /changedomain=engineering=allofus

The /migratedomain parameter has the same syntax and behavior as /changedomain, with one exception: Instead of replacing ACEs that refer to the old domain with ACEs that refer to the new domain, the /migratedomain option supplements ACEs that refer to the old domain with ACEs that refer to the new domain. In other words, if an old domain account has full-control access to a folder and you run the /changedomain option, the old domain account doesn't have access to that folder any more. Only the new domain account has full-control access. But if you run the /migratedomain option, both the old domain account and the new domain account have full-control access to the folder.

Testing Access
You can use Subinacl to make sure that the user accounts in a newly migrated master domain have access to resources in the old domains. The Subinacl command's /accesscheck parameter lets you test access. This parameter answers the question, "Can person X access object Y?"

The syntax for the /accesscheck parameter is

subinacl [object] /accesscheck=
domainname\username

where object is the type and name of the item to which you're checking access, domainname is the name of the user's domain, and username is the name of the user. So, for example, to determine whether Mary can access the C:\testit.txt file from her account in the ALLOFUS domain, you run the command

subinacl /file c:\testit.txt /accesscheck=allofus\mary

Subinacl then asks you for Mary's password. How do you get your hands on Mary's password? Remember that the /accesscheck option is a postmigration test tool. If you used a program such as addusers.exe to migrate user accounts, you assigned a temporary password, which the users will change when they log on for the first time after the migration. But until Mary logs on, you'll know her new account's password.

Backing Up and Restoring ACLs
I saved one of the best options for last: ACL backup and restore. The Subinacl command's /noverbose and /output parameters let you take a snapshot of the ACL on an object or group of objects, and the /playfile option lets you restore the ACL. The syntax for the /output parameter is

subinacl /noverbose /output=filename subinacl command

where subinacl command is a set of Subinacl object types and actions—basically any Subinacl command that you've seen in this column or the October column. So, for example, to back up the NTFS ACLs on all the files in the root directory of the C drive to a file called C:\aclbackups.txt, you use the command

subinacl /noverbose /output=
c:\aclbackups.txt /file c:\*

If you run this command without the /output parameter, you'll see that it just reports on (but doesn't store) the ACLs. The /output parameter prompts Subinacl to store the output to a file.

To reapply a file's ACLs and wipe out any ACL changes that you've made since the backup, you use the /playfile option. Just invoke the Subinacl command with the /playfile parameter followed by the name of the backup file. For example, the command

subinacl /playfile c:\aclbackups.txt

fully restores the NTFS ACLs on all the files in the C drive's root directory.

Don't Kick Yourself Later
The more I use Subinacl, the more I find use for it—and the more I kick myself for not having learned it earlier. Learn from my experience and start using Subinacl now.

End of Article

   Previous  1  [2]  Next  


Reader Comments
Although the article covers the details of subinacl it doesn't recognize it's one failing, the fact that it doesn't operate correctly on NTFS 5 volumes, so that you end up receiving "permissions incorrectly ordered" message after using the tool. I'd be interesting in knowing why Microsoft has never updated subinacl or xcacls to resolve this issue.

Mark Peterson December 10, 2002


Is there a similar tool to modify the permissions for the user profiles? I'd to update the permissions so that users from both domains of a migration can login to the same profile without having to recreate the profile from scratch. This would be a great timesaver to use along with the subinacl tool during a migration.

Geoff Faulkner May 28, 2003


Hi,
This is a very usefull tool, but I have a question I made some test to backup the ACL´s but if I have a big file structure (3 or 4 folders levels) only the root level is backep up. Do you have any tip for this?????
From Venezuela
Thanks,

Federico Parra January 26, 2004


I have successfully used this tool to replace ACL's. I am in deparate need for a tool that will add an ACL based on an existing ACL. Such as the replace command but ADD.

Is there such a tool for this?

Jennifer May 17, 2004


look for the newest version of subinacl - fixes the ordering issue.. Anyone know what syntax would record just the ACL's of all Subfolders (not files)

davidponak July 29, 2004 (Article Rating: )


How to you use this tool to clean away orphan SID from the NTFS file.

Anonymous User January 05, 2005


Hi All,

Im trying to backup/restore ACL prmissions for the windows NTFS files/folders. i decided to use subinacl tool.

i successfully backed up the ACL permissions using the command : subinacl.exe /outputlog="test.log" /file test.txt.

When i try to restore the ACL permisions using the command :subinacl.exe /playfile test.log.

But no luck. when i check the test.txt file's security information, notthing is availabale. there is no users/groups and permissions. its just cleaned all the informations and also i couldnt open the file. im wondering is ther any thing i have to do ?

here is some output of /playfile command:

C:\Program Files\Windows Resource Kits\Tools>subinacl.exe /playfile test.log

WARNING : /pace =builtin\administrators access_allowed_ace_type-0x0 : Invalid option : test.txt
WARNING : /pace =system access_allowed_ace_type-0x0 : Invalid option : test.txt
WARNING : /pace =<username>\administrator access_allowed_ace_type-0x0 : Invalid option : test.txt
WARNING : /pace =builtin\users access_allowed_ace_type-0x0 : Invalid option : test.txt
test.txt : <username>\administrator is the new owner
test.txt : <username>\none is the new Primary Group
test.txt : 3 change(s)


Elapsed Time: 00 00:00:00
Done: 1, Modified 1, Failed 0, Syntax errors 4
Last Done : test.txt
Last Syntax Error:WARNING : /pace =builtin\users access_allowed_ace_type-0x0 : Invalid option :test.txt

i dont know why its failed with invalid option. i loggin in as administrator only. i need your help urgently.

any help would be appriciated . thanks in advance.

-prince

ilavaa May 10, 2007 (Article Rating: )


You must be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now




Top Viewed ArticlesView all articles
WinInfo Short Takes: Week of November 9, 2009

An often irreverent look at some of the week's other news, including some more Windows 7 sales momentum, some Sophos stupidity, Microsoft's cloud computing self-loathing, more whining from the browser makers, Zoho's "Fake Office," and much, much more ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

Windows 7 Sets Sales Record

Microsoft CEO Steve Ballmer described Windows 7's first ten days of sales as "fantastic" while in Japan yesterday. ...


Related Events WinConnections and Microsoft® Exchange Connections

Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement