Solved

exchange , office 365

Posted on 2016-10-22
4
76 Views
Last Modified: 2016-10-22
Hi All,

how do i fix  session error trying to connect to 0365
thank you in advance

cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Credential
PS C:\WINDOWS\system32> $Session = New-PSSession -ConfigurationName Microsoft.Ex
change -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credenti
al $UserCredential -Authentication Basic -AllowRedirection
New-PSSession : [outlook.office365.com] Processing data from remote server
outlook.office365.com failed with the following error message: [ClientAccessSer
ver=BY2PR06CA041,BackEndServer=bn3pr1201mb0996.namprd12.prod.outlook.com,Reques
tId=4b6cff4b-53bb-4042-9a75-c24e881a89aa,TimeStamp=10/22/2016 3:05:35 PM]
[FailureCategory=WSMan-InvalidShellID] The request for the Windows Remote
Shell with ShellId F25E68B8-015A-44B3-9DA8-305616CCBDB2 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. For more information,
see the about_Remote_Troubleshooting Help topic.
At line:1 char:12
+ $Session = New-PSSession -ConfigurationName Microsoft.Exchange -Conne ...
+            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:Re
   moteRunspace) [New-PSSession], PSRemotingTransportException
    + FullyQualifiedErrorId : CannotConnectTargetSessionDoesNotExist,PSSession
   OpenFailed
PS C:\WINDOWS\system32>
0
Comment
Question by:VN-PC view
  • 2
  • 2
4 Comments
 
LVL 7

Accepted Solution

by:
No More earned 500 total points
ID: 41855329
$credential = Get-Credential
 
Import-Module MsOnline
Connect-MsolService -Credential $credential
 
 
<# Exchange Online #>
$exchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://outlook.office365.com/powershell-liveid/" -Credential $credential -Authentication "Basic" -AllowRedirection
Import-PSSession $exchangeSession -DisableNameChecking
 
<# Office 365 Compliance #>
$ccSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://ps.compliance.protection.outlook.com/powershell-liveid/" -Credential $credential -Authentication "Basic" -AllowRedirection
Import-PSSession $ccSession -Prefix cc

Open in new window

0
 

Author Comment

by:VN-PC view
ID: 41855339
Hi David,

You're Awesome Sir, thank you so much
0
 
LVL 7

Expert Comment

by:No More
ID: 41855341
You are welcome
0
 

Author Comment

by:VN-PC view
ID: 41855372
Hi david,

hoping you could answers my next question, :)
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Adoption of Microsoft’s Enterprise Mobility and Security solution and Office 365 will re-order the File Sync and Share market Microsoft has stated that its Enterprise Mobility + Security (EMS) is the fastest growing product in the history of the …
In-place Upgrading Dirsync to Azure AD Connect
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question