Environment:
Exchange Server 2013 – On Premise
Skype for Business Server 2015 – On Premise
Surface Hub account created and enabled as a Skype for Business meeting room with Enterprise Voice and an Exchange Resource Mailbox as per the Technet Article https://technet.microsoft.com/en-us/itpro/surface-hub/appendix-a-powershell-scripts-for-surface-hub
Issue:
After running the Surface Hub Account Verification Script previously in the article located here(put link), you receive the error:
Connecting to Exchange Powershell failed, please validate your server is accessible and credentials are correct
Resolution:
The error message explains that is having an issue connecting to Exchange to create a PSSession, I validated in a separate powershell script that we are able to connect to Exchange and create a PSSession, however we are connecting via http and not https.
001
002 003 004 005 006 |
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://Exchange.domain.com/PowerShell/
$Imported = Import-PSSession $Session -AllowClobber -ErrorAction silentlycontinue add-pssnapin microsoft.exchange* -ErrorAction silentlycontinue Write-Host (“Open Remote session: “+ $Session ) -foregroundcolor cyan Write-Host (“List Current remote session(s):”) -foregroundcolor cyan Get-PSSession |
I opened the SHAccountVerification.ps1 file and searched for http to see if the script tries both http and https, I found the line below and looks like it only tries https.
001
|
$sessEx = New-PSSession -ConfigurationName microsoft.exchange -Credential $credEx -AllowRedirection -Authentication $authType -ConnectionUri https://$strExServer/powershell -WarningAction SilentlyContinue
|
So I modified the script and changed the url to connect to exchange from https to http
001
|
$sessEx = New-PSSession -ConfigurationName microsoft.exchange -Credential $credEx -AllowRedirection -Authentication $authType -ConnectionUri http://$strExServer/powershell -WarningAction SilentlyContinue
|
Re-ran the script and it ran successfully and provided the necessary output required.