Powershell Script: Randomly fails to get Getting user information from Exchange (365) Connection Drops ? RRS feed

  • Question

  • Hi all,

    I was asked to connect to our 365 estate and collect some email statistics

    The Problem I have is between 5 to 20 users the script fails with the following error ?

    Starting a command on the remote server failed with the following error message : The I/O operation has been aborted because of either a thread exit or an application request. For more information, see the about_Remote_Troubleshooting Help topic.

        + CategoryInfo          : OperationStopped: (ps.outlook.com:String) [], PSRemotingTransportException

        + FullyQualifiedErrorId : JobFailure

        + PSComputerName        : ps.outlook.com

    • Moved by Bill_Stewart Wednesday, February 14, 2018 7:35 PM Unanswerable/off-topic
    Friday, January 5, 2018 2:08 PM

All replies

  • I've now sent all the user names to a csv file.
    The file I've read into a variable.

    I then create a connection and get 4 users information.
    I then drop the connection and create a new connection and get another 4 users worth of information.
    This seems to be working, if not very time consuming.

    Any idea's as to what the issue could be.
    I've tried a few devices and a few servers now, so it doesn't seem to be device related, more connection ?



    Friday, January 5, 2018 2:13 PM
  • Without some idea of the code your question cannot be answered.


    Friday, January 5, 2018 3:43 PM
  • The code is not the issue ...

    It could be for example 
    get-mailbox or Get-InboxRule -Mailbox $User.UserPrincipalname

    And it would fail.

    Interestingly I'm home now and I've going through the same commands direct through my ISP
    I've so far not had any issue

    So it looks like there's SOMETHING in work dropping the connection, May well be a proxy server  issue

    Anyway at least I now have somewhere to look :)


    Friday, January 5, 2018 4:49 PM