Connecting to an M365 tenant
Option 1 -- Direct connection
# Connect to both Graph and Exchange (interactive browser)
Connect-IRT -TenantId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
# Device code auth (useful when browser pop-up is unavailable)
Connect-IRT -TenantId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -DeviceCode
# Exchange only in a GCC High environment
Connect-IRT -TenantId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -Exchange -GCCHigh
# Request additional Graph scopes beyond the defaults
Connect-IRT -TenantId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -AdditionalScope "AuditLog.Read.All","Mail.Read"
Option 2 -- Tenant alias (recommended for multi-tenant work)
If you regularly connect to the same tenants, you can preconfigure their information in the tenants spreadsheet.
To create/open the spreadsheet:
Open-IRTTenantWorksheet
Then, to connect:
Connect-IRTTenant -Tenant contoso
Verify connection status
Test-IRTConnection
Connection status is also shown in the custom prompt.
Warning
The access tokens used only have a lifetime of an hour, after which you'll have to run your connect command again to fetch a new token.
How to start an investigation: Investigation