Authenticated Enumeration
Microsoft Graph Module
Connect to MS Graph
Connect-MgGraph$Token = eyJ0
Connect-MgGraph -AccessToken ($Token | ConvertTo-SecureString -AsPlainText -Force)Get a Token
$passwd = ConvertTo-SecureString "Password123!" -AsPlainText -Force
$creds = New-Object System.management.automation.pscredential ("[email protected]", $passwd)
Connect-AzAccount -Credential $creds
$Token = (Get-AzAccessToken -ResourceTypeName MSGraph).token
$token# Prompt for Email
$email = Read-Host "Enter your email address"
# Prompt for Password (input is hidden)
$password = Read-Host "Enter your password" -AsSecureString
# Create a PSCredential object
$creds = New-Object System.Management.Automation.PSCredential ($email, $password)
# Connect to Azure Account
Connect-AzAccount -Credential $creds
# Get the Access Token for MSGraph
$Token = (Get-AzAccessToken -ResourceTypeName MSGraph).Token
# Output the token (optional)
Write-Host "Access Token for Mg-Graph:" $TokenUsers
Groups
Roles
Devices
Applications (Registered Applications)
Service Principals (Enterprise Applications)
Administrative Unit
Get M365 license
Az PowerShell
General context
VMs
App Registrations
Storage Accounts
Key Vaults
Automated script

Azure CLI
Get users
Last updated