The new and improved Power Platform admin center is now in public preview! We designed the new admin center to be easier to use, with task-oriented navigation that helps you achieve specific outcomes faster. We'll be publishing new and updated documentation as the new Power Platform admin center moves to general availability.
This tutorial demonstrates how to use the programmability tools to create cross-tenant isolation reports.
Add a new action to the canvas, searching for "Create a request to generate a cross-tenant connection report for a tenant, or return an existing report". There are no parameters required.
Use the following PowerShell script to create the report.
Import-Module "MSAL.PS"
$AuthResult = Get-MsalToken -ClientId '49676daf-ff23-4aac-adcc-55472d4e2ce0' -Scope 'https://api.powerplatform.com/.default'
$Headers = @{Authorization = "Bearer $($AuthResult.AccessToken)"}
try
{
# Create a cross tenant connections report
$tenantReportCreateResponse = Invoke-RestMethod -Method Post -Uri "https://api.powerplatform.com/governance/crossTenantConnectionReports?api-version=2022-03-01-preview" -Headers $Headers -Body ""
$reportId = $tenantReportCreateResponse.reportId
$reportStatus = $tenantReportCreateResponse.status
Write-Host "Cross tenant connections report created with ID=$reportId and status=$reportStatus"
} catch {
# Dig into the exception to get the Response details.
Write-Host "Response CorrelationId:" $_.Exception.Response.Headers["x-ms-correlation-id"]
Write-Host "StatusCode:" $_.Exception.Response.StatusCode.value__
Write-Host "StatusDescription:" $_.Exception.Response.StatusDescription
$result = $_.Exception.Response.GetResponseStream()
$reader = New-Object System.IO.StreamReader($result)
$reader.BaseStream.Position = 0
$reader.DiscardBufferedData()
$responseBody = $reader.ReadToEnd();
Write-Host $responseBody
}
Add a new action to the canvas, searching for "Get a cross-tenant connection report by report ID for a tenant". Provide the report ID from prior steps.
Use the following PowerShell script to fetch a single report for your tenant about connections used within the tenant.
Import-Module "MSAL.PS"
$AuthResult = Get-MsalToken -ClientId '49676daf-ff23-4aac-adcc-55472d4e2ce0' -Scope 'https://api.powerplatform.com/.default'
$Headers = @{Authorization = "Bearer $($AuthResult.AccessToken)"}
try
{
# Get one cross tenant connections report for a tenant
$tenantListReportResponse = Invoke-RestMethod -Method Get -Uri "https://api.powerplatform.com/governance/crossTenantConnectionReports/{$reportId}?api-version=2022-03-01-preview" -Headers $Headers
$report = $tenantListReportResponse | ConvertTo-Json -Depth 2
Write-Host $report
Write-Host ""
} catch {
# Go through the exception to get the Response details.
Write-Host "Response CorrelationId:" $_.Exception.Response.Headers["x-ms-correlation-id"]
Write-Host "StatusCode:" $_.Exception.Response.StatusCode.value__
Write-Host "StatusDescription:" $_.Exception.Response.StatusDescription
$result = $_.Exception.Response.GetResponseStream()
$reader = New-Object System.IO.StreamReader($result)
$reader.BaseStream.Position = 0
$reader.DiscardBufferedData()
$responseBody = $reader.ReadToEnd();
Write-Host $responseBody
}