Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2016-08-29
2
Medium Priority
?
54 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 41

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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
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…

636 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