Lm th? no ? s? d?ng Xcacls.vbs ? s?a ?i cc quy?n truy c?p NTFS

D?ch tiu ? D?ch tiu ?
ID c?a bi: 825751 - Xem s?n ph?m m bi ny p d?ng vo.
Bung t?t c? | Thu g?n t?t c?

? Trang ny

TM T?T

l m?t phin b?n cng c? m? r?ng thay ?i Access Control List (Xcacls.exe) m c s?n nh l m?t k?ch b?n Microsoft Visual Basic (Xcacls.vbs) t? Microsoft. Bi vi?t t?ng b?c ny m t? cch s? d?ng o?n m? Xcacls.vbs ? s?a ?i v xem NTFS t?p tin h? th?ng c?p php cho t?p tin ho?c th m?c. B?n c th? s? d?ng Xcacls.vbs t? d?ng l?nh ? thi?t l?p t?t c? cc t?p tin h? th?ng ty ch?n b?o m?t c th? truy c?p trong Microsoft Windows Explorer. Xcacls.vbs, hi?n th? v s?a ?i access control lists (ACLs) t?p tin.

Chu y Xcacls.VBS ch? l tng thch v?i Microsoft Windows 2000, v?i Microsoft Windows XP, v v?i Microsoft Windows Server 2003. Xcacls.VBS khng ?c h? tr? b?i Microsoft.

Thi?t l?p v s? d?ng Xcacls.vbs

? thi?t l?p v s? d?ng Xcacls.vbs, h?y lm theo cc b?c sau:
  1. L?y Phin b?n m?i nh?t c?a Xcacls.vbs t? Web site sau Microsoft:
    http://Download.Microsoft.com/Download/f/7/8/f786aaf3-a37b-45ab-b0a2-8c8c18bbf483/XCacls_Installer.exe
  2. B?m p Xcacls_Installer.exe. Khi b?n ?c nh?c nh?p v? tr ? ?t cc file trch xu?t, ch? ?nh m?t th m?c trong my tnh c?a b?n t?m ki?m ?ng d?n ci ?t, ch?ng h?n nh C:\Windows.
  3. Thay ?i cng c? k?ch b?n m?c ?nh t? Wscript ? Cscript. (Cc t?p l?nh Xcacls.vbs lm t?t nh?t Cscript.) ? th?c hi?n vi?c ny, g? sau t?i d?u nh?c l?nh, v sau nh?n ENTER:
    cscript.exe /h:cscript
    Chu y Thay ?i m?c ?nh cng c? k?ch b?n ? Cscript ch? ?nh h?ng ?n cch script ghi vo mn h?nh. WScript vi?t m?i d?ng ring l? ?n m?t Ok h?p tho?i. Cscript vi?t m?i d?ng vo c?a s? l?nh. N?u b?n khng mu?n thay ?i m?c ?nh k?ch b?n cng c?, b?n ph?i ch?y script b?ng cch s? d?ng l?nh sau y
    cscript.exe xcacls.vbs
    trong khi n?u b?n thay ?i m?c ?nh ? Cscript, b?n c th? ch?y script v?i l?nh sau y:
    xcacls.VBS
    .
  4. ? xem c php l?nh Xcacls.vbs, lo?i sau t?i d?u nh?c l?nh:
    xcacls.VBS /?

C php cho l?nh Xcacls.vbs

Sau ?u ra c?a cc xcacls.VBS /? l?nh m t? Xcacls.vbs l?nh c php:
Usage:
XCACLS filename [/E] [/G user:perm;spec] [...] [/R user [...]]
                [/F] [/S] [/T]
                [/P user:perm;spec [...]] [/D user:perm;spec] [...]
                [/O user] [/I ENABLE/COPY/REMOVE] [/N
                [/L filename] [/Q] [/DEBUG]

   filename            [Required] If used alone, it displays ACLs.
                       (Filename can be a filename, directory name or
                       wildcard characters and can include the whole
                       path. If path is missing, it is assumed to be
                       under the current directory.)
                       Notes:
                       - Put filename in quotes if it has spaces or
                       special characters such as &, $, #, etc.
                       - If filename is a directory, all files and
                       subdirectories under it will NOT be changed
                       unless the /F or S is present.

   /F                  [Used with Directory or Wildcard] This will change all
                       files under the inputted directory but will NOT
                       traverse subdirectories unless /T is also present.
                       If filename is a directory, and /F is not used, no
                       files will be touched.

   /S                  [Used with Directory or Wildcard] This will change all
                       subfolders under the inputted directory but will NOT
                       traverse subdirectories unless /T is also present.
                       If filename is a directory, and /S is not used, no
                       subdirectories will be touched.

   /T                  [Used only with a Directory] Traverses each
                       subdirectory and makes the same changes.
                       This switch will traverse directories only if the
                       filename is a directory or is using wildcard characters.
   /E                  Edit ACL instead of replacing it.

   /G user:GUI         Grant security permissions similar to Windows GUI
                       standard (non-advanced) choices.
   /G user:Perm;Spec   Grant specified user access rights.
                       (/G adds to existing rights for user)

                       User: If User has spaces in it, enclose it in quotes.
                             If User contains #machine#, it will replace
                             #machine# with the actual machine name if it is a
                             non-domain controller, and replace it with the
                             actual domain name if it is a domain controller.

                             New to 3.0: User can be a string representing
                             the actual SID, but MUST be lead by SID#
                             Example: SID#S-1-5-21-2127521184-160...
                                      (SID string shown has been shortened)
                                      (If any user has SID# then globally all
                                       matches must match the SID (not name)
                                       so if your intention is to apply changes
                                       to all accounts that match Domain\User
                                       then do not specify SID# as one of the
                                       users.)

                       GUI: Is for standard rights and can be:
                             Permissions...
                                    F  Full control
                                    M  Modify
                                    X  read and eXecute
                                    L  List folder contents
                                    R  Read
                                    W  Write
                             Note: If a ; is present, this will be considered
                             a Perm;Spec parameter pair.

                       Perm: Is for "Files Only" and can be:
                             Permissions...
                                    F  Full control
                                    M  Modify
                                    X  read and eXecute
                                    R  Read
                                    W  Write
                             Advanced...
                                    D  Take Ownership
                                    C  Change Permissions
                                    B  Read Permissions
                                    A  Delete
                                    9  Write Attributes
                                    8  Read Attributes
                                    7  Delete Subfolders and Files
                                    6  Traverse Folder / Execute File
                                    5  Write Extended Attributes
                                    4  Read Extended Attributes
                                    3  Create Folders / Append Data
                                    2  Create Files / Write Data
                                    1  List Folder / Read Data
                       Spec is for "Folder and Subfolders only" and has the
                       same choices as Perm.

   /R user             Revoke specified user's access rights.
                       (Will remove any Allowed or Denied ACL's for user.)

   /P user:GUI         Replace security permissions similar to standard choices.

   /P user:perm;spec   Replace specified user's access rights.
                       For access right specification see /G option.
                       (/P behaves like /G if there are no rights set for user.)

   /D user:GUI         Deny security permissions similar to standard choices.
   /D user:perm;spec   Deny specified user access rights.
                       For access right specification see /G option.
                       (/D adds to existing rights for user.)

   /O user             Change the Ownership to this user or group.

   /I switch           Inheritance flag.  If omitted, the default is to not touch
                       Inherited ACL's. Switch can be:
                          ENABLE - This will turn on the Inheritance flag if
                                   it is not on already.
                          COPY   - This will turn off the Inheritance flag and
                                   copy the Inherited ACL's
                                   into Effective ACL's.
                          REMOVE - This will turn off the Inheritance flag and
                                   will not copy the Inherited
                                   ACL's.  This is the opposite of ENABLE.
                          If switch is not present, /I will be ignored and
                          Inherited ACL's will remain untouched.

   /L filename         Filename for Logging. This can include a path name
                       if the file is not under the current directory.
                       File will be appended to, or created if it does not
                       exit. Must be Text file if it exists or error will occur.

                       If filename is omitted, the default name of XCACLS will
                       be used.

   /Q                  Turn on Quiet mode.  By default, it is off.
                       If it is turned on, there will be no display to the screen.


   /DEBUG              Turn on Debug mode. By default, it is off.
                       If it is turned on, there will be more information
                       displayed and/or logged. Information will show
                       Sub/Function Enter and Exit as well as other important
                       information.

   /SERVER servername  Enter a remote server to run script against.

   /USER username      Enter Username to impersonate for Remote Connections
                            (requires PASS switch).  Will be ignored if it is for a Local Connection.

   /PASS password      Enter Password to go with USER switch
                            (requires USER switch).


Wildcard characters can be used to specify more than one file in a command, such as:
                                *       Any string of zero or more characters
                                ?       Any single character

You can specify more than one user in a command.
You can combine access rights.


S? d?ng Xcacls.vbs ? xem quy?n


B?n c?ng c th? s? d?ng Xcacls.vbs ? xem c?p php cho t?p v c?p. V d?, n?u b?n c m?t th m?c c tn C:\Test, g? sau t?i d?u nh?c l?nh ? xem cc cho php th m?c v sau nh?n ENTER:
xcacls.VBS c:\test
V d? sau l m?t k?t qu? i?n h?nh:
C:\>XCACLS.VBS c:\test
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Starting XCACLS.VBS (Version: 3.4) Script at 6/11/2003 10:55:21 AM

Startup directory:
"C:\test"

Arguments Used:
        Filename = "c:\test"



**************************************************************************
Directory: C:\test

Permissions:
Type     Username                Permissions           Inheritance

Allowed  BUILTIN\Administrators  Full Control          This Folder, Subfolde
Allowed  NT AUTHORITY\SYSTEM     Full Control          This Folder, Subfolde
Allowed  Domain1\User1           Full Control          This Folder Only
Allowed  \CREATOR OWNER          Special (Unknown)     Subfolders and Files
Allowed  BUILTIN\Users           Read and Execute      This Folder, Subfolde
Allowed  BUILTIN\Users           Create Folders / Appe This Folder and Subfo
Allowed  BUILTIN\Users           Create Files / Write  This Folder and Subfo

No Auditing set

Owner: Domain1\User1


Chu y ?u ra c?a cc xcacls.VBS c:\test l?nh trong v d? ny ph h?p v?i vn b?n ?c hi?n th? trong giao di?n ng?i dng ? h?a (GUI). M?t s? t? l khng ?y ? trong c?a s? l?nh.

?u ra c?ng cung c?p cho cc phin b?n c?a cc k?ch b?n, th m?c kh?i ?ng, v cc ?i s? ? ?c s? d?ng.

B?n c?ng c th? s? d?ng k? t? ?i di?n ? hi?n th? k?t h?p t?p tin theo th m?c. V d?, n?u b?n g? sau y, t?t c? cc t?p v?i ph?n m? r?ng c?a "log" m l ? C:\Test th m?c ?c hi?n th?:
xcacls.VBS c:\test\*.log

V d?


Xcacls.vbs l?nh sau y cung c?p m?t s? v d? v? cch s? d?ng Xcacls.vbs.

xcacls.VBS c:\test\ /g domain\testuser1:f/f /t e
L?nh ny s?a hi?n c quy?n. N cho php Domain\TestUser1 ton quy?n ki?m sot trn t?t c? cc t?p tin d?i C:\Test, n i qua th m?c con d?i C:\Test, v sau n thay ?i b?t k? t?p no ?c t?m th?y. L?nh ny khng lin l?c th m?c.
xcacls.VBS c:\test\ /g domain\testuser1:f/s/l "c:\xcacls.log"
L?nh ny s? thay th? c?p php hi?n c. N cho php Domain\TestUser1 ton quy?n ki?m sot trn t?t c? cc th m?c con d?i C:\Test, v n ng vo C:\Xcacls.log. L?nh ny khng ch?m vo t?p tin, v n khng ph?i i qua th m?c.
xcacls.VBS c:\test\readme.txt /o "machinea\group1"
L?nh ny s? thay ?i ch? s? h?u c?a Readme.txt l nhm MachineA\Group1.
xcacls.VBS c:\test\badcode.exe /r "machinea\group1" /r "domain\testuser1"
L?nh ny revokes s? cho php ?n C:\Test\Badcode.exe cho MachineA\Group1 v Domain\TestUser1.
xcacls.VBS c:\test\subdir1/i cho php /q
L?nh ny quay v? th?a k? vo th m?c C:\Test\Subdir1. N ngn ch?n b?t k? ?u ra mn h?nh.
xcacls.VBS \\servera\sharez\testpage.htm /p "domain\group2": 14
L?nh ny t? xa k?t n?i v?i \\ServerA\ShareZ b?ng cch s? d?ng phng ti?n qu?n l? Windows (WMI). N sau l?y ?c ?ng d?n ?a phng cho r?ng chia s?, v theo con ?ng , n thay ?i quy?n truy c?p vo Testpage.htm. N l cc c?p php hi?n c c?a Domain\Group2 c?n nguyn v?n, nhng n s? thm quy?n 1 (?c d? li?u) v 4 (?c thu?c tnh m? r?ng). L?nh gi?t khc quy?n truy c?p vo cc t?p tin v? cc e chuy?n ?i khng s? d?ng.
xcacls.VBS d:\default.htm /g "domain\group2": f /server servera /user servera\admin /pass m?t kh?u e
L?nh ny s? d?ng WMI ? k?t n?i t? xa nh ServerA\Admin ? ServerA v sau trao quy?n truy c?p ?y ? vo Default.htm cho Domain\Group2. Hi?n c quy?n cho Domain\Group2 b? m?t v cc c?p php trn cc t?p tin v?n c?n.

THAM KH?O

? bi?t thm chi ti?t v? cch s? d?ng Xcacls.exe, nh?p vo s? bi vi?t sau y ? xem bi vi?t trong c s? ki?n th?c Microsoft:
318754Lm th? no ? s? d?ng Xcacls.exe ? s?a ?i cc quy?n truy c?p NTFS

Thu?c tnh

ID c?a bi: 825751 - L?n xem xt sau cng: 29 Thang Tam 2011 - Xem xt l?i: 2.0
p d?ng
  • Microsoft Windows Server 2003, Datacenter Edition (32-bit x86)
  • Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
  • Microsoft Windows Server 2003, Standard Edition (32-bit x86)
  • Microsoft Windows Server 2003, Web Edition
  • Microsoft Windows XP Professional
  • Microsoft Windows XP Home Edition
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Professional Edition
T? kha:
kbhowtomaster kbmt KB825751 KbMtvi
My d?ch
QUAN TRONG: Bi vi?t ny ?c d?ch b?ng ph?n m?m d?ch my c?a Microsoft ch? khng ph?i do con ng?i d?ch. Microsoft cung c?p cc bi vi?t do con ng?i d?ch v c? cc bi vi?t do my d?ch ? b?n c th? truy c?p vo t?t c? cc bi vi?t trong C s? Ki?n th?c c?a chng ti b?ng ngn ng? c?a b?n. Tuy nhin, bi vi?t do my d?ch khng ph?i lc no c?ng hon h?o. Lo?i bi vi?t ny c th? ch?a cc sai st v? t? v?ng, c php ho?c ng? php, gi?ng nh m?t ng?i n?c ngoi c th? m?c sai st khi ni ngn ng? c?a b?n. Microsoft khng ch?u trch nhi?m v? b?t k? s? thi?u chnh xc, sai st ho?c thi?t h?i no do vi?c d?ch sai n?i dung ho?c do ho?t ?ng s? d?ng c?a khch hng gy ra. Microsoft c?ng th?ng xuyn c?p nh?t ph?n m?m d?ch my ny.
Nh?p chu?t vo y ? xem b?n ti?ng Anh c?a bi vi?t ny:825751

Cung cp Phan hi

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com