Exchange Shell Truncated Output

Exchange LogoWhen working with Exchange Management shell you may get output to some queries where output is truncated, a good example of this can be seen when querying the RemoteIpRanges property of a receive connector here’s an example:

Get-ReceiveConnector "App Connector" | fl RemoteIP*

The above command will produce an output similar to the following (data is coming from my lab):

RemoteIPRanges : {172.16.10.100, 172.16.10.107, 172.16.10.108, 172.16.10.110, 172.16.10.115, 172.16.10.131, 172.16.10.135, 172.16.10.138, 172.16.10.150, 172.16.10.155, 172.16.10.154, 172.16.10.10, 172.16.10.1158, 172.16.10.160, 172.16.10.161, 172.16.10.165...)

You can see the Exchange Shell truncated, as you probably know each PowerShell session, Exchange shell is no exception, can be customized via profiles which in the Exchange Management Shell impose an enumeration limit set at 16 via the $FormatEnumerationLimit variable:

$FormatEnumerationLimit
16

To prevent truncated output you can simply assign a different value to the $FormatEnumerationLimit variable, in the following example I will use a value of -1 which effectively means “unlimited”:

$FormatEnumerationLimit = -1

If the above command is run once again output will be correctly displayed:

RemoteIPRanges : {172.16.10.100, 172.16.10.107, 172.16.10.108, 172.16.10.110, 172.16.10.115, 172.16.10.131, 172.16.10.135, 172.16.10.138, 172.16.10.150, 172.16.10.155, 172.16.10.154, 172.16.10.10, 172.16.10.1158, 172.16.10.160, 172.16.10.161, 172.16.10.165, 172.16.10.170, 172.16.10.180)

Just in case you are wondering $FormatEnumerationLimit value is defined in the Exchange.ps1 profile file which can be found under the /bin/ directory of your Exchange installation path.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s