Search Engine: Elastic

Article ID: 130984, created on Jun 12, 2017, last review on Jun 12, 2017

  • Applies to:
  • Operations Automation 6.0

Symptoms

Get-MsolUser powershell comandlet fails with the following error:

The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://provisioning.microsoftonline.com/:ListUsersResult.
The InnerException message was 
'Maximum number of items that can be serialized or deserialized in an object graph is '65536'.  

Change the object graph or increase the MaxItemsInObjectGraph quota. '.  Please see InnerException for more details

Cause

The total items in Object Graph to be serialize / deserialize are more than the default allowed limit - 65536.

Resolution

Increase the limit.

  1. Check your powershell version: $psversiontable.psversion.tostring()

  2. Modify the machine.config file in C:\Windows\Microsoft.NET\Framework[64]\[Powershell version]\CONFIG directory:

Add <dataContractSerializer maxItemsInObjectGraph="2147483646" /> line to the <endpointBehaviors> section like:

<endpointBehaviors>
<dataContractSerializer maxItemsInObjectGraph="2147483646" />    
<Microsoft.VisualStudio.Diagnostics.ServiceModelSink.Behavior/>  
</endpointBehaviors>

5356b422f65bdad1c3e9edca5d74a1ae caea8340e2d186a540518d08602aa065 e12cea1d47a3125d335d68e6d4e15e07 956c448bddc7e1f3585373687602379f 6f1456866eed87488c0f02b298a741c0

Email subscription for changes to this article
Save as PDF