本文將告訴您,Icacls.exe 命令列公用程式。您可以使用這個公用程式修改 Service Pack 2 (SP2) 以執行 Microsoft Windows Server 2003 的電腦上的 NTFS 檔案系統權限。
目前,您可以使用 Xcacls.exe 公用程式]、 [Cacls.exe] 公用程式] 和 [Xcacls.vbs 公用程式來修改 Windows Server 2003 中的 NTFS 權限。Icacls.exe 公用程式是用於修改 NTFS 權限的替代選項。[Icacls.exe 公用程式解決當您使用現有的公用程式就會發生的各種問題。
Icacls.exe 公用程式是在 Windows Vista 和 Windows Server 2003 SP2 包含在內。
若要安裝 Icacls.exe 公用程式,安裝最新的 Service Pack 的 Windows Server 2003。如需有關如何安裝最新的 Service Pack 的 Windows Server 2003 的詳細資訊,按一下 [下列面的文件編號,檢視 「 Microsoft 知識庫 」 中的發行項]:
889100?
(http://support.microsoft.com/kb/889100/
)
如何取得最新的 Service Pack 的 Windows Server 2003
語法 Icacls.exe 公用程式
若要查看下列的語法資訊,輸入
icacls.exe /? 在命令提示字元。
ICACLS name /save aclfile [/T] [/C]
store the acls for all matching names into aclfile for
later use with /restore.
ICACLS directory [/substitute SidOld SidNew [...]] /restore aclfile [/C]
applies the stored acls to files in directory.
ICACLS name /setowner user [/T] [/C]
changes the owner of all matching names.
ICACLS name /findsid Sid [/T] [/C]
finds all matching names that contain an ACL
explicitly mentioning Sid.
ICACLS name /verify [/T] [/C]
finds all files whose ACL is not in canonical form or whose
lengths are inconsistent with ACE counts.
ICACLS name /resize [/T] [/C] [/L]
changes incorrect recorded lengths of ACLs to true lengths.
ICACLS name /reset [/T] [/C]
replaces acls with default inherited acls for all matching files.
ICACLS name [/grant[:r] Sid:perm[...]]
[/deny Sid:perm [...]]
[/remove[:g|:d]] Sid[...]] [/T] [/C]
/grant[:r] Sid:perm grants the specified user access rights. With :r,
the permissions replace any previously granted explicit permissions.
Without :r, the permissions are added to any previously granted
explicit permissions.
/deny Sid:perm explicitly denies the specified user access rights.
An explicit deny ACE is added for the stated permissions and
the same permissions in any explicit grant are removed.
/remove[:[g|d]] Sid removes all occurrences of Sid in the acl. With
:g, it removes all occurrences of granted rights to that Sid. With
:d, it removes all occurrences of denied rights to that Sid.
Note:
Sids may be in either numeric or friendly name form. If a numeric
form is given, affix a * to the start of the SID.
/T indicates that this operation is performed on all matching
files/directories below the directories specified in the name.
/C indicates that this operation will continue on all file errors.
Error messages will still be displayed.
ICACLS preserves the canonical ordering of ACE entries:
Explicit denials
Explicit grants
Inherited denials
Inherited grants
perm is a permission mask and can be specified in one of two forms:
a sequence of simple rights:
F - full access
M - modify access
RX - read and execute access
R - read-only access
W - write-only access
a comma-separated list in parentheses of specific rights:
D - delete
RC - read control
WDAC - write DAC
WO - write owner
S - synchronize
AS - access system security
MA - maximum allowed
GR - generic read
GW - generic write
GE - generic execute
GA - generic all
RD - read data/list directory
WD - write data/add file
AD - append data/add subdirectory
REA - read extended attributes
WEA - write extended attributes
X - execute/traverse
DC - delete child
RA - read attributes
WA - write attributes
inheritance rights may precede either form and are applied
only to directories:
(OI) - object inherit
(CI) - container inherit
(IO) - inherit only
(NP) - don't propagate inherit
Examples:
icacls c:\windows\* /save AclFile /T
- Will save the ACLs for all files under c:\windows
and its subdirectories to AclFile.
icacls c:\windows\ /restore AclFile
- Will restore the Acls for every file within
AclFile that exists in c:\windows and its subdirectories
icacls file /grant Administrator:(D,WDAC)
- Will grant the user Administrator Delete and Write DAC
permissions to file
icacls file /grant *S-1-1-0:(D,WDAC)
- Will grant the user defined by sid S-1-1-0 Delete and
Write DAC permissions to file
其他可用的公用程式修改 NTFS 權限
如更多有關您可用來修改 NTFS 權限的其他公用程式的資訊,按一下下面的文件編號,檢視 「 Microsoft 知識庫 」 中 「 文件:
318754?
(http://support.microsoft.com/kb/318754/
)
如何使用 Xcacls.exe 修改 NTFS 權限
135268?
(http://support.microsoft.com/kb/135268/
)
如何在批次檔中使用 Cacls.exe
825751?
(http://support.microsoft.com/kb/825751/
)
如何使用 Xcacls.vbs 修改 NTFS 權限