Giter Club home page Giter Club logo

msgraph-utility-scripts's Introduction

Microsoft Graph - Utility Scripts for PowerShell

This repository contains some PowerShell scripts that improve my daily development or administration work. These scripts are all using the Microsoft Graph PowerShell module.
All these scripts work on PowerShell Core / PowerShell 7.1.

Prerequisites

These scripts require the following PowerShell modules:

Scripts

Add-ApplicationPermissionsToServicePrincipal

Purpose

This scripts helps to assign Application Permissions to a Service Principal and grant admin consent. This is especially useful for assigning Application Permissions to Managed Identities, as there currently is no UI in the Azure Portal that can achieve the same result (and Managed Identities do not have an associated App Registration where this can be achieved).

Usage

Add permission scopes from Microsoft Graph to your Service Principal:

. ./AddApplicationPermissionsToServicePrincipal.ps1
Add-ApplicationPermissionsToServicePrincipal -ServicePrincipalAppId <YourServicePrincipalApplicationId> -Api MicrosoftGraph -ApplicationPermissionScopes "Team.Create", "Group.ReadWrite.All"

Add permission scopes from SharePoint to your Service Principal:

. ./AddApplicationPermissionsToServicePrincipal.ps1
Add-ApplicationPermissionsToServicePrincipal -ServicePrincipalAppId <YourServicePrincipalApplicationId> -Api SharePoint -ApplicationPermissionScopes "Sites.ReadWrite.All"

Add permission scopes from another API to your Service Principal

. ./AddApplicationPermissionsToServicePrincipal.ps1
Add-ApplicationPermissionsToServicePrincipal -ServicePrincipalAppId <YourServicePrincipalApplicationId> -ApiServicePrincipalAppId <ApiServicePrincipalApplicationId> -ApplicationPermissionScopes "Sites.ReadWrite.All"

Revoke-PermissionConsentFromServicePrincipal

Purpose

Provide an intuitive way to revoke Application Permissions and Delegated Permissions that have been consented for one or more Service Principals. When selecting Delegated Permissions, an option is presented to select Admin consented and/or User consented permissions. With User consented permissions you can pick for which user specifically you'd like to revoke the consent.

Usage

. ./RevokePermissionConsentFromServicePrincipal.ps1
Revoke-PermissionConsentFromServicePrincipal

Disclaimer

THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.

msgraph-utility-scripts's People

Contributors

yannickre avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.