Create Azure AD App Registration with Microsoft.Graph PowerShell

Hi All,

In this Blog Post i explain you how to create an Azure AD App Registration with the Microsoft.Graph PowerShell.

You need to have the Azure Active Directory Role “Application Administrator” or “Application Developer”.

By the way. All the Code is used here is also on my GitHub Repo

#Import Module
Import-Module Microsoft.Graph.Authentication
Import-Module Microsoft.Graph.Applications
###############################################################################
#Connect-MgGraph
#Connect to your Azure Active Directory with "Application Adminstrator" or "Global Administrator" Role
###############################################################################
Connect-MgGraph -Scopes "Application.Read.All","Application.ReadWrite.All","User.Read.All"
Get-MgContext

Microsoft.Graph PowerShell Module 1.18.0 released

Hi All,

A few hours ago, Microsoft has released a new Version of the Microsoft.Graph PowerShell Module.

Apparently it covers the latest API version and Help as well as a minor fix.

Let’s check the installed Version and what’s available on the PowerShell Gallery

Get-InsalledModule Microsoft.Graph
Find-Module Microsoft.Graph

To install the newest Version of the PowerShell Modules and also uninstalling the old Versions, you can use my GitHub Script. It takes a while until all Modules are installed. Wait until “Cleanup finished” is shown.

Exchange Online Name Attribute change creates some inconsistencys

Hi All,

Back in April 2022 Microsoft has anounced in theyr Exchange Team Blog, that they will change the Name Attribute of the Objects to the ExternalDirectoryObjectId (EDOID). After some Feedback from Customers and the Community they stopped the Rollout for Reflection as you can read on the Blog post of Tony Redmond.

MSIdentityTools PowerShell Module v2.0.26 released

Hi All,

Just a few Hours ago, a new Version of MSIdentity Tools has been released.

Uninstall the old version of the PowerShell Module and install the newest one

Get-InstalledModule MSIdentityTools
Find-Module MSIdentityTools

Uninstall-Module MSIdentityTools
Install-Module MSIdentityTools
Get-InstalledModule MSIdentityTools

To see what commands are available use the following command

Get-Command -Module MSIdentityTools

Regards
Andres Bohren

Create Microsoft Teams Holidays for Switzerland 2023

Hi All,

In Microsoft Teams the Holidays have always been a bit Tricky.

You can create Holidays direct in Teams Admin Center under Voice > Holidays or during the Creation or Modification of a Autoattendant.

The Problem is that you create the Holidays and these are mostly set up to a specific Year. Next year you have to redo the Holidays and go through all Autoattendants to see if they are still linked.

PowerShell Module Microsoft.Online.SharePoint.PowerShell 16.0.23109.12000 released

Hi All,

Some hours ago, Microsoft has released a new Version of the Microsoft.Online.SharePoint.PowerShell Module to the PowerShell Gallery.

Check what Module Version is installed and what’s available from the PowerShell Gallery

Get-InstalledModule Microsoft.Online.SharePoint.PowerShell
Find-Module Microsoft.Online.SharePoint.PowerShell

Uninstall the old Module and install the new Version

Uninstall-Module Microsoft.Online.SharePoint.PowerShell
Install-Module Microsoft.Online.SharePoint.PowerShell
Get-InstalledModule Microsoft.Online.SharePoint.PowerShell

Regards
Andres Bohren

Azure AD User setting Tenant Creation

Hi All,

Since a few Days there is a new Setting in Azure AD User Settings “Tenant creation”

Per default this setting is set to “Yes”. Means that a user with can create a new Azure AD Tenant.

“No” means that only users with “Global Administrator” or “Tenant Creator” Admin Role can create Azure AD Tenants.

I can’t think much of a Szenario where this should be enabled. So setting this to “No” is a secure configuration.

Deploy PowerShell 7 Script on Azure Automation

Hi All,

In this Blog Post i explain how to Create and Depoly a PowerShell 7 Runbook for Azure Automation with the AZ PowerShell Module.

#Connect to Azure
Connect-AzAccount
#Get Automation Account
Get-AzAutomationAccount

I have two Azure Automation Accounts. In this Example, we use the second one.

###############################################################################
# Create Runbook
###############################################################################
$accountName = "icewolfautomation"
$rgName = "RG_DEV"
$location = "West Europe"
$RunbookName = "DemoPS7"
$scriptContent = @'
    #Connect to Exchange with Managed Identity
    $tenant = "icewolfch.onmicrosoft.com"
    Connect-ExchangeOnline -ManagedIdentity -Organization $tenant
    #Get Accepted Domain
    Get-AcceptedDomain | Format-Table DomainName, DomainType
    #Disconnect Exchange Online
    Disconnect-ExchangeOnline -Confirm:$False
'@
Invoke-AzRestMethod -Method "PUT" -ResourceGroupName $rgName -ResourceProviderName "Microsoft.Automation" `
-ResourceType "automationAccounts" -Name "${AccountName}/runbooks/${RunbookName}" -ApiVersion "2017-05-15-preview" `
-Payload "{`"properties`":{`"runbookType`":`"PowerShell7`", `"logProgress`":false, `"logVerbose`":false, `"draft`":{}}, `"location`":`"${Location}`"}"
Invoke-AzRestMethod -Method "PUT" -ResourceGroupName $rgName -ResourceProviderName "Microsoft.Automation" `
-ResourceType automationAccounts -Name "${AccountName}/runbooks/${RunbookName}/draft/content" -ApiVersion 2015-10-31 `
-Payload "$scriptContent"

How to Manage PowerShell 5 and 7 Modules on Azure Automation

Hi All,

As you might already know, i am a big Fan of Azure Automation. Recently i have used “Managed Identity with Exchange Online on Azure Automation”.

Yesterday there was a Release of “Microsoft.Graph PowerShell Module 1.17.0” and the Question of how to update the PowerShell Modules on Azure Automate arises once again.

Basically i’ve covered that already in a Blog Post earlyer this Year “Update Modules on Azure Automation with AZ PowerShell”.