[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[其他] 【有奖翻译】T004:命令行工具SetACL.exe2.0.3.0(权限控制)

【活动说明】http://bbs.bathome.net/thread-2991-1-1.html

【官方网站】http://setacl.sourceforge.net/

【官方下载】http://sourceforge.net/project/showfiles.php?group_id=69165

【本地下载】http://bcn.bathome.net/s/tool/index.html?key=SetACL

【任务内容】
  1. SetACL is a set of routines for managing Windows permissions (ACLs) from the command line, from scripts and from programs. These routines can be used from various container or interface programs. Currently there exist a command line version to be used in batch files or scripts and an ActiveX control (SetACL.ocx) which can be used from any COM-enabled language (VB, WSH scripts, ...).
  2. SetACL 2.x is loosely based on my first SetACL program 0.x which I started develping in march 2001 and improved continually. After some time I realised that the design and implementation of that old version were not up to the many new features and impromvements I had in mind. So, in late december 2002, I started from scratch, using a much more flexible design approach, which resulted in the completely rewritten SetACL 2.
复制代码
  1. SetACL by Helge Klein
  2. Homepage:        http://setacl.sourceforge.net
  3. Version:         2.0.3.0
  4. Copyright:       Helge Klein
  5. License:         GPL
  6. -O-P-T-I-O-N-S--------------------------------------------------------
  7. -on    ObjectName
  8. -ot    ObjectType
  9. -actn  Action
  10. -ace   "n:Trustee;p:Permission;s:IsSID;i:Inheritance;m:Mode;w:Where"
  11. -trst  "n1:Trustee;n2:Trustee;s1:IsSID;s2:IsSID;ta:TrusteeAction;w:Where"
  12. -dom   "n1:Domain;n2:Domain;da:DomainAction;w:Where"
  13. -ownr  "n:Trustee;s:IsSID"
  14. -grp   "n:Trustee;s:IsSID"
  15. -rec   Recursion
  16. -op    "dacl:Protection;sacl:Protection"
  17. -rst   Where
  18. -lst   "f:Format;w:What;i:ListInherited;s:DisplaySID"
  19. -bckp  Filename
  20. -log   Filename
  21. -fltr  Keyword
  22. -clr   Where
  23. -silent
  24. -ignoreerr
  25. -P-A-R-A-M-E-T-E-R-S-------------------------------------------------
  26. ObjectName:      Name of the object to process (e.g. 'c:\mydir')
  27. ObjectType:      Type of object:
  28.                  file:       Directory/file
  29.                  reg:        Registry key
  30.                  srv:        Service
  31.                  prn:        Printer
  32.                  shr:        Network share
  33. Action:          Action(s) to perform:
  34.                  ace:        Process ACEs specified by parameter(s) '-ace'
  35.                  trustee:    Process trustee(s) specified by parameter(s)
  36.                              '-trst'.
  37.                  domain:     Process domain(s) specified by parameter(s)
  38.                              '-dom'.
  39.                  list:       List permissions. A backup file can be
  40.                              specified by parameter '-bckp'. Controlled by
  41.                              parameter '-lst'.
  42.                  restore:    Restore entire security descriptors backed up
  43.                              using the list function. A file containing the
  44.                              backup has to be specified using the parameter
  45.                              '-bckp'. The listing has to be in SDDL format.
  46.                  setowner:   Set the owner to trustee specified by parameter
  47.                              '-ownr'.
  48.                  setgroup:   Set the primary group to trustee specified by
  49.                              parameter '-grp'.
  50.                  clear:      Clear the ACL of any non-inherited ACEs. The
  51.                              parameter '-clr' controls whether to do this for
  52.                              the DACL, the SACL, or both.
  53.                  setprot:    Set the flag 'allow inheritable permissions from
  54.                              the parent object to propagate to this object' to
  55.                              the value specified by parameter '-op'.
  56.                  rstchldrn:  Reset permissions on all sub-objects and enable
  57.                              propagation of inherited permissions. The
  58.                              parameter '-rst' controls whether to do this for
  59.                              the DACL, the SACL, or both.
  60. TrusteeAction:   Action to perform on trustee specified:
  61.                  remtrst:    Remove all ACEs belonging to trustee specified.
  62.                  repltrst:   Replace trustee 'n1' by 'n2' in all ACEs.
  63.                  cpytrst:    Copy the permissions for trustee 'n1' to 'n2'.
  64. DomainAction:    Action to perform on domain specified:
  65.                  remdom:     Remove all ACEs belonging to trustees of domain
  66.                              specified.
  67.                  repldom:    Replace trustees from domain 'n1' by trustees with
  68.                              same name from domain 'n2' in all ACEs.
  69.                  cpydom:     Copy permissions from trustees from domain 'n1' to
  70.                              trustees with same name from domain 'n2' in all
  71.                              ACEs.
  72. Trustee:         Name or SID of trustee (user or group). Format:
  73.                  
  74.                  a) [(computer | domain)\]name
  75.                  
  76.                  Where:
  77.                  
  78.                  computer:   DNS or NetBIOS name of a computer -> 'name' must
  79.                              be a local account on that computer.
  80.                  domain:     DNS or NetBIOS name of a domain -> 'name' must
  81.                              be a domain user or group.
  82.                  name:       user or group name
  83.                  
  84.                  If no computer or domain name is given, SetACL tries to find
  85.                  a SID for 'name' in the following order:
  86.                  
  87.                  1. built-in accounts and well-known SIDs
  88.                  2. local accounts
  89.                  3. primary domain
  90.                  4. trusted domains
  91.                  
  92.                  b) SID string
  93. Domain:          Name of a domain (NetBIOS or DNS name).
  94. Permission:      Permission to set. Validity of permissions depends on the
  95.                  object type (see below). Comma separated list.
  96.                  Example:    'read,write_ea,write_dacl'
  97. IsSID:           Is the trustee name a SID?
  98.                  y:          Yes
  99.                  n:          No
  100. DisplaySID:      Display trustee names as SIDs?
  101.                  y:          Yes
  102.                  n:          No
  103.                  b:          Both (names and SIDs)
  104. Inheritance:     Inheritance flags for the ACE. This may be a comma separated
  105.                  list containing the following:
  106.                  so:         sub-objects
  107.                  sc:         sub-containers
  108.                  np:         no propagation
  109.                  io:         inherit only
  110.                  
  111.                  Example:    'io,so'
  112. Mode:            Access mode of this ACE:
  113.                  a) DACL:
  114.                  set:        Replace all permissions for given trustee by
  115.                              those specified.
  116.                  grant:      Add permissions specified to existing permissions
  117.                              for given trustee.
  118.                  deny:       Deny permissions specified.
  119.                  revoke:     Remove permissions specified from existing
  120.                              permissions for given trustee.
  121.                  b) SACL:
  122.                  aud_succ:   Add an audit success ACE.
  123.                  aud_fail:   Add an audit failure ACE.
  124.                  revoke:     Remove permissions specified from existing
  125.                              permissions for given trustee.
  126. Where:           Apply settings to DACL, SACL, or both (comma separated list):
  127.                  dacl
  128.                  sacl
  129.                  dacl,sacl
  130. Recursion:       Recursion settings, depends on object type:
  131.                  a) file:
  132.                  
  133.                  no:         No recursion.
  134.                  cont:       Recurse, and process directories only.
  135.                  obj:        Recurse, and process files only.
  136.                  cont_obj:   Recurse, and process directories and files.
  137.                  
  138.                  b) reg:
  139.                  
  140.                  no:         Do not recurse.
  141.                  yes:        Do Recurse.
  142. Protection:      Controls the flag 'allow inheritable permissions from the
  143.                  parent object to propagate to this object':
  144.                  nc:         Do not change the current setting.
  145.                  np:         Object is not protected, i.e. inherits from
  146.                              parent.
  147.                  p_c:        Object is protected, ACEs from parent are
  148.                              copied.
  149.                  p_nc:       Object is protected, ACEs from parent are not
  150.                              copied.
  151. Format:          Which list format to use:
  152.                  sddl:       Standardized SDDL format. Only listings in this
  153.                              format can be restored.
  154.                  csv:        SetACL's csv format.
  155.                  tab:        SetACL's tabular format.
  156. What:            Which components of security descriptors to include in the
  157.                  listing. (comma separated list):
  158.                  d:          DACL
  159.                  s:          SACL
  160.                  o:          Owner
  161.                  g:          Primary group
  162.                  
  163.                  Example:    'd,s'
  164. ListInherited:   List inherited permissions?
  165.                  y:          Yes
  166.                  n:          No
  167. Filename:        Name of a (unicode) file used for list/backup/restore
  168.                  operations or logging.
  169. Keyword:         Keyword to filter object names by. Names containing this
  170.                  keyword are not processed.
  171. -R-E-M-A-R-K-S--------------------------------------------------------
  172. Required parameters (all others are optional):
  173.                  -on         (Object name)
  174.                  -ot         (Object type)
  175. Parameters that may be specified more than once:
  176.                  -actn       (Action)
  177.                  -ace        (Access control entry)
  178.                  -trst       (Trustee)
  179.                  -dom        (Domain)
  180.                  -fltr       (Filter keyword)
  181. Only actions specified by parameter(s) '-actn' are actually performed,
  182. regardless of the other options set.
  183. Order in which multiple actions are processed:
  184.                  1.          restore
  185.                  2.          clear
  186.                  3.          trustee
  187.                  4.          domain
  188.                  5.          ace, setowner, setgroup, setprot
  189.                  6.          rstchldrn
  190.                  7.          list
  191. -V-A-L-I-D--P-E-R-M-I-S-S-I-O-N-S-------------------------------------
  192. a) Standard permission sets (combinations of specific permissions)
  193. Files / Directories:
  194.               read:          Read
  195.               write:         Write
  196.               list_folder:   List folder
  197.               read_ex:       Read, execute
  198.               change:        Change
  199.               profile:       = change + write_dacl
  200.               full:          Full access
  201. Printers:
  202.               print:         Print
  203.               man_printer:   Manage printer
  204.               man_docs:      Manage documents
  205.               full:          Full access
  206. Registry:
  207.               read:          Read
  208.               full:          Full access
  209. Service:
  210.               read:          Read
  211.               start_stop:    Start / Stop
  212.               full:          Full access
  213. Share:
  214.               read:          Read
  215.               change:        Change
  216.               full:          Full access
  217. b) Specific permissions
  218. Files / Directories:
  219.               traverse:      Traverse folder / execute file
  220.               list_dir:      List folder / read data
  221.               read_attr:     Read attributes
  222.               read_ea:       Read extended attributes
  223.               add_file:      Create files / write data
  224.               add_subdir:    Create folders / append data
  225.               write_attr:    Write attributes
  226.               write_ea:      Write extended attributes
  227.               del_child:     Delete subfolders and files
  228.               delete:        Delete
  229.               read_dacl:     Read permissions
  230.               write_dacl:    Write permissions
  231.               write_owner:   Take ownership
  232. Registry:
  233.               query_val:     Query value
  234.               set_val:       Set value
  235.               create_subkey: Create subkeys
  236.               enum_subkeys:  Enumerate subkeys
  237.               notify:        Notify
  238.               create_link:   Create link
  239.               delete:        Delete
  240.               write_dacl:    Write permissions
  241.               write_owner:   Take ownership
  242.               read_access:   Read control
复制代码
【奖励名单】wxcute、coolcatsfx

【活动结束】2009-05-11
我帮忙写的代码不需要付钱。如果一定要给,请在微信群或QQ群发给大家吧。
【微信公众号、微信群、QQ群】http://bbs.bathome.net/thread-3473-1-1.html
【支持批处理之家,加入VIP会员!】http://bbs.bathome.net/thread-67716-1-1.html

回复 2楼 的帖子

请问是google搜索的?还是自己翻译的?
还有,顶楼给出的版本是2.0.3.0
我帮忙写的代码不需要付钱。如果一定要给,请在微信群或QQ群发给大家吧。
【微信公众号、微信群、QQ群】http://bbs.bathome.net/thread-3473-1-1.html
【支持批处理之家,加入VIP会员!】http://bbs.bathome.net/thread-67716-1-1.html

TOP

返回列表