When working in the Exchange Management Shell you may encounter some query output that gets truncated with ellipsis.  An example of this is a long RemoteIPRanges list on a Receive Connector.  For example:

[PS] C:\>Get-ReceiveConnector "Relay Connector" | fl remoteipranges

RemoteIPRanges : {,,,,, 10.0.0
                 .16,,,,,, 10.0.

The reason this happens is that the default Powershell environment for Exchange has an enumeration limit. This is controlled by the $FormatEnumerationLimit variable in the ..binExchange.ps1 file. This variable has a default value of 16.

[PS] C:\>$FormatEnumerationLimit

You can modify the variable to a larger value, or set it to -1 for “unlimited”.

[PS] C:\>$FormatEnumerationLimit =-1

Now when we run the same command the output is no longer truncated.

[PS] C:\>Get-ReceiveConnector "Relay Connector" | fl remoteipranges

RemoteIPRanges : {,,,,, 10.0.0
                 .16,,,,,, 10.0.
                 0.6,,,,,, 10.0

About the Author

Paul Cunningham

Paul is a former Microsoft MVP for Office Apps and Services. He works as a consultant, writer, and trainer specializing in Office 365 and Exchange Server. Paul no longer writes for Practical365.com.




    another alternative
    Get-ReceiveConnector “Relay Connector” | ft id*,remoteipranges -Wrap


  2. Paul Grinyer

    12 years later this worked great. Thanks so much.

  3. Georgie Porgie

    Where is this file and what is the complete filename?


  4. Georgie Porgie

    There are some missing steps here. Too bad it sounds promising:

    [PS] C:\Windows\system32>C:>$FormatEnumerationLimit =-1
    & : Ampersand not allowed. The & operator is reserved for future use; use “&” to pass ampersand as a string.
    + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : AmpersandNotAllowed

    [PS] C:\Windows\system32>

    1. Avatar photo
      Paul Cunningham

      There was an error in the formatting of the syntax. I’ve fixed the blog post now.

  5. Don

    Brilliant that was exactly what I was looking for in use with Get-MailboxJunkEmailConfiguration

  6. KERR

    I googled “powershell truncated output” and had to laugh when the first google result is yours, showing a screenshot of the exact command that I’m trying to run.


  7. Joe

    dude. thank you for this. was searching everywhere

  8. mark

    I have this problem:
    If I use this in EMS, it shows all folders and FolderPath is not truncated
    Get-MailboxFolderStatistics $Arg1 | FT Name,ItemsinFolder,FolderPath -Autosize >> c:list.txt

    If I save the command in a ps1 file and run it, the FolderPath is truncated.
    What goes wrong?

  9. Bob

    You can also run it like this:

    Get-ReceiveConnector “Relay Connector” | select -ExpandProperty remoteipranges | select expression

    You may want to pipe it to a txt file or a csv file if you have several IP’s listed.

  10. Patsy

    Grrreat man. Nice description and really helped!

  11. saravanan

    Thanks its works fine 🙂

  12. @gregseeber

    thanks paul. I was actually fighting a Lync commandlet and found your tip .. now I can see it ALL. 🙂

  13. Keshav

    Thanks Paul..really helpful

  14. Nate

    So I’m reading one of your articles which is showing me how to deal with one thing that comes up in the Exchange Management Shell, then run into this problem, google it, and what do you know, it’s another article from you explaining how to deal with that.

    Good work, and thanks!

  15. Brian G. Shacklett

    Yes! This has been one of the most frustrating things about Powershell for me. That line is now in my Microsoft.PowerShell_profile.ps1.


  16. Marco

    Thanks Paul! This got me some headaches until I found your post!

  17. Hank

    Tried this on a Windows 2003 server 64bit with Exchange 2007 sp2 from the EMS and while I can change the variable, the output is the same. There are hundreds of IPs and I only get 7.
    Would it be that you need to be on Windows 2008 and up?

  18. Dean

    Awesome. Thank you for posting this quick fix. Adding to my PowerShell profile.

  19. Bids

    I was struggling for the last 1 hour to prevent the truncation, checked so many sites, but only your solution($FormatEnumerationList) worked. 🙂

  20. vishnu

    It works… thanks man… it solved lots of manual work….


  21. Mike Koch

    Exchange.ps1 contains a signature block. Doesn’t modifying the $FormatEnumerationLimit variable break the signature, and will that affect the shell’s ability to load that PS1 file?

    1. Avatar photo
      Paul Cunningham

      Hi Mike, actually I don’t edit the Exchange.ps1 file, I just change the variable at the cmd line for that current session.

      It might make sense to configure a higher limit in your Powershell profile but I’ve read it can cause problems with some other output scenarios, so I just bump it up as required per-session.

Leave a Reply