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

Output Exchange 2010 Power Shell List to Text File

I use the following commands to add domains to my Exchange 2010 Bypassed Sender Domains list.  However, when I just type in $list, it takes a while for it to populate in the PS window, I would like to have a command to export this list to a file.  Please provide the commands to export contents of the $list to a txt file.  I am not very fluent in powershell programming, so I would need the entire command.  Thank you.

$list = (Get-ContentFilterConfig).BypassedSenderDomains
$list.add(“test100.com”)
set-contentfilterconfig -BypassedSenderDomains:$list
0
fireguy1125
Asked:
fireguy1125
  • 2
1 Solution
 
Adam BrownSr Solutions ArchitectCommented:
In powershell, the > and >> symbols note an output to file command (The easy way). If you do

$list >> <filename>

it will write the contents of that variable to the file specified.
0
 
fireguy1125Author Commented:
Thank you, it worked, however no < > around the file name.
0
 
Adam BrownSr Solutions ArchitectCommented:
Yeah. I always use those as a "Put something else here" notation :D
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

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