none
Excluding output from Get-acl? RRS feed

  • Question

  • I am trying to exclude the built in accounts and NT SYSTEM from the output of get-acl

    Get-ChildItem -path C:\scripts -Directory -Recurse | Get-Acl -exclude ("BUILTIN\*") | Format-Table -AutoSize -Wrap 

    Doesn't work and if I used

    Get-ACL -ErrorAction Continue |
    ?{$_.AccessToString -notmatch "BUILTIN"}| 

    Doesn't work either


    • Moved by Bill_Stewart Wednesday, December 12, 2018 8:22 PM Unanswerable drive-by question
    Friday, August 17, 2018 2:52 PM

All replies

  • Get-ChildItem -path c:\scripts -Directory -Recurse | 
        Get-Acl | 
        Select -Expand Access |
        Where{$_.IdentityReference -notmatch 'BUILTIN'} |
        Format-Table -auto


    \_(ツ)_/


    • Edited by jrv Friday, August 17, 2018 3:02 PM
    Friday, August 17, 2018 3:01 PM
  • close :) 

    just need to sort out the format  though

    tried

    Get-ChildItem -path D:\somefolder\ -Directory -Recurse -Erroraction SilentlyContinue

    |  Get-Acl | Select -Expand Access |Where{$_.IdentityReference -notmatch 'BUILTIN'}

    |Format-Table -auto

    Out-File -FilePath C:\Users\me\Documents\acl.txt


    Thursday, August 30, 2018 10:04 AM