mattmcnabb / O365ServiceCommunications

A Powershell module for monitoringOffice 365 Service Health!
25 stars 6 forks source link

Several Errors while running Get-SCMessage #19

Closed ahamin01 closed 3 years ago

ahamin01 commented 3 years ago

I am getting several errors, as listed below, after running the command Get-SCMessage

Cannot convert value "@{AffectedWorkloadDisplayNames=System.Object[]; AffectedWorkloadNames=System.Object[]; Status=Service restored; Workload=Exchange; WorkloadDisplayName=Exchange
Online; ActionType=; AdditionalDetails=System.Object[]; AffectedTenantCount=0; AffectedUserCount=; Classification=Advisory; EndTime=2020-08-25T20:30:00Z; Feature=Provisioning;
FeatureDisplayName=Management and Provisioning; UserFunctionalImpact=; Id=EX213379; ImpactDescription=Users with an ESN policy scoped by a rule using specific conditions may have seen
unexpected delivery results.; LastUpdatedTime=2020-08-25T20:53:29.837Z; MessageType=Incident; Messages=System.Object[]; PostIncidentDocumentUrl=; Severity=Sev2;
StartTime=2020-05-15T18:00:32Z; TenantParams=System.Object[]; Title=Any user with end-user spam notification (ESN) policies using specific conditions seeing unexpected delivery results}"
to type "O365ServiceCommunications_IncidentMessage". Error: "Cannot convert the "@{AffectedWorkloadDisplayNames=System.Object[]; AffectedWorkloadNames=System.Object[]; Status=Service
restored; Workload=Exchange; WorkloadDisplayName=Exchange Online; ActionType=; AdditionalDetails=System.Object[]; AffectedTenantCount=0; AffectedUserCount=; Classification=Advisory;
EndTime=2020-08-25T20:30:00Z; Feature=Provisioning; FeatureDisplayName=Management and Provisioning; UserFunctionalImpact=; Id=EX213379; ImpactDescription=Users with an ESN policy scoped
by a rule using specific conditions may have seen unexpected delivery results.; LastUpdatedTime=2020-08-25T20:53:29.837Z; MessageType=Incident; Messages=System.Object[];
PostIncidentDocumentUrl=; Severity=Sev2; StartTime=2020-05-15T18:00:32Z; TenantParams=System.Object[]; Title=Any user with end-user spam notification (ESN) policies using specific
conditions seeing unexpected delivery results}" value of type "System.Management.Automation.PSCustomObject" to type "O365ServiceCommunications_IncidentMessage"."
At C:\Users\mansoa4\Documents\WindowsPowerShell\Modules\O365ServiceCommunications\2.0.0\O365ServiceCommunications.psm1:234 char:17
+                 [O365ServiceCommunications_IncidentMessage]$_
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvalidCastConstructorException

Cannot convert value "@{AffectedWorkloadDisplayNames=System.Object[]; AffectedWorkloadNames=System.Object[]; Status=Service restored; Workload=Exchange; WorkloadDisplayName=Exchange
Online; ActionType=; AdditionalDetails=System.Object[]; AffectedTenantCount=0; AffectedUserCount=; Classification=Incident; EndTime=2020-08-25T20:30:00Z; Feature=Delivery;
FeatureDisplayName=E-Mail timely delivery; UserFunctionalImpact=; Id=EX220140; ImpactDescription=Users or admins may have experienced various issues intermittently when using the
service.; LastUpdatedTime=2020-08-25T21:21:21.577Z; MessageType=Incident; Messages=System.Object[]; PostIncidentDocumentUrl=; Severity=Sev2; StartTime=2020-07-17T12:00:00Z;
TenantParams=System.Object[]; Title=Any user or admin may experience various issues intermittently when using the service}" to type "O365ServiceCommunications_IncidentMessage". Error:
"Cannot convert the "@{AffectedWorkloadDisplayNames=System.Object[]; AffectedWorkloadNames=System.Object[]; Status=Service restored; Workload=Exchange; WorkloadDisplayName=Exchange
Online; ActionType=; AdditionalDetails=System.Object[]; AffectedTenantCount=0; AffectedUserCount=; Classification=Incident; EndTime=2020-08-25T20:30:00Z; Feature=Delivery;
FeatureDisplayName=E-Mail timely delivery; UserFunctionalImpact=; Id=EX220140; ImpactDescription=Users or admins may have experienced various issues intermittently when using the
service.; LastUpdatedTime=2020-08-25T21:21:21.577Z; MessageType=Incident; Messages=System.Object[]; PostIncidentDocumentUrl=; Severity=Sev2; StartTime=2020-07-17T12:00:00Z;
TenantParams=System.Object[]; Title=Any user or admin may experience various issues intermittently when using the service}" value of type "System.Management.Automation.PSCustomObject" to
type "O365ServiceCommunications_IncidentMessage"."
At C:\Users\mansoa4\Documents\WindowsPowerShell\Modules\O365ServiceCommunications\2.0.0\O365ServiceCommunications.psm1:234 char:17
+                 [O365ServiceCommunications_IncidentMessage]$_
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvalidCastConstructorException

Cannot convert value "@{AffectedWorkloadDisplayNames=System.Object[]; AffectedWorkloadNames=System.Object[]; Status=Service restored; Workload=Exchange; WorkloadDisplayName=Exchange
Online; ActionType=; AdditionalDetails=System.Object[]; AffectedTenantCount=0; AffectedUserCount=; Classification=Advisory; EndTime=2020-08-27T01:00:00Z; Feature=Access;
FeatureDisplayName=E-Mail and calendar access; UserFunctionalImpact=; Id=EX220844; ImpactDescription=Users may have been unable to access some archived mailboxes from the Outlook desktop
client or Outlook on the web.; LastUpdatedTime=2020-08-27T02:16:29.12Z; MessageType=Incident; Messages=System.Object[]; PostIncidentDocumentUrl=; Severity=Sev2;
StartTime=2020-08-23T19:00:00Z; TenantParams=System.Object[]; Title=Any user can't access some archived mailboxes from the Outlook desktop client or Outlook on the web}" to type
"O365ServiceCommunications_IncidentMessage". Error: "Cannot convert the "@{AffectedWorkloadDisplayNames=System.Object[]; AffectedWorkloadNames=System.Object[]; Status=Service restored;
Workload=Exchange; WorkloadDisplayName=Exchange Online; ActionType=; AdditionalDetails=System.Object[]; AffectedTenantCount=0; AffectedUserCount=; Classification=Advisory;
EndTime=2020-08-27T01:00:00Z; Feature=Access; FeatureDisplayName=E-Mail and calendar access; UserFunctionalImpact=; Id=EX220844; ImpactDescription=Users may have been unable to access
some archived mailboxes from the Outlook desktop client or Outlook on the web.; LastUpdatedTime=2020-08-27T02:16:29.12Z; MessageType=Incident; Messages=System.Object[];
PostIncidentDocumentUrl=; Severity=Sev2; StartTime=2020-08-23T19:00:00Z; TenantParams=System.Object[]; Title=Any user can't access some archived mailboxes from the Outlook desktop client
or Outlook on the web}" value of type "System.Management.Automation.PSCustomObject" to type "O365ServiceCommunications_IncidentMessage"."
At C:\Users\mansoa4\Documents\WindowsPowerShell\Modules\O365ServiceCommunications\2.0.0\O365ServiceCommunications.psm1:234 char:17
+                 [O365ServiceCommunications_IncidentMessage]$_
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvalidCastConstructorException`
mattmcnabb commented 3 years ago

@ahamin01 can you confirm what version of the module you're using, and your PowerShell version? This appears to be an issue with converting the API output to the target data type and I expect it's due to an API change that results in properties the module is not equipped to handle.

As an aside, are you able to help test the alpha release of the 2.0 version? You can install it from the Gallery with this command:

Install-Module O365ServiceCommunications -AllowPrerelease

ahamin01 commented 3 years ago

Thanks for following up on this.

Yup, I am using already version 2, as shown below

ModuleType Version Name


Manifest 2.0.0 O365ServiceCommunications

Below is my PS version:

Major Minor Build Revision


5 1 18362 752

lak0413 commented 3 years ago

I am having the same error when running Get-SCMessage O365Servicecommunications module version: 2.0.0-alpha1

mattmcnabb commented 3 years ago

@ahamin01 and @lak0413 I found that the tenantparams field has been added to the message object model returned from the API. Adding this to the message class has fixed the issue.

Next I'll look into protecting against this in the future. Thanks for your patience!