Red Labs Platform

Setup Windows Tools

Install-Module -Name PowerShellGet -Force -Confirm
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser  -Force -Confirm
Install-Module -Name Az -Repository PSGallery -Force -Confirm
Install-Module Microsoft.Graph -Scope CurrentUser  -Force -Confirm
$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri <https://aka.ms/installazurecliwindows> -OutFile .\\AzureCLI.msi; Start-Process msiexec.exe -Wait -ArgumentList '/I AzureCLI.msi /quiet'; Remove-Item .\\AzureCLI.msi 

Using Compromised Identities

Az Powershell

$pass = ConvertTo-SecureString '<PASSWORD>' -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential("<UserPrincipalName>", $pass)

# With account
Connect-AzAccount -Credential $cred

# With service principal
Connect-AzAccount -Credential $cred -ServicePrincipal -Tenant "<TENANTID>"

# With Token
Connect-AzAccount -AccessToken '' -AccountId '<ANYNAME>'  

# Connecting to MS Graph (Assumed to be logged in)
$AccessToken = (Get-AzAccessToken).Token
Connect-MgGraph -AccessToken $AccessToken