Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.04 KB | None | 0 0
  1. ###########
  2. # icacls
  3. Displays or modifies discretionary access control lists (DACLs) on specified files,
  4. and applies stored DACLs to files in specified directories.
  5.  
  6. For examples of how to use this command, see Examples.
  7.  
  8. Syntax
  9.  
  10. Copy
  11. icacls <FileName> [/grant[:r] <Sid>:<Perm>[...]] [/deny <Sid>:<Perm>[...]] [/remove[:g|:d]] <Sid>[...]] [/t] [/c] [/l] [/q] [/setintegritylevel <Level>:<Policy>[...]]
  12. icacls <Directory> [/substitute <SidOld> <SidNew> [...]] [/restore <ACLfile> [/c] [/l] [/q]]
  13.  
  14. Parameters
  15. Parameter Description
  16. <FileName> Specifies the file for which to display DACLs.
  17. <Directory> Specifies the directory for which to display DACLs.
  18. /t Performs the operation on all specified files in the current directory and its subdirectories.
  19. /c Continues the operation despite any file errors. Error messages will still be displayed.
  20. /l Performs the operation on a symbolic link versus its destination.
  21. /q Suppresses success messages.
  22. [/save <ACLfile> [/t] [/c] [/l] [/q]] Stores DACLs for all matching files into ACLfile for later use with /restore.
  23. [/setowner <Username> [/t] [/c] [/l] [/q]] Changes the owner of all matching files to the specified user.
  24. [/findSID <Sid> [/t] [/c] [/l] [/q]] Finds all matching files that contain a DACL explicitly mentioning the specified security identifier (SID).
  25. [/verify [/t] [/c] [/l] [/q]] Finds all files with ACLs that are not canonical or have lengths inconsistent with ACE (access control entry) counts.
  26. [/reset [/t] [/c] [/l] [/q]] Replaces ACLs with default inherited ACLs for all matching files.
  27. [/grant[:r] <Sid>:[...]] Grants specified user access rights. Permissions replace previously granted explicit permissions.
  28. Without :r, permissions are added to any previously granted explicit permissions.
  29. [/deny <Sid>:[...]] Explicitly denies specified user access rights. An explicit deny ACE is added for the stated permissions and the same permissions in any explicit grant are removed.
  30. [/remove[:g|:d]] <Sid>[...]] [/t] [/c] [/l] [/q] Removes all occurrences of the specified SID from the DACL.
  31. :g removes all occurrences of granted rights to the specified SID.
  32. :d removes all occurrences of denied rights to the specified SID.
  33. [/setintegritylevel [(CI)(OI)]<Level>:[...]] Explicitly adds an integrity ACE to all matching files. Level is specified as:
  34. - L[ow]
  35. - M[edium]
  36. - H[igh]
  37.  
  38. Inheritance options for the integrity ACE may precede the level and are applied only to directories.
  39. [/substitute <SidOld> [...]] Replaces an existing SID (SidOld) with a new SID (SidNew). Requires the Directory parameter.
  40. /restore <ACLfile> [/c] [/l] [/q] Applies stored DACLs from ACLfile to files in the specified directory. Requires the Directory parameter.
  41. /inheritancelevel:[e|d|r] Sets the inheritance level:
  42. e - Enables enheritance
  43. d - Disables inheritance and copies the ACEs
  44. r - Removes all inherited ACEs
  45.  
  46.  
  47. Remarks
  48. SIDs may be in either numerical or friendly name form. If you use a numerical form, affix the wildcard character * to the beginning of the SID.
  49. icacls preserves the canonical order of ACE entries as:
  50. Explicit denials
  51. Explicit grants
  52. Inherited denials
  53. Inherited grants
  54. Perm is a permission mask that can be specified in one of the following forms:
  55.  
  56. A sequence of simple rights:
  57.  
  58. F (full access)
  59.  
  60. M (modify access)
  61.  
  62. RX (read and execute access)
  63.  
  64. R (read-only access)
  65.  
  66. W (write-only access)
  67.  
  68. A comma-separated list in parenthesis of specific rights:
  69.  
  70. D (delete)
  71.  
  72. RC (read control)
  73.  
  74. WDAC (write DAC)
  75.  
  76. WO (write owner)
  77.  
  78. S (synchronize)
  79.  
  80. AS (access system security)
  81.  
  82. MA (maximum allowed)
  83.  
  84. GR (generic read)
  85.  
  86. GW (generic write)
  87.  
  88. GE (generic execute)
  89.  
  90. GA (generic all)
  91.  
  92. RD (read data/list directory)
  93.  
  94. WD (write data/add file)
  95.  
  96. AD (append data/add subdirectory)
  97.  
  98. REA (read extended attributes)
  99.  
  100. WEA (write extended attributes)
  101.  
  102. X (execute/traverse)
  103.  
  104. DC (delete child)
  105.  
  106. RA (read attributes)
  107.  
  108. WA (write attributes)
  109.  
  110. Inheritance rights may precede either Perm form, and they are applied only to directories:
  111.  
  112. (OI): object inherit
  113.  
  114. (CI): container inherit
  115.  
  116. (IO): inherit only
  117.  
  118. (NP): do not propagate inherit
  119.  
  120. Examples
  121. To save the DACLs for all files in the C:\Windows directory and its subdirectories to the ACLFile file, type:
  122.  
  123.  
  124. Copy
  125. icacls c:\windows\* /save aclfile /t
  126. To restore the DACLs for every file within ACLFile that exists in the C:\Windows directory and its subdirectories, type:
  127.  
  128.  
  129. Copy
  130. icacls c:\windows\ /restore aclfile
  131. To grant the user User1 Delete and Write DAC permissions to a file named "Test1", type:
  132.  
  133.  
  134. Copy
  135. icacls test1 /grant User1:(d,wdac)
  136. To grant the user defined by SID S-1-1-0 Delete and Write DAC permissions to a file, named "Test2", type:
  137.  
  138.  
  139. Copy
  140. icacls test2 /grant *S-1-1-0:(d,wdac)
  141.  
  142.  
  143.  
  144. #######
  145. # Work use:
  146.  
  147. ICACLS C:\Domains\ /remove Everyone /T /C
  148.  
  149. Το δοκίμασα στο PC μου και κατήργησε τον everyone από το φάκελο-παράμετρο στην εντολή και στους υποφακέλους, αφήνοντας άθικτους τους άλλους shared users.
  150.  
  151. Δεν καταργεί τον everyone όταν υπάρχει στο: δεξί κλικ στο φάκελο > Properties > Sharing > Advance Sharing > Permissions
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement