Home

Get-msoluser :The socket connection was aborted

%3CLINGO-SUB%20id%3D%22lingo-sub-101673%22%20slang%3D%22en-US%22%3EGet-msoluser%20%3AThe%20socket%20connection%20was%20aborted%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-101673%22%20slang%3D%22en-US%22%3E%3CP%3EWhen%20i%20run%20following%20command%20in%20powershell%26nbsp%3B%3C%2FP%3E%3CP%3Eget-msoluser%20-MaxResults%2010000%20%7Cselect%20displayname%20%7CMeasure-Object%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ei%20got%20following%20issue%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20socket%20connection%20was%20aborted.%20This%20could%20be%20caused%20by%20an%20error%20processing%3C%2FP%3E%3CP%3Eyour%20message%20or%20a%20receive%20timeout%20being%20exceeded%20by%20the%20remote%20host%2C%20or%20an%20underlying%20network%3C%2FP%3E%3CP%3Eresource%20issue.%20Local%20socket%20timeout%20was%20'00%3A00%3A59.9220000'.%3C%2FP%3E%3CP%3EAt%20line%3A1%20char%3A1%3C%2FP%3E%3CP%3E%2B%20get-msoluser%20-MaxResults%2010000%20%7Cselect%20displayname%20%7CMeasure-Object%3C%2FP%3E%3CP%3E%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2B%20CategoryInfo%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3A%20OperationStopped%3A%20(%3A)%20%5BGet-MsolUser%5D%2C%20CommunicationException%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2B%20FullyQualifiedErrorId%20%3A%20System.ServiceModel.CommunicationException%2CMicrosoft.Online.Admin%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3Bistration.Automation.GetUser%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ecan%20anyone%20help%20me%20to%20overcome%20this%20problem%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-101673%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20AD%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-101898%22%20slang%3D%22en-US%22%3ERe%3A%20Get-msoluser%20%3AThe%20socket%20connection%20was%20aborted%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-101898%22%20slang%3D%22en-US%22%3E%3CP%3ESome%20things%20to%20consider%3A%3C%2FP%3E%3COL%3E%3CLI%3EAre%20you%20running%20through%20proxy%20-%20this%20can%20lead%20to%20some%20timeout%20issues%3C%2FLI%3E%3CLI%3EEnsure%20you%20are%20running%20the%20latest%26nbsp%3BMicrosoft%20Azure%20Active%20Directory%20Module%20for%20Windows%20PowerShell%3C%2FLI%3E%3CLI%3EMove%20to%20the%20newer%20Azure%20Active%20Directory%20V2%20PowerShell%20module%20instead%20of%20this%20module%3C%2FLI%3E%3C%2FOL%3E%3CP%3EIf%20you%20choose%20option%203%2C%20the%20equivlant%20starting%20point%20would%20be%3A%3C%2FP%3E%3CP%3EGet-AzureADUser%20-top%2010000%20%7C%20select%20displayname%20%7C%20measure-object%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOr%20get%20ALL%3A%3C%2FP%3E%3CP%3E%26nbsp%3BGet-AzureADUser%20-all%20%24true%20%7C%20select%20displayname%20%7C%20measure-object%3C%2FP%3E%3C%2FLINGO-BODY%3E
Frequent Contributor

When i run following command in powershell 

get-msoluser -MaxResults 10000 |select displayname |Measure-Object"

 

i got following issue 

 

The socket connection was aborted. This could be caused by an error processing

your message or a receive timeout being exceeded by the remote host, or an underlying network

resource issue. Local socket timeout was '00:00:59.9220000'.

At line:1 char:1

+ get-msoluser -MaxResults 10000 |select displayname |Measure-Object

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : OperationStopped: (:) [Get-MsolUser], CommunicationException

    + FullyQualifiedErrorId : System.ServiceModel.CommunicationException,Microsoft.Online.Admin

   istration.Automation.GetUser

 

can anyone help me to overcome this problem

1 Reply

Some things to consider:

  1. Are you running through proxy - this can lead to some timeout issues
  2. Ensure you are running the latest Microsoft Azure Active Directory Module for Windows PowerShell
  3. Move to the newer Azure Active Directory V2 PowerShell module instead of this module

If you choose option 3, the equivlant starting point would be:

Get-AzureADUser -top 10000 | select displayname | measure-object

 

Or get ALL:

 Get-AzureADUser -all $true | select displayname | measure-object

Related Conversations
Extentions Synchronization
Deleted in Discussions on
3 Replies
Tabs and Dark Mode
cjc2112 in Discussions on
36 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
9 Replies