(转自:NTFS Permission issue with TAKEOWN & ICACLS - SAUGATA   原文日期:2013.11.19)

Most of us using TAKEOWN or ICACLS for taking ownership from command prompt, and both of them are simple to use.

We generally use TAKEOWN or ICACLS with following switches to taking the ownership.
takeown /F “PATH” /R /D Y /A
icacls “PATH” /T /setowner Administrators

But unfortunately, TAKEOWN & ICACLS both might failed on certain scenario, as there are some undocumented limitation. We had incident where we tried to take ownership of a shared location hosted on NetApp Filer. While using TAKEOWN, we are getting following error.

ERROR: The data area passed to a system call is too small.

And, while using ICACLS, we are getting Access Denied error, we are also getting same error while using windows GUI for taking the ownership. We tried almost everything, but still no luck. Additionally if we are using TAKEOWN command to take the ownership of a shared location, all existing permission getting replaced by Administrators group.

Finally we found SubInACL, which is a command-line tool from Microsoft that enables administrators to view / modify security information about files, registry keys, and services. This tool is much more complex and powerful than TAKEOWN & ICACLS. To execute this tool, user must be the member of the Administrators group of that shared location. We tried this tool with following switch to obtain the ownership.

First we took the root folder ownership using following
subinacl /file “PATH” /setowner=Administrators
Later we use following switches to take the ownership on all subfolders & files.
subinacl /subdirectories “PATH*.*” /setowner=Administrators

Once done, you will get following message.

Note: Using this tool unlike TAKEOWN, your existing permission will be intact.

Update: If you want to update permission of any folder, where you are not the owner, you can use this tool to update the permission without taking the ownership of that folder. You just have to be the member of local administrator group of that server or CIFS.

最新文章

  1. QFile QDataStream QTextStream
  2. cenos 7常用操作
  3. C#/Java/C/C++基本类型所占大小及表示范围
  4. bmp格式解析
  5. JMS详细的工作原理【转】
  6. nuget pack 时不包含依赖包(而不是引用项目的dll,区别于IncludeReferencedProjects)
  7. HDU1556(树状数组)
  8. 每天一道Java题[7]
  9. 查看SQL Server数据读写分离,并设置读写分离
  10. k8s Kubernetes v1.10 最简易安装 shell
  11. BZOJ_2068_[Poi2004]SZP_树形DP
  12. 背包问题——dfs
  13. [Swift]LeetCode852. 山脉数组的峰顶索引 | Peak Index in a Mountain Array
  14. Java Properties 类读配置文件保持顺序
  15. 学习python D1
  16. 畅谈Redis和Memcached的区别
  17. SQLite中sqlite3_column_value()的返回值
  18. 为什么要用nginx
  19. 【AGC012E】 Camel and Oases ST表+状压dp
  20. some tools

热门文章

  1. (5)在tomcat运行自己的javaweb项目
  2. JDBC+XML+DOM4J
  3. BZOJ_1532_[POI2005]Kos-Dicing_二分+网络流
  4. CF上的3道小题(2)
  5. 小程序-demo:小熊の日记
  6. iOS开发,#define的使用
  7. 1.Ext.onReady详解
  8. 【136】Cydia相关插件及配置
  9. 关于loadrunner运行场景时提示“初始化失败,通信错误”的解决方案
  10. Vue的响应式原理