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
Function DeleteUser | |
{ | |
param( | |
[String] $token, | |
[String] $upn | |
) | |
$headers = @{"Authorization" = "Bearer $($token)"; "Content-Type" = "application/json"} | |
$deleteUserUri = "https://graph.windows.net/<your.tenant.domain>/users/$($upn)?api-version=1.5" | |
$userDeleteResult = Invoke-WebRequest -Uri $deleteUserUri -Headers $headers -Method Delete | |
$userDeleteResult |
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
$errConnections = Get-AzureRmResource -ResourceGroupName RG-Development ` | |
-ResourceType "Microsoft.Web/connections" -ExpandProperties | | |
Where-Object { $_.Properties.Statuses.Status -eq "Error" } | |
$errConnections.Count | |
$errConnections[0].Properties |
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
Login-AzureRmAccount | |
cls | |
$subs = Get-AzureRmSubscription | |
ForEach ($sub in $subs) | |
{ | |
Write-Host 'ARM: VPN Gateways in subscription' $sub.SubscriptionName '(' $sub.SubscriptionId ')' | |
Select-AzureRmSubscription -SubscriptionName $sub.SubscriptionName -OutVariable out | |
$gwr = Find-AzureRmResource -ResourceType "Microsoft.Network/virtualNetworkGateways" | |
if ( $gwr -ne $null) | |
{ |
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
param( | |
[String] $destinationUri = "https://[YOUR STORAGE ACCOUNT NAME].blob.core.windows.net/vhds", | |
[String] $destinationKey = "[YOUR STORAGE ACCOUNT KEY]", | |
[String] $sourceAccountPattern = "*disk*", | |
[String] $pathToAzCopy = "C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy\AzCopy.exe" | |
) | |
clear | |
Login-AzureRmAccount -EnvironmentName AzureGermanCloud | |
$storageAccounts = Get-AzureRmStorageAccount |
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
// basically gets all data about organization | |
ldapsearch -x -h fqdn.of.the.domain -D "upn" -w "password" -b 'dc=idcxp,dc=site' | |
// get data about single user object | |
// make sure you get the DN correct | |
ldapsearch -x -h fqdn.of.the.domain -D "upn" -w "password" -b 'CN=bdm-user bdmou,OU=AADDC Users,DC=idcxp,DC=site' | |
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
#!/bin/bash | |
function check_directory_dependencies() { | |
echo "Checking for graph extension on Azure CLI..." | |
echo "--------------------------------------------" | |
PATTERN='resource-graph' | |
string=$(az extension list | grep 'resource-graph') | |
if [[ $string == *"resource-graph"* ]]; | |
then | |
# az extension update --name resource-graph | |
echo 'Graph extension is already installed...' |
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
function computeHttpSignature(config, headerHash) { | |
var template = 'keyId="${keyId}",algorithm="${algorithm}",headers="${headers}",signature="${signature}"', | |
sig = template; | |
// compute sig here | |
var signingBase = ''; | |
config.headers.forEach(function(h){ | |
if (signingBase !== '') { signingBase += '\n'; } | |
signingBase += h.toLowerCase() + ": " + headerHash[h]; | |
}); |
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
Connect-AzureAD -Confirm | |
Import-Module AzeruADPreview | |
$appID = "...guid-of-the-AppID..." | |
$policyName = "Add email_verified to claims" | |
$sp = Get-AzureADServicePrincipal -Filter "servicePrincipalNames/any(n: n eq '$appID')" | |
$existingPolicies = Get-AzureADServicePrincipalPolicy -Id $sp.ObjectId ` | |
| Where-Object { $_.Type -eq "ClaimsMappingPolicy" } |
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
## Use this script to quickly analyse your current Azure AD B2C Tenant | |
## Please use cloud only user (Global Admin) local to your B2C tenant | |
## This script uses Azure AD PowerShell for MS Graph + Azure AD PowerShell for Graph preview modeules | |
## https://docs.microsoft.com/en-us/powershell/azure/active-directory/overview?view=azureadps-2.0 | |
## https://docs.microsoft.com/en-us/powershell/azure/active-directory/overview?view=azureadps-2.0-preview | |
## You must have both the modules to run this script | |
## The information is based on the Audit Logs of Azure AD B2C, which is only there for 7 days | |
## If you need to query data for more than 7 days, then you must export your Azure AD B2C Audit Logs | |
## Read More about how to export Azure AD B2C Audit Logs to Log Analytics Workspace: | |
## https://docs.microsoft.com/en-us/azure/active-directory-b2c/azure-monitor |
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
Connect-AzureAD | |
$roles = Get-AzureADDirectoryRole | |
foreach ($role in $roles) | |
{ | |
$members = Get-AzureADDirectoryRoleMember -ObjectId $role.ObjectId | |
Write-Host "--- Service Principals members of " $role.DisplayName " ---" | |
foreach ($member in $members) | |
{ | |
if($member.ObjectType -eq "ServicePrincipal") | |
{ |