This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Grants an app admin consent for delegated permissions and app roles | |
.DESCRIPTION | |
Given a client app ID and the list of required permissions for the app, this script will perform | |
mostly the same steps that take place when tenant-wide admin consent is granted: | |
1. A service principal for the client app will be created, if necessary | |
2. A service principal for each resource service will be created, if necessary and possible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Adjust the mouse speed when using Barrier (on Windows) to control another computer. | |
.DESCRIPTION | |
When using Barrier (https://github.com/debauchee/barrier) across two computers of different | |
resolutions/DPIs, the server's mouse speed may be too fast or too slow on the client computer: | |
https://github.com/debauchee/barrier/issues/741. This script monitors Barrier's log file and adjusts | |
the server's mouse speed when the mouse has moved onto the client. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Lists delegated permission grants (OAuth2PermissionGrants) and application permissions grants (AppRoleAssignments) granted to an app. | |
.PARAMETER ObjectId | |
The ObjectId of the ServicePrincipal object for the app in question. | |
.PARAMETER AppId | |
The AppId of the ServicePrincipal object for the app in question. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<style>* { font-family: sans-serif; }</style> | |
</head> | |
<body> | |
<p>You are at https://bl.ocks.org/psignoret/raw/782d7b48d47685dbce4e9cc3433462db/. The page that launched this popup | |
is on a different domain (demo.psignoret.com), 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="https://demo.psignoret.com/">https://demo.psignoret.com/spa/popup_test.html</a> | |
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Lists required permissions (RequiredResourceAccess) for all app registrations. | |
.EXAMPLE | |
PS C:\> .\Get-AzureADPSRequiredPermissions.ps1 | Export-Csv -Path "required_permissions.csv" -NoTypeInformation | |
Generates a CSV report of all required permissions declared by all apps. | |
#> | |
[CmdletBinding()] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Two helper functions to simplify managing user MFA state in Azure Active Directory. | |
Examples: | |
# Disable MFA for one user, keeping MFA methods intact | |
Get-MsolUser -UserPrincipalName "[email protected]" | Disable-Mfa -KeepMethods | |
# Disable MFA for all users, keeping their MFA methods intact |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. | |
#Requires -Modules @{ ModuleName="Microsoft.Graph.Authentication" ; ModuleVersion="2.15.0" } | |
#Requires -Modules @{ ModuleName="Microsoft.Graph.DirectoryObjects"; ModuleVersion="2.15.0" } | |
#Requires -Modules @{ ModuleName="Microsoft.Graph.Identity.SignIns"; ModuleVersion="2.15.0" } | |
#Requires -Modules @{ ModuleName="Microsoft.Graph.Applications" ; ModuleVersion="2.15.0" } | |
#Requires -Modules @{ ModuleName="Microsoft.Graph.Users" ; ModuleVersion="2.15.0" } | |
<# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Grants (or removes) application permissions (app role assignments) to a client application. | |
.PARAMETER ClientId | |
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adds, lists or removes owners of Azure AD Application and ServicePrincipal objects | |
<# | |
Examples: | |
# Add [email protected] as owner to both app and service principal | |
.\ManageAppAndServicePrincipalOwner.ps1 -Add "[email protected]" -Application -AppId "e1d83a3c-fea5-4315-9591-8d9f185d2d56" | |
# List owners for the app in the contoso.com tenant | |
.\ManageAppAndServicePrincipalOwner.ps1 -List -Application -AppId "e1d83a3c-fea5-4315-9591-8d9f185d2d56" -TenantId "contoso.com" | ft userPrincipalName |
NewerOlder