Solved

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

Posted on 2016-08-29
2
30 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Are you one of those front-line IT Service Desk staff fielding calls, replying to emails, all-the-while working to resolve end-user technological nightmares? I am! That's why I have put together this brief overview of tools and techniques I use in o…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

759 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

19 Experts available now in Live!

Get 1:1 Help Now