Powershell Office 365: Building a Hash Table and a Custom PSObject to Get-UserInfo

Here is a script that will quickly tell you some mailbox information and some mailbox statistics for an Exchange Online such as Office 365 mailbox. This will also work with Exchange Shell on Exchange 2013 on Premises.

The data is collated from 2 different cmdlets, Get-MsolUser and Get-MailboxStatistics. The data is then used to create an advanced function called Get-UserInfo.

This post serves as a demonstration in building a hash table and a custom PSObject, one of the most important aspects of PowerShell scripting. It also serves to demonstrate the principal of gathering output from various cmdlets and bringing them together as one.

It has been assumed that you have installed the PowerShell Module called MSOnline and authenticated to Office 365 via PowerShell in the usual way.

If you were to "Dot Source" the script using PowerShell.exe then you would run it with the following :

Get-UserInfo -UPN user@mail.com -Verbose -ErrorLog

This script example will only support one UserPrincipalName input although can be easily changed to accept multiple, CSV input and accross the pipeline if required. This is outwith the scope of this post.

Read More

Call Office 365 Service Communications API and Return an Hourly Summary of Service Health Notices – Part 4

In part 4, we will now look to create the flow that will populate the nested folder called Live Updates. More information on the folder structure in part 1.

We will base this post mostly around part 3 as they are very similar in what they do but with a few subtle changes and enhancements.

Please familiarise yourself with part 3 as this post will only discuss the changes required in order to achieve an hourly live update summary.

On the My Flows page, select the Flow you have created from part 3 and choose Save as, now rename the flow to Live Incidents – Hourly Update (or similar).

The first modification we will make will be at the beginning to the Recurrence trigger.

This will run hourly and it can help by reminding you of the issues that are live and may be affecting your tenant.

If you work in a 24 hour environment, then this should work well for you. but what if your company is Monday to Friday business hours, say 8am to 5pm. Do we really need a summary of live service incidents on a Saturday or Sunday or at midnight?

I would suggest not, so right after the Recurrence trigger but before we initialise variable TenantID, ClientID & SecretID we have the option to stop the flow from running if out with the time constraints. I have written a separate blog on this called So you just want Flow running in business hours - 8am to 5pm so you may want to integrate these steps for this one.

Read More

Call Office 365 Service Communications API and Return New Service Health Notices – Part 3

Here is how I have managed to return the latest Service Health alert (only) from Office 365 "Office 365 Service Communications API".

Office 365 New Service Alert Email

As any O365 admin will know, Microsoft won't offer an inbuilt alert that will notify you by email when a new Incident arises so here is how I have chosen to get round that and here is a sneak peek of the output:

Firstly, we will need to register an app in Azure AD. Please see Register an App in the Azure Active Directory for instructions on how to do that.

Read More

Call O365 Endpoints Web Service and Return the Latest FQDNs – Part 2

Now we will look into an automated process that allows us to call the Office 365 IP Address and URL Web service and to have the news Endpoints returned in FQDN Format.

The full unformated worldwide list can be found here in JSON format & here in CSV format.

As part of the article, it explains how you can access the changes, essentially the newest updates since the month before. You can see the data here.

The URI looks like this – https://endpoints.office.com/changes/Worldwide/2018102900?singleVersion&clientRequestId=b10c5ed1-bad1-445f-b386-b919946339a7

This can be changed as and when a new version is published by Microsoft, but of course the output via the browser is in JSON format. So let's walk through how I have captured the new FQDNs and emailed them to a shared mailbox. I did this with some help from Paul Andrew as he had detailed a good deal of the process at this blog.

Let's begin …

Firstly, we will need to use a SharePoint list in order to compare old and new versions. It will look like the next image:

Go to SharePoint and click the Lists menu item, then click New, and select List to create a new list.

Read More

Create Office 365 Alerts Shared Mailbox from APIs – Part 1

In terms of Office 365, when trying keep your eye on AAD Connect synchronisation, new Service Health notices, new O365 Endpoints, new Message Center updates and the rest, it can all become a little bit taxing and hard to juggle.

When a new Service Health alert reporting Service Degradation of an O365 feature appears in the Service Health Dashboard we're not always sitting watching the dashboard waiting to act. Wouldn't an alert system that drops right into your Outlook be just what you are looking for?

Then there is those who used to use the Office 365 Endpoints RSS Feed and acted as and when the feed reported new endpoints. Unfortunately, the RSS Feed was deprecated back in October 2018 and there was no obvious alternative that didn't involve calling the web service.

Well yes, in most cases unless you fancy doing something more intuitive with data such as importing it into a power BI dashboard, then most service desks benefit from having a shared mailbox gather a bunch of email alerts so that the whole team gains some visibility and all in the one place.

This collection of 8 blog posts are going to cover just that.

 

Above you will see 7 key folders that I have used to create an email alert mailbox. These alerts are harnessed from several Office 365 based APIs and I will now take you through the creation of each one in this 8 part blog series. I will be using Microsoft Flow to achieve this and here is a directory to take you to each post:

Part 1Create an Office 365 Alerts Shared Mailbox from Various APIs

Part 2Call O365 Endpoints Web Service and Return the Latest FQDNs

Part 3Call Office 365 Service Communications API and Return New Service Health Notices

Part 4 – Call Office 365 Service Communications API and Return an Hourly Summary of Service Health Notices

Part 5 – Call Office 365 Service Communications API and Return a Daily Summary of Message Center Notices

Part 6Harness the Twitter API via flow to capture new tweets from @MSFT365Status

Part 7 – Call Microsoft Graph Organization Scope to Check Last AAD Connect Sync Time

Part 8Call O365 Roadmap Web Service Weekly Digest

Read More