Solved

exchange , office 365

Posted on 2016-10-22
4
31 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 6

Accepted Solution

by:
No More earned 500 total points
Comment Utility
$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
Comment Utility
Hi David,

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

Expert Comment

by:No More
Comment Utility
You are welcome
0
 

Author Comment

by:VN-PC view
Comment Utility
Hi david,

hoping you could answers my next question, :)
0

Featured Post

Do email signature updates give you a headache?

Do you spend too much time managing email signatures? Hate visiting every user’s desk to make updates? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Well, let Exclaimer give your company the email signature it deserves!

Join & Write a Comment

Utilizing an array to gracefully append to a list of EmailAddresses
Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
To show how to generate a certificate request in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Servers >> Certificates…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now