Skip to content

Instantly share code, notes, and snippets.

View LockTar's full-sized avatar

Ralph Jansen LockTar

View GitHub Profile
<#
.DESCRIPTION
This script will add the Service Principal of the Application as Owner of the Application.
It performs the following steps:
- Login to the graph.microsoft.com
- Validate the Application Id
- Retrieve the current owner(s)
- Add if applicable the application delegation for graph.microsoft.com/Application.ReadWrite.OwnedBy
- Perform if applicable the admin consent for the application delegation graph.microsoft.com/Application.ReadWrite.OwnedBy
- Add if applicable the service principal to the application as owner
@psignoret
psignoret / New-AzureADPSApplicationAppRole.ps1
Created October 9, 2018 09:41
A PowerShell script to create a new AppRole on an Application object in Azure AD.
<#
.SYNOPSIS
Adds a new AppRole to an Application.
.PARAMETER Application
The Application object's object ID.
.PARAMETER AllowedMemberTypes
The allowed member types, Application, User or both.