![]() For example, the code below outputs the IncidentIDs, WorkloadDisplayName and Status properties. Now you can display the results based on your preference. The results of the command above saved in the $ServiceStatus variable. $ServiceStatus = Invoke-RestMethod -Uri "$($TenantID)/ServiceComms/CurrentStatus" -Headers $token -Method Get -Verbose Copy the code below and paste it into your PowerShell session. This line of command will get a real-time view of current and ongoing service incidents. Getting the current health status will give you the real-time status of the Office 365 services within the previous 24 hours. Getting the Current Office 365 Service Health Status Once it expires, a new access token must be requested. Requested access tokens are only valid for 60 minutes.The screenshot below shows what the contents of the token would look like. $token = "$($oauth.token_type) $($oauth.access_token)" } $oauth = Invoke-RestMethod -Method Post -Uri "$($tenantID)/oauth2/token?api-version=1.0" -Body $body $ClientSecret = 'CLIENT-SECRET' #The secret key of the registered app $ClientID = 'CLIENT-ID' #The Application ID of the registered app $TenantID = 'TENANT-ID' #The Directory ID from Azure AD The code requests an access token and stores the returned value to the $token variable. Once you’ve updated the variables, paste the code into your PowerShell session to run it. If you don’t have this information, refer to this link to find out how and where to get them. Then, change the value of the $TenantID, $ClientID and $ClientSecret variables with the ones from your registered app. Once you’ve satisfied all the requirements, the next step is to acquire the access token that will be used to authorize the requests.Ĭopy and paste the code below into your script editor. – /Messages - Returns the messages about the Office 365 servicesįor example, to get the list of services the request URL would be – /HistoricalStatus - Returns the historical status of the Office 365 services – /CurrentStatus - Get a real-time view of current and ongoing service incidents. – /Services - Gets the list of subscribed services This represents which information is being requested. The different path to append to the end of the API URL.You will learn how to acquire access tokens in the next section. You can find the Tenant ID in the Azure Active Directory admin center. To request information from the Office 365 Service Communication API, you must take note of the key information that comprises a request. The Application ID, Directory ID and the Client Secret of the registered app.The registered app must be *granted admin consent.*.– API permission type to select - Application Permission – API permissions to add - ServiceHealth.Read The registered app must have the following settings.Please refer to Register a new application using the Azure portal if you don’t know how to do that. A registered app in Azure AD with proper permissions.Windows PowerShell 5.1 or PowerShell Core 6+.Scripting Environment (ISE) like Windows PowerShell ISE and A script editor, like Notepad++ or an Integrated.Request for a trial if you do not have it yet. If you intend to follow along, make sure you have the following prereqs set up ahead of time. In this article, you’ll learn how to retrieve the Office 365 service health status using the Office 365 Service Communications API and PowerShell. You can develop your scripts to send these status updates by email, MS Teams notification, or even to Slack! Using this API with PowerShell scripting, you can automate the monitoring for changes in the Office 365 service health status. This API allows for retrieving the Office 365 service health status programmatically. Microsoft has released the Office 365 Service Communications API V2 to solve this problem. But the graphical dashboard leaves a lot to be desired when you need to monitor resources at scale or to automate that monitoring. Located in the Microsoft 365 admin center under the Health section, this dashboard is a great way to get a birds-eye view of Office 365 services. One of those ways is the Office 365 Service Health dashboard. There are many ways to monitor Office 365.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |