Saturday, May 11, 2024
HomePowershellNew PowerShell module for Microsoft Graph API studies by Bas Wijdenes

New PowerShell module for Microsoft Graph API studies by Bas Wijdenes


Azure AD & Microsoft 365 studies in a single module

In my work we use quite a lot of Microsoft APIs, particularly the Microsoft Graph API.
Because the Graph API has some ways to optimize and alter in bulk, I began with the Optimized.Mga module.

Solely factor I observed was that I typically made the identical studies after which I may make the identical changes, areas from property names, strings to arrays, bytes to gigabytes, and so forth.

So, on a wet Sunday I made a decision to place the entire Azure AD & Microsoft 365 studies in a module in order that any longer I solely want a single cmdlet.

Received any questions? Please let me know within the feedback.


Details about Optimized.Mga.Report

  • The module is a submodule of Optimized.Mga.
    This module will robotically put in while you set up Optimized.Mga.Report.
  • The module makes use of the v1.0 reference.

For now it isn’t doable to make use of the beta model.
It’s because the info is processed into clearer property names and arrays. These property names could not at all times match between the v1.0 and beta variations.

Module could be put in immediately through the use of the next cmdlet.

Set up-Module Optimized.Mga.Report -Scope CurrentUser

How can I interpret the Optimized.Mga.Report module?

Go to the Microsoft Graph API Docs and open the v1.0 reference studies.

For example we use the next report:
reportRoot: getMailboxUsageDetail – Microsoft Graph v1.0 | Microsoft Docs

The module begins with Get-MgaReport by default.
We’d like the title of the reference. That is reportRoot: getMailboxUsageDetail.

Since Get and Report is already within the identify, we solely take the half that begins with a capital letter after the colon(:).

So within the instance beneath we’re utilizing MailboxUsageDetail and the cmdlet turns into Get-MgaReportMailboxUsageDetail.

New PowerShell module for Microsoft Graph API reports
New PowerShell module for Microsoft Graph API studies

If you wish to retrieve Microsoft 365 utilization studies, you want at the least this permission:

If you wish to retrieve Azure AD utilization studies, you want at the least these permissions:

  • AuditLog.Learn.All
  • Listing.ReadWrite.All
  • Listing.Learn.All

The official Microsoft Graph API PowerShell module VS my modules

I’m conscious that there’s additionally an official Microsoft Graph API and submodule Microsoft Graph Experiences from Microsoft.

As a result of this isn’t (but) utterly adequate for myself, I began working by myself module.

The massive distinction in the principle modules is the way in which of logging in & how simply you possibly can alter the request Uri’s with out having to consider the rest.

My Microsoft Graph Report module has the benefit that the info has been processed.

For instance:

  • With property names the areas have been eliminated, the string information akin to that of AssignedProducts property is robotically up to date to an array.
  • It is going to be checked whether or not you may have the proper permissions and if not, it will likely be indicated which one you’re nonetheless lacking.
  • Bytes are transformed to Gb and for some cmdlets the free area can also be returned.

The modules I made are purely for AzureAD App Registrations and Managed Identities.
It may be used as a person, however the concept behind the module is that it makes optimum use of pace and bulk optimizations that the Microsoft Graph API has to supply.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments