Powershell output is being truncated

Hello Experts - I am trying to export a list of domains that a user has on the Outlook spam list but the output from this command is truncated after the first few entries:

Get-MailboxJunkEmailConfiguration -Identity user@domain.com | Out-File C:\filename.txt

What additional switches do I need here so the output is not truncated?
danbrown_IT ManagerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
You'll have to be more sepecific with what you want to get. As you do now you get the complete object containing a lot of information including two collections with undefined member count ;-).
E.g. you can export only the blocked addresses:
(Get-MailboxJunkEmailConfiguration user@domain.com).BlockedSendersAndDomains | Out-File C:\filename.txt

Open in new window

danbrown_IT ManagerAuthor Commented:
Figured it out:

Here, the fix is to change the $FormatEnumerationLimit value. If you type it on its own into PowerShell the current value – probably 3 – will be returned. If you set a new value of -1, it’ll output ALL entries in your collection.
PS > $FormatEnumerationLimit
PS > $FormatEnumerationLimit=-1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
Please note that that is in general a bad way to handle your issue. It might help you in this particular case, but fail if you try to do similar stuff later. However, from a KISS POV, it is a quick workaround.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.