Curated Examples
Read service health status
Read Microsoft 365 service health data into PowerShell.
This pattern is useful when you want a quick console review before building a report.
It is adapted from Examples/Example-Office365Status.ps1.
Example
Import-Module PSWinDocumentation.O365HealthService
$applicationId = '<application-id>'
$applicationKey = '<client-secret>'
$tenantDomain = 'contoso.com'
$health = Get-Office365Health -ApplicationID $applicationId -ApplicationKey $applicationKey -TenantDomain $tenantDomain
$health.CurrentStatus | Format-Table Service, ServiceStatus, StatusTime -AutoSize
What this demonstrates
- using explicit application registration values
- reading service health without generating files
- keeping tenant-specific values out of the published example