Use PowerShell Modules in Azure Functions

Lately, I have been working on some self-service tooling so that the employees can do specific tasks themselves, like updating members of a Shared Mailbox instead of creating a ticket and asking IT to do this. To build this solution, we have developed an Azure Function with API management as the back-end and a PowerApp as the front-end. Our team uses PowerShell a lot, and the easiest way to communicate with Exchange Online is using PowerShell.

Grammarly, my writing assistant

Arjan Cornelissen
This week I will share a tool I use daily as a non-native English speaker and writer; spelling and grammar are not my best skills, so about five years ago, I found Grammarly. What is Grammarly Grammarly is a service that assists you with your writing skills. It marks your spelling and grammar mistakes and explains why things are a mistake and how you can improve it. It works by default in the browser, Microsoft Office, an app on your machine, and a keyboard on your mobile.

How to Assign permissions to a Managed Identity

Arjan Cornelissen
Assigning permissions to a Managed Identity is more complex than an app registration; the only way is thru PowerShell or Microsoft Graph. So this time, I created a simple script to add permissions to a Managed Identity using the Graph PowerShell modules. Prerequisites You need two modules for this: Microsoft.Graph.Applications Microsoft.Graph.Authentication Rights The rights that are needed to assign rights and find the correct IDs are Directory.Read.All AppRoleAssignment.ReadWrite.All The script $objectID = "<ObjectID of the Managed Identity>" $ServicePrincipal = Get-MgServicePrincipal -Filter "AppId eq '00000003-0000-0000-c000-000000000000'" $approle = $ServicePrincipal.

Enable progress bar in PowerShell 7

Arjan Cornelissen
In PowerShell 7, I have noticed that on my machine the Progress bar was not showing by default. I found that annoying, so I searched for how to get it back; this was very easy in the end. Reveiling it again All you have to do is add this line of code to your script $ProgressPreference = 'Continue' Show it at the top This line will display the progress bar again; the only difference with the previous PowerShell versions is that it now shows it inline instead of at the top of the window.

Move scripts from Azure AD modules to Microsoft Graph Modules

Arjan Cornelissen
In the last few weeks, I took some time to refactor most of my scripts and Azure Automation script to use the Microsoft Graph Modules over the Azure AD Module. As I explained in my previous blog, the Azure AD module is declared deprecated. How to start updating The first thing to do of course is to install the latest Microsoft Graph Modules with: Install-Module Microsoft.Graph Connecting to the Graph Connecting to the Microsoft Graph is almost the same as via Azure AD, except there are a few extra options

Enable PIM role thru Microsoft Graph PowerShell

Arjan Cornelissen
Five years ago, I wrote an article about enabling PIM roles with Powershell, and last week I took it upon myself to convert it using the Microsoft Graph PowerShell modules Why would you move? The primary reason to start moving to the graph modules is that the AzureAD and other modules were declared deprecated last year; see this post for all the details https://techcommunity.microsoft.com/t5/microsoft-entra-azure-ad-blog/azure-ad-change-management-simplified/ba-p/2967456 The modules still work but will not get any updates anymore.

Three easy tips on reducing SPAM in Office 365

Arjan Cornelissen
I wanted to do a write up of the tips I found in Office 365 to reduce the number of unwanted messages in Office 365. I will skip the most basic ones like adding the SPF record as this is told by the domain configuration that you need that. The more advanced once and usually not configured settings can bring you more. Let us start with the anti-spam policy, this one is configured with the basic settings, but are very loose.

PowerShell where-object query on large datasets

The last few weeks I had to create a few PowerShell scripts where I had to combine certain information from several sources. The way I used to do it was to do a where-object on an ID in an array. This works well, but I noticed that on large datasets it takes a lot of time. A where-object on a dataset of 30.000 items it takes on average between 1 and 2 seconds.

European Collaboration Summit 2019

Last week I attended the European Collaboration Summit for the third time. This year another location in Wiesbaden. It was a fantastic conference with a lot of great speakers. This year I choose not to make a long post an everything I saw but made an Instagram story with the highlights. Go and watch it here https://www.instagram.com/stories/highlights/17889983905339614/ Next year the conference is coming back to Wiesbaden from June 8th till June 10th