- PowerShell 7.2+
- Microsoft.Graph.Authentication module (v2.0.0+)
- Entra ID tenant with Global Administrator or appropriate admin roles
# From PowerShell Gallery
Install-Module -Name TenantBaseline -Scope CurrentUser
# Or clone and import directly
git clone https://github.com/ugurkocde/TenantBaseline.git
Import-Module ./tenantbaseline/src/TenantBaseline/TenantBaseline.psd1Connect-TBTenant -Scenario SetupThis opens a browser-based interactive login for setup operations. After setup, reconnect with the lower-privilege manage profile:
Connect-TBTenant -Scenario ManageFor unattended automation after setup, see Authentication and Automation.
This is a one-time step per tenant. The UTCM service principal is a Microsoft first-party application that executes the configuration monitors.
Install-TBServicePrincipalGrant the service principal permission to monitor specific workloads:
# Grant permissions for Conditional Access monitoring
Grant-TBServicePrincipalPermission -Workload ConditionalAccess
# Preview the full plan (auto + manual steps)
Get-TBPermissionPlan -Workload MultiWorkload
# Or grant permissions for all workloads at once
Grant-TBServicePrincipalPermission -Workload MultiWorkload# Create a monitor with resources to track
New-TBMonitor -DisplayName 'MFA Required Monitor' -Resources @(
@{ resourceType = 'microsoft.entra.conditionalaccesspolicy'; displayName = 'MFA Policy' }
)Monitors run on a 6-hour cycle. After the first run completes:
# List all detected drifts
Get-TBDrift
# Get an aggregated summary
Get-TBDriftSummary
# Generate an HTML report
New-TBDriftReport -OutputPath './drift-report.html'# Create a snapshot and wait for it to complete
$snapshot = New-TBSnapshot -DisplayName 'Daily Snapshot' -Resources @(
'microsoft.entra.conditionalaccesspolicy',
'microsoft.exchange.antiphishpolicy'
) | Wait-TBSnapshot
# Export the snapshot before it expires (7-day TTL)
Export-TBSnapshot -SnapshotId $snapshot.Id -OutputPath './snapshot.json'- Read about Authentication options
- Read Automation if you want Azure Automation runbooks, schedules, managed identity, or hosted notifications
- Check API Limits for service constraints