http://support.microsoft.com/kb/825751
Examples
The following Xcacls.vbs commands provide some examples of Xcacls.vbs usage:
xcacls.vbs c:\test\ /g domain\testuser1:f /f /t /e
This command edits existing permissions. It grants Domain\TestUser1 full control over all files under C:\Test, traverses subfolders under C:\Test, and then changes all found files. This command does not touch directories.
xcacls.vbs c:\test\ /g domain\testuser1:f /s /l "c:\xcacls.log"
This command replaces existing permissions. It grants Domain\TestUser1 full control over all subfolders under C:\Test and logs to C:\Xcacls.log. This command does not touch files and does not traverse directories.
xcacls.vbs c:\test\readme.txt /o "machinea\group1"
This command changes the owner of the readme file to group MachineA\Group1.
xcacls.vbs c:\test\badcode.exe /r "machinea\group1" /r "domain\testuser1"
This command revokes the permissions of MachineA\Group1 and Domain\TestUser1 on C:\Test\Badcode.exe.
xcacls.vbs c:\test\subdir1 /i enable /q
This command enables inheritance on folder C:\Test\Subdir1. This command suppresses any screen output.
xcacls.vbs \\servera\sharez\testpage.htm /p "domain\group2":14
This command remotely connects to \\ServerA\ShareZ using Windows Management Instrumentation (WMI). Then it obtains the local path for the share, under which it changes the permissions on Testpage.htm. It preserves the existing permissions of Domain\Group2 but adds permissions 1 (read data) and 4 (read extended attributes). This command drops other permissions on this file because the /e switch is not used.
xcacls.vbs d:\default.htm /g "domain\group2":f /server servera /user servera\admin /pass password /e
This command remotely connects to ServerA as ServerA\Admin using WMI, then grants full permissions to Domain\Group2 on Default.htm. The existing permissions of Domain\Group2 are lost, but other permissions on the file are retained.
Examples
The following Xcacls.vbs commands provide some examples of Xcacls.vbs usage:
xcacls.vbs c:\test\ /g domain\testuser1:f /f /t /e
This command edits existing permissions. It grants Domain\TestUser1 full control over all files under C:\Test, traverses subfolders under C:\Test, and then changes all found files. This command does not touch directories.
xcacls.vbs c:\test\ /g domain\testuser1:f /s /l "c:\xcacls.log"
This command replaces existing permissions. It grants Domain\TestUser1 full control over all subfolders under C:\Test and logs to C:\Xcacls.log. This command does not touch files and does not traverse directories.
xcacls.vbs c:\test\readme.txt /o "machinea\group1"
This command changes the owner of the readme file to group MachineA\Group1.
xcacls.vbs c:\test\badcode.exe /r "machinea\group1" /r "domain\testuser1"
This command revokes the permissions of MachineA\Group1 and Domain\TestUser1 on C:\Test\Badcode.exe.
xcacls.vbs c:\test\subdir1 /i enable /q
This command enables inheritance on folder C:\Test\Subdir1. This command suppresses any screen output.
xcacls.vbs \\servera\sharez\testpage.htm /p "domain\group2":14
This command remotely connects to \\ServerA\ShareZ using Windows Management Instrumentation (WMI). Then it obtains the local path for the share, under which it changes the permissions on Testpage.htm. It preserves the existing permissions of Domain\Group2 but adds permissions 1 (read data) and 4 (read extended attributes). This command drops other permissions on this file because the /e switch is not used.
xcacls.vbs d:\default.htm /g "domain\group2":f /server servera /user servera\admin /pass password /e
This command remotely connects to ServerA as ServerA\Admin using WMI, then grants full permissions to Domain\Group2 on Default.htm. The existing permissions of Domain\Group2 are lost, but other permissions on the file are retained.
Recent Ratings for This Post
( 1 in total)
Click for details
| Rater | Score | Time |
|---|---|---|
| — | +1 | 2009-01-07 19:26 |
Attachments
