Skip to content

Instantly share code, notes, and snippets.

psignoret / index.html
Last active March 30, 2019 00:44
CORS for popups demo
<style>* { font-family: sans-serif; }</style>
<p>You are at The page that launched this popup
is on a different domain (, and cannot see anything here because of CORS.</p>
<p>Go to a page under the same domain as the page that opened the popup:
<a href=""></a>
psignoret / ManageAppAndServicePrincipalOwner.ps1
Created October 20, 2016 13:15
Script to manage Azure AD app owners
# Adds, lists or removes owners of Azure AD Application and ServicePrincipal objects
# Add as owner to both app and service principal
.\ManageAppAndServicePrincipalOwner.ps1 -Add "" -Application -AppId "e1d83a3c-fea5-4315-9591-8d9f185d2d56"
# List owners for the app in the tenant
.\ManageAppAndServicePrincipalOwner.ps1 -List -Application -AppId "e1d83a3c-fea5-4315-9591-8d9f185d2d56" -TenantId "" | ft userPrincipalName
psignoret /
Last active May 11, 2021 14:15
Minimal sample app using ADAL.JS and vanilla JavaScript

Using ADAL.JS with vanilla JavaScript

A minimal sample app using ADAL.JS and plain old vanilla JavaScript to obtain an access token from Azure Active Directory and use that access token to make an API request. In this case, the API we're requesting a token for is the Microsoft Graph API, which is used to retrieve the signed-in user's basic profile.

You can see (and test) this live at:

psignoret / Manage-AzureADPSAppRoleAssignments.ps1
Created February 8, 2018 20:38
Add or remove application permissions to a client application.
Grants (or removes) application permissions (app role assignments) to a client application.
The AppId or one of the ServicePrincipalNames of the client service principal.
.PARAMETER Permissions
A hashtable where the key is an identifier for the resource (either the AppId or one of the
ServicePrincipalNames) and the value is the space-separated list of app roles desired.
psignoret / Manage_Mfa_State.ps1
Last active January 3, 2022 15:47
A couple utility cmdlets to simplify managing Azure MFA state
Two helper functions to simplify managing user MFA state in Azure Active Directory.
# Disable MFA for one user, keeping MFA methods intact
Get-MsolUser -UserPrincipalName "" | Disable-Mfa -KeepMethods
# Disable MFA for all users, keeping their MFA methods intact
psignoret / Grant_admin_consent.ps1
Last active November 1, 2022 09:12
Uses Microsoft Graph PowerShell to do roughly the same thing that happens when admin consent is granted.
psignoret / BarrierMouseSpeedFix.ps1
Last active November 26, 2022 22:22
Adjust the mouse speed when using Barrier (on Windows) to control another computer.
Adjust the mouse speed when using Barrier (on Windows) to control another computer.
When using Barrier ( across two computers of different
resolutions/DPIs, the server's mouse speed may be too fast or too slow on the client computer: This script monitors Barrier's log file and adjusts
the server's mouse speed when the mouse has moved onto the client.
psignoret / Get-AzureADPSRequiredPermissions.ps1
Last active December 14, 2023 09:34
Script to list all required permissions (RequiredResourceAccess) for all app registrations.
Lists required permissions (RequiredResourceAccess) for all app registrations.
PS C:\> .\Get-AzureADPSRequiredPermissions.ps1 | Export-Csv -Path "required_permissions.csv" -NoTypeInformation
Generates a CSV report of all required permissions declared by all apps.
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.
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.
psignoret / Get-AzureADPSPermissionGrants.ps1
Last active February 5, 2024 11:01
Get all permissions granted to an app in Azure AD
Lists delegated permission grants (OAuth2PermissionGrants) and application permissions grants (AppRoleAssignments) granted to an app.
The ObjectId of the ServicePrincipal object for the app in question.
The AppId of the ServicePrincipal object for the app in question.