0

I have a batch file with about 1000 lines using xcacls.vbs for customizing NTFS permissions for complex folder structure (removes of grants, removes of inheritance, then grants plus some explicit denies) - it works but very slow. I'f I rewrite this somehow with PowerShell (v3/4) would it be faster in terms of execution?

Another issue I have with this thatt there are lack of functionality for bulk verification of applied permission - i.e. folder ACL against my CSV with desired permissions or somehow else...

Any advice on this?

Mikhail
  • 1,295
  • 3
  • 19
  • 35
  • 1
    My kneejerk reaction is that PS is a little faster than VBS, but not by much. I've got a PS that sets folder permissions for when people leave, and it takes 10+ minutes every time I run it. – Chris S Nov 22 '13 at 15:51
  • You could set a timer measuring the difference if you wrote some representative snippets in both ps and vb, then looped over them x number of times. You would want to do this over a directory structure just as deep as the live one, as that is a factor in terms of consumed time. MS has a tool for exporting effective permissions in a friendly format which maybe could be used for comparing to csv. I'll see if I can find it. – ErikE Nov 22 '13 at 18:41
  • 1
    `removes of grants, removes of inheritance` - Most of the scripts that I see that do things like this do it very in-efficiently. A simple port to powershell will not make things much faster. I would bet that in setting your permissions you have conditions where a single file is updated many times. You should re-factor your script if possible so when you modify the permissions for a file you only do it a single time. Of course this will probably make your script a lot more complex. – Zoredache Nov 22 '13 at 19:04
  • For example. You might be setting the inheritance in one xcacls pass, and then performing grants in another pass, and performing denies in another paas. Which means you are probably changing every file in the target directory 3 times. – Zoredache Nov 22 '13 at 19:09
  • @Zoredache: I agree, but also have no idea how VBs filehandler compares to powershells. I wouldn't blindly assume that they are equal (or not), I actually have no idea. – ErikE Nov 22 '13 at 19:11

0 Answers0