O365ServiceCommunications icon indicating copy to clipboard operation
O365ServiceCommunications copied to clipboard

Unable to connects to the Office 365 Service Communications API

Open VinceRibs opened this issue 6 years ago • 14 comments

Hello,

I have the following error while connecting to the Office 365 Service Communications API. It looks like https://api.admin.microsoftonline.com/shdtenantcommunications.svc is not responding anymore for a couple of weeks. Am I correct ?

`PS C:\Sources\O365ServiceCommunications> $MySession = New-SCSession -Credential $Cred Invoke-RestMethod : Unable to connect to the remote server At C:\Sources\O365ServiceCommunications\O365ServiceCommunications\functions\New-SCSession.ps1:60 char:22

  •     Cookie     = Invoke-RestMethod @Splat | Select-Object -Expand ...
    
  •                  ~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Invoke-RestMethod], WebException
    • FullyQualifiedErrorId : System.Net.WebException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand`

InnerException message is "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 65.52.192.98:443"

VinceRibs avatar Feb 26 '20 09:02 VinceRibs

@VinceRibs Are you still having this issue? I've seen this occasionally over the last few years and it always seems to be transient.

mattmcnabb avatar Mar 09 '20 17:03 mattmcnabb

Hello I have this issue also, the script was working previously but now i got "unable to connect to the remote server". :( any solutions

ah-ezzat avatar Mar 13 '20 17:03 ah-ezzat

I can only assume that the original API has finally been deprecated as expected in #2. I am now making time to create a V2 of this module, so please bear with me as I get this done. I hope to have a preview version of this done soon. Thanks!

mattmcnabb avatar Mar 17 '20 02:03 mattmcnabb

@VinceRibs I have just release an alpha of the module that supports the V2 API. Please run Install-Module O365ServiceCommunications -AllowPrerelease to install it and try it out. It's a completely breaking change to switch to the new API, so please reach out if you have trouble getting it up and running.

mattmcnabb avatar Mar 22 '20 02:03 mattmcnabb

I was getting the below error when running the command Install-Module O365ServiceCommunications -AllowPrerelease Install-Module : A parameter cannot be found that matches parameter name 'AllowPrerelease

Running the below commands resolved the AllowPrerelease issue

Install-Module -Name PackageManagement -Repository PSGallery -Force Install-Module -Name PowerShellGet -Repository PSGallery -Force

ahamin01 avatar Sep 24 '20 16:09 ahamin01

@ahamin01 yes, that would be expected as new PowerShell Gallery features (prerelease versions) require the latest PowerShellGet module.

mattmcnabb avatar Oct 07 '20 14:10 mattmcnabb

Hi Team,

I have downloaded alpha version of module and Connect-O365Communications cmdlet not populating. And i have tried New-SCSession but it's giving error. Any suggestions would be appreciated.

KarunaPrasad avatar Jul 07 '23 13:07 KarunaPrasad

@KarunaPrasad New-SCSession no longer exists in the V2 module so Connect-O365ServiceCommunications is the correct command. What version of PowerShell and OS are you using? Are you certain the module is in the correct module directory?

mattmcnabb avatar Jul 07 '23 18:07 mattmcnabb

@mattmcnabb , i have found that older version of O365ServiceCommunications (1.5) also installed side-by-side. I have uninstalled old version and installed Alpha version. Now it's working. Thank you.

KarunaPrasad avatar Jul 10 '23 09:07 KarunaPrasad

@mattmcnabb ,

I was able to connected but when i run the Cmdlets Get-SCService or Get-SCMessage getting below error.:

Invoke-RestMethod : 404 - File or directory not found. Server Error

404 - File or directory not found. The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

KarunaPrasad avatar Jul 10 '23 13:07 KarunaPrasad

Welp! It looks like v2.0 of the API is now deprecated as well! This has now been integrated into the Microsoft Graph API, and as such will have a different base URI and possibly other changes as well. It may take some time for me to look through this and get a new beta to a workable state.

mattmcnabb avatar Jul 10 '23 17:07 mattmcnabb

Okay. Thank you @mattmcnabb

KarunaPrasad avatar Jul 11 '23 14:07 KarunaPrasad

@KarunaPrasad This project appears to be superseded by the Microsoft Graph PowerShell SDK found here. In particular, look for the module "Microsoft.Graph.Devices.ServiceAnnouncement" and you'll be able to retrieve the information you need:

image

mattmcnabb avatar Jul 13 '23 02:07 mattmcnabb

Thank you @mattmcnabb

KarunaPrasad avatar Jul 14 '23 11:07 KarunaPrasad