question

93438220 avatar image
0 Votes"
93438220 asked KaelYao-MSFT commented

Failing to connect via PowerShell

Hello

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:
"https://eur06b.ps.compliance.protection.outlook.com/Powershell-LiveId?BasicAuthToOAuthConversion=true;PSVersion=5.1.19
041.1645"
New-ExoPSSession : Сбой обработки данных, полученных от удаленного сервера
eur06b.ps.compliance.protection.outlook.com. Сообщение об ошибке: 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".
C:\Program
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
e.Management.ExoPowershellSnapin.NewExoPSSession


198845-eur.png



Please help

P.S. All permissions are provided according to this instruction https://www.youtube.com/watch?v=M2GUQtIOkgk

office-exchange-server-administration
eur.png (50.3 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

KaelYao-MSFT avatar image
0 Votes"
KaelYao-MSFT answered 93438220 commented

Hi @93438220

According to this link: Connect to Security & Compliance Center PowerShell
199077-15.png

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.


15.png (20.5 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @93438220

Just checking in to see if above information was helpful.
Please let us know if you would like further assistance.

0 Votes 0 ·

Hi

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?

0 Votes 0 ·
93438220 avatar image
0 Votes"
93438220 answered KaelYao-MSFT converted comment to answer

Hi

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?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

KaelYao-MSFT avatar image
0 Votes"
KaelYao-MSFT answered KaelYao-MSFT commented

Hi,
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


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @93438220

Just checking in to see if above information was helpful. Please let us know if you would like further assistance.

0 Votes 0 ·