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
$tenantId = "00000000-0000-0000-0000-000000000000" # Replace with your tenant ID | |
$graphApiAppId = "00000003-0000-0000-c000-000000000000" # Well known ID | |
$msiName = "MSINAME" # Name of your managed identity e.g. name of Function or Logic App | |
$graphPermissions = @("Directory.Read.All", "User.Read.All") # Add or remove permissions | |
Connect-AzureAD -TenantId $tenantId | |
$msi = Get-AzureADServicePrincipal -Filter "displayName eq '$msiName'" # Can take a few seconds, add a sleep if necessary | |
$graphApiAppRegistration = Get-AzureADServicePrincipal -Filter "appId eq '$graphApiAppId'" | |
$appRoles = $graphApiAppRegistration.AppRoles | Where-Object { $graphPermissions -contains $_.Value -and $_.AllowedMemberTypes -contains "Application" } | |
foreach ($appRole in $appRoles) { |
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
#Here is a simple script to hash a string using your chosen cryptography algorithm. | |
#Usage Examples: | |
#Get-StringHash "My String to hash" "MD5" | |
#Get-StringHash "My String to hash" "RIPEMD160" | |
#Get-StringHash "My String to hash" "SHA1" | |
#Get-StringHash "My String to hash" "SHA256" | |
#Get-StringHash "My String to hash" "SHA384" | |
#Get-StringHash "My String to hash" "SHA512" | |
#http://jongurgul.com/blog/#Get-StringHash-get-filehash/ |
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
#!/usr/bin/env python | |
""" | |
2020 update: | |
- More iterators, fewer lists | |
- Python 3 compatible | |
- Processes files in parallel | |
(one thread per CPU, but that's not really how it works) | |
""" |