Skip to content

Instantly share code, notes, and snippets.

@ninjabytes
ninjabytes / commands.ps1
Created July 11, 2025 21:48 — forked from Jasemalsadi/commands.ps1
Azure PT commands cheat sheet, from both CARTP and CARTE courses
# Connect
$passwd = ConvertTo-SecureString "NewUserSSecret@Pass61" -AsPlainText -Force
$creds = New-Object System.Management.Automation.PSCredential ("AS-5945632460@oilcorptarsands.onmicrosoft.com", $passwd)
Connect-AzAccount -Credential $creds
#Connect-AzureAD -Credential $creds
Connect-MgGraph -ClientSecretCredential $creds -TenantId bcdc6c96-4f80-4b10-8228-2e6477c71851
## 1. Unauthenticated Recon:
#Get if Azure tenant is in use, tenant name and Federation
https://login.microsoftonline.com/getuserrealm.srf?login=[USERNAME@DOMAIN]&xml=1