kseeker Posted May 8, 2012 Posted May 8, 2012 Hello All, We have requirement to modify Advanced Security Settings (Audit Settings for folders) on windows 2008. I am looking for a command which does this job. I know, using group policies I can do this in fact I had done this using group policies. However, I need to do this on number of servers which are not in domain. There are around 15 folders on which I need to enable Auditing manual editing folder advanced permissions is a cumbersome job. Hence, I am looking for a command line options. I need to know how command can be utilised to enable Audit option on a folder. Please share a command which can do this once I get the command, I will create a batch file for other necessary folders. Manually through GUI, I am setting following.. snaps are uploaded Thanks Quote
ICTCity Posted May 8, 2012 Posted May 8, 2012 This should be what you need: $AccLst = new-object System.Security.AccessControl.DirectorySecurity $AccLst = Get-Acl "C:\MyFolder" $AudRul = New-Object Security.AccessControl.FileSystemAudRul("everyone","Modify","ContainerInherit, ObjectInherit", "None", "success") $AccLst.AddAudRul($AudRul) $AccLst | Set-Acl "C:\MyFolder" Quote -------------------------------------------------------- Tu peux aussi crire en franais. Du kannst auch auf Deutsch schreiben. Puoi scrivere anche in italiano. --------------------------------------------------------
kseeker Posted May 9, 2012 Author Posted May 9, 2012 Thanks :) I am bit weak in scripting, please bear with me. Is that a powershell script ? Quote
ICTCity Posted May 9, 2012 Posted May 9, 2012 Yes it is. With that script you set parameters for specific folder. You can use also parameters, just google a bit. Quote -------------------------------------------------------- Tu peux aussi crire en franais. Du kannst auch auf Deutsch schreiben. Puoi scrivere anche in italiano. --------------------------------------------------------
Recommended Posts