• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 58
  • Last Modified:

Writing to an Output file from PSSession (Retrieving OU ACL)

Hi Powershell experts,

I am trying to write to an output file from a PS Session to retrieve OU ACLs and for some reason it is not working/saving to a file. Could someone please shed some light? Btw, our environment is a multi-domain that's why I did the PS Session... Thank you!

Enter-PSSession dc1 -Credential mydomain\administrator

Import-Module activedirectory

set-location ad:
(Get-Acl ‘ou=mydomain,dc=com’).access | ft identityreference, accesscontroltype -AutoSize | Out-file -filepath c:\temp\results.txt
0
IT_Admin XXXX
Asked:
IT_Admin XXXX
1 Solution
 
FOXActive Directory/Exchange EngineerCommented:
Get-Acl -Path "AD:\OU=yourOU,DC=yourdc,DC=local" |
  Select-Object -ExpandProperty Access |ft IdentityReference,AccessControlType |out-file 'c:\temp\results.csv'


You can then open it in notepad or excel , the choice is yours
0
 
footechCommented:
The original command as shown should work fine.  If you take off the pipe to Out-File, does it show on screen?  Just keep in mind that it will save to c:\temp\results.txt on the remote machine where you have the remote session.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now