Question : VBScript XCacls NTFS permissions

I have a permissions issue due to someone messing with the permissions and inheritance on a Windows 2003 server.  It is a bit of a mess.  

Here is what I need to accomplish.  Currently there is a top level folder 'Customer'.  Underneath it, there are part number folders.  Example: D:\CUSTOMER\123-45-64-02.  I need to modify the permissions on all the part number folders so the the USERS group has 'List directory contents' on ONLY 'This folder'.  Currently it is set to 'This folder and all subfolders', which allows people to see subfolders in the part number folders that they should not be able to.  

Can XCacls be used for this?  I checked the help file, but it doesn't look like it to me.  Anyone have any ideas on this?
            

Answer : VBScript XCacls NTFS permissions

copy the code attached to notepad and save file with vbs extension (vbscript)

download xcacls:
http://download.microsoft.com/download/f/7/8/f786aaf3-a37b-45ab-b0a2-8c8c18bbf483/xcacls_installer.exe

edit line 1 and 2 as folow:

line 1 to the  top level folder to check under it
line 2 tool path location

you can copy some folders to test folder location to check the script.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
strFolder = "D:\CUSTOMER"
strAcl = "c:\XCACLS.vbs"

Set objShell = CreateObject("wscript.Shell")
Set objNetwork = WScript.CreateObject("WScript.Network")
Set objfso = CreateObject("scripting.filesystemobject")
Set ColFolder = objfso.GetFolder(strFolder)
Set ColSubfolders = Colfolder.SubFolders

For Each strShare In ColSubfolders
strCmd = "cscript " & strAcl & " " & strShare.Path & " /e /p users:l /spec a"
objshell.Run strCmd,0,true
Next

WScript.Echo "Done"
Random Solutions  
 
programming4us programming4us