I’ve created a new PowerShell script that is available in my Github repo:
https://github.com/directorcia/Office365/blob/master/mggraph-sscore-get.ps1
that when run, will use the Microsoft Graph (via the mggraph SDK) to return the history of the tenant you login to.
If you do not already have the Microsoft Graph permissions to allow this access you’ll need to allow these once. The scope is securityevents.readwrite.all. You’ll also need to have the Microsoft Graph PowerShell module installed, which can be found here:
https://www.powershellgallery.com/packages/Microsoft.Graph/
Given that connection to the Microsoft Graph can be persistent at times, I’ve also created this simple Graph disconnect script:
https://github.com/directorcia/Office365/blob/master/mggraph-disconnect.ps1
that will also close down any Graph sessions that exist. This is handy when you want to use the Microsoft Graph with other tenants.
I have a few more script ideas for the information you get using this method. More about those soon.