Jump to content

Command to modify Advanced Security Settings (Audit Settings for folders) on windows 2008


Recommended Posts

Posted

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

Posted

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"

--------------------------------------------------------

Tu peux aussi crire en franais.

Du kannst auch auf Deutsch schreiben.

Puoi scrivere anche in italiano.

--------------------------------------------------------

Posted

Yes it is.

 

With that script you set parameters for specific folder. You can use also parameters, just google a bit.

--------------------------------------------------------

Tu peux aussi crire en franais.

Du kannst auch auf Deutsch schreiben.

Puoi scrivere anche in italiano.

--------------------------------------------------------

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...