Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have some specific folders that I grant members of my team permissions to. So I'll share a specific folder and add them as permissions. But after they are done I usually remove them from the list of permitted users.

I was wondering if it's possible to setup a bat file to achieve this, to make my life easier. I was wondering if WMI or powershell has those kinds of capabilities.

Just curious.

Thanks.

share|improve this question

3 Answers 3

up vote 0 down vote accepted

What you are looking for are "Get-ACL" and "Set-ACL". They are your one stop shop for permission control. I even found a quick few tutorial on how to use it to add security settings. You basically export the current ACL to an object, modify the object, and then overwrite the permissions set on the object.

http://blog.netnerds.net/2007/07/powershell-set-acl-does-not-appear-to-work/

http://blogs.msdn.com/b/johan/archive/2008/10/01/powershell-editing-permissions-on-a-file-or-folder.aspx

Hope that helps.

share|improve this answer

I suggest to add your team in a group and add that group to that folder. So when you want to take them out, you just delete the group from that folder's permission list.

That's what I'd do since I'm not a script guru.

share|improve this answer
    
+1 Simple solution –  Dave M Feb 24 '10 at 21:44
    
Thanks, but looking for a more advanced solution with scripting to see if its possible... –  Brian Mains Feb 25 '10 at 13:34

You can still use the built-in command cacls.exe on Windows XP to chance permissions on files and folders. Use a batch file for recurring use. This may be easier than using Powershell if you are not very familiar with it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.