?
Solved

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

Posted on 2016-08-29
2
Medium Priority
?
51 Views
Last Modified: 2016-09-19
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
Comment
Question by:IT_Admin XXXX
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 16

Accepted Solution

by:
FOX earned 2000 total points
ID: 41775319
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
 
LVL 40

Expert Comment

by:footech
ID: 41775477
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question