Failing to connect via PowerShell

Чингис Рустемов 1 Reputation point


I`m running the following code in PowerShell as an Administrator
PS C:\Windows\system32> Import-Module ExchangeOnlineManagement
PS C:\Windows\system32> Connect-IPPSSession

And received an error: ПРЕДУПРЕЖДЕНИЕ: Ваше подключение перенаправлено на следующий URI:
New-ExoPSSession : Сбой обработки данных, полученных от удаленного сервера Сообщение об ошибке: The request for the Windows Remote Shell with
ShellId 432FF59F-54E2-412B-A0D6-C9D1A6CD765E failed because the shell was not found on the server. Possible causes
are: the specified ShellId is incorrect or the shell no longer exists on the server. Provide the correct ShellId or
create a new shell and retry the operation. Подробности см. в разделе справки "about_Remote_Troubleshooting".
Files\WindowsPowerShell\Modules\ExchangeOnlineManagement\2.0.5\netFramework\ExchangeOnlineManagement.psm1:475 знак:30

  • ... PSSession = New-ExoPSSession -ExchangeEnvironmentName $ExchangeEnviro ...
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : ResourceUnavailable: (:) [New-ExoPSSession], PSRemotingTransportException
  • FullyQualifiedErrorId : System.Management.Automation.Remoting.PSRemotingDataStructureException,Microsoft.Exchang


Please help

P.S. All permissions are provided according to this instruction

Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,497 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Kael Yao-MSFT 37,676 Reputation points Microsoft Vendor

    Hi @Чингис Рустемов

    According to this link: Connect to Security & Compliance Center PowerShell

    The possible cause may be due to changes in your IP address.
    Please have a check if it is the cause in this case, then retry the cmdlet and see if you are able to connect.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

  2. Чингис Рустемов 1 Reputation point


    The cause of problem was in insufficient permissions.
    Thank you.

    But there is an another problem: the session time is not enough to fulfill the operation. how to increase the session time of Connect-IPPSSession and any session?

    0 comments No comments

  3. Kael Yao-MSFT 37,676 Reputation points Microsoft Vendor

    If you would like to run scripts for a large number of mailboxes, here are two links which may be helpful:
    Running PowerShell cmdlets for large numbers of users in Office 365
    Updated: Running PowerShell cmdlets for large numbers of users in Office 365