Skip to content

Instantly share code, notes, and snippets.

@psignoret
psignoret / Get-AzureADPSPermissions.ps1
Last active May 21, 2024 09:46
Script to list all delegated permissions and application permissions in Microsoft Entra ID
# 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" }
<#
@hallzy
hallzy / set-proxy-for-whole-machine.cmd
Last active February 9, 2022 16:51
Please read the Notes at the top of each of the scripts before you run them. Set Windows IE proxy with a cmd file, or set Windows IE proxy globally by changing the "DefaultConnectionSettings" registry key as well as "ProxySettingsPerUser" and "Proxy" for GPO settings. PLEASE SAVE A COPY OF YOUR REGISTRY JUST IN CASE YOU NEED TO GO BACK!
:: NOTE: If you don't want to make proxy settings for the whole machine,
:: find the line in this script that starts with "reg add" and change
:: "HKLM" to "HKCU" so that it only affects the current user (or change it
:: to reflect the specific hive that you want to change)
:: Supported Characters in proxy server address (if you need more, consult
:: an ascii table and make a new "if" statement for the character you need,
:: but these should suffice):
:: * - . / : ; = ? @ ~ < >
:: All Numbers
@mattifestation
mattifestation / CIPolicyParser.ps1
Last active March 13, 2024 19:48
Functions to recover information from binary Windows Defender Application Control (WDAC) Code Integrity policies.
# Ensure System.Security assembly is loaded.
Add-Type -AssemblyName System.Security
function ConvertTo-CIPolicy {
<#
.SYNOPSIS
Converts a binary file that contains a Code Integrity policy into XML format.
Author: Matthew Graeber (@mattifestation)