How to filter and replace files/dirs ACLs by Windows PowerShall?

  acl, powershell, windows

I have a bunch of files copied from one windows server to another (no domain).
I need to replace foreigner SIDs with the local users SIDs one-to-one.
There are get-acls and set-acls for the such procedures as I see. And PowerShell able to filter and pipping cmdlets. So I need something like this:

$AccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("ENTERPRISEPerson")
get-acl .path* |Some_filter_by_SID| set-acl $_.SetAccessRule($AccessRule)

It all is too far from bash, so I really need help with the methods PS do.

Source: Windows Questions

LEAVE A COMMENT