Solved

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

Posted on 2016-08-29
2
40 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
2 Comments
 
LVL 16

Accepted Solution

by:
FOX earned 500 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 39

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
"Migrate" an SMTP relay receive connector to a new server using info from an old server.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

816 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now