Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to connects to the Office 365 Service Communications API #14

Open
VinceRibs opened this issue Feb 26, 2020 · 14 comments
Open

Unable to connects to the Office 365 Service Communications API #14

VinceRibs opened this issue Feb 26, 2020 · 14 comments
Milestone

Comments

@VinceRibs
Copy link

VinceRibs commented Feb 26, 2020

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"

@mattmcnabb
Copy link
Owner

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

@ah-ezzat
Copy link

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

@mattmcnabb
Copy link
Owner

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
Copy link
Owner

@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 mattmcnabb added this to the v2 milestone Mar 23, 2020
@ahamin01
Copy link

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

@mattmcnabb
Copy link
Owner

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

@KarunaPrasad
Copy link

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.

@mattmcnabb
Copy link
Owner

mattmcnabb commented Jul 7, 2023

@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?

@KarunaPrasad
Copy link

@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
Copy link

@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.

@mattmcnabb
Copy link
Owner

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.

@KarunaPrasad
Copy link

Okay. Thank you @mattmcnabb

@mattmcnabb
Copy link
Owner

@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

@KarunaPrasad
Copy link

Thank you @mattmcnabb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants