?
Solved

exchange , office 365

Posted on 2016-10-22
4
Medium Priority
?
127 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 7

Accepted Solution

by:
No More earned 2000 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

This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
Microsoft is moving in-place eDiscovery & hold from ECP to EOP console under Content Search in Search and Investigation Options.  In this post, I will be showing you how to export emails to a PST file using the Content Search Options.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

771 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