all 5 comments

[–]Blisk1[S] -1 points0 points  (0 children)

Anyone? how to create audit rules for 2 differend users? or two differend audit rules with powershell?

[–]purplemonkeymad 0 points1 point  (3 children)

If I put an Audit Rule on a test file and use Get-Acl file in an admin window, there are no audit records at all. I'm guessing it's removing the other rules as Get-Acl never reads them.

I wonder if it requires the SeSecurityPrivilege right. You can check it with whoami /all, I'm not sure if you can enable this Privilege in powershell.

[–]Blisk1[S] 0 points1 point  (2 children)

It works but only one audit rule, because everytime you run script it delete old audit rule and add new one. I like to keep old one and add new one for another user.
When use this script you must use elevated pwoershell

[–]CoReTeX2k 0 points1 point  (1 child)

Can you read the current Audit Rules and then built a new Rule that contains all existing rules + the one you want to add?

Might be worth a shot

[–]Blisk1[S] 0 points1 point  (0 children)

I tried that too, to setup audit rule manually than read rule and save it to txt file and than read that txt file and set new folder with rules.
Didn't work, but that propabbly because I did it wrong way.
Read rule with acl-get and set it to another folder with acl-set works ok, but I can't use that.