Control 2.16: Federated Copilot Connector and MCP Governance - PowerShell Setup
Automation workflow for collecting supplemental federated connector inventory, invocation, authentication, and group-membership evidence. Current effective-access evidence must also include the Microsoft 365 admin center settings described below.
Prerequisites
- PowerShell 7+
Microsoft.Graph(Application.Read.All, Directory.Read.All, AuditLog.Read.All)ExchangeOnlineManagementfor unified-audit-log queries- M365 Global Reader or equivalent least-privilege role
- Approved evidence-retention path
Important: Federated connector and MCP surface APIs continue to evolve. Validate endpoint and operation names against the current Microsoft Learn references before automating.
CLI toggle deprecation: Microsoft Learn states
Set-FederatedConnectorToggleis being retired by August 25, 2026 so connector and agent settings are honored from the same global tenant settings. Its FAQ states that tenants that previously disabled federated Copilot connectors withSet-FederatedConnectorTogglehave that setting honored until October 20, 2026, and admins must update Allowed agent types by then to continue the behavior after October 20, 2026. Do not run historical CLI output as current-state evidence after that transition. Use Agents > Settings > Allowed agent types for the tenant-wide publisher-category posture, Copilot connectors > Your connections for connector-specific allowed-user scope and staged rollout, and controlled user tests for effective access.
Required Portal Evidence
Before running the supplemental scripts, capture:
- The saved Allowed agent types publisher-category settings, including the reviewer's assessment of their effect on other agents and apps.
- Each in-scope connector's enabled state, allowed-user scope, and Staged rollout groups from Copilot connectors > Your connections.
- For tenants that previously disabled federated Copilot connectors with
Set-FederatedConnectorToggle, evidence that Allowed agent types was updated by October 20, 2026 to continue the disabled posture after that date. - Controlled access tests showing that approved users can connect only within their source-system permissions and unapproved users cannot connect or invoke the connector. Connector inventory or administrator catalog visibility alone does not prove effective access.
- For any connector exposing create/update/delete tools, evidence that the tenant view distinguishes read from write/delete tools, that the connector is explicitly approved, and that user confirmation is required for write actions.
Script Flow
Script 1: Collect supplemental connector inventory
Connect-MgGraph -Scopes "Application.Read.All","Directory.Read.All","AuditLog.Read.All" -NoWelcome
$connectors = Invoke-MgGraphRequest -Method GET `
-Uri "https://graph.microsoft.com/beta/copilot/admin/connectors"
$connectors.value |
Select-Object id, displayName, type, authenticationMode, defaultEnabled, scopedGroupIds |
Export-Csv .\artifacts\2.16\connector-posture.csv -NoTypeInformation
Treat this export as a supplemental inventory only. Beta API fields can change and do not replace the portal record of Allowed agent types, connector-specific allowed-user scope, or controlled end-user testing.
Script 2: Capture user-credential authentications to federated services
$start = (Get-Date).AddDays(-30).ToString('o')
$signins = Invoke-MgGraphRequest -Method GET `
-Uri "https://graph.microsoft.com/v1.0/auditLogs/signIns?`$filter=createdDateTime ge $start and clientAppUsed eq 'Other clients'"
$signins.value |
Where-Object { $_.appDisplayName -match 'Notion|Canva|HubSpot|Linear|Google' } |
Select-Object createdDateTime, userPrincipalName, appDisplayName, ipAddress |
Export-Csv .\artifacts\2.16\federated-signins.csv -NoTypeInformation
Script 3: Pull federated connector invocation audit events
Connect-ExchangeOnline -ShowBanner:$false
$start = (Get-Date).AddDays(-30)
$end = Get-Date
Search-UnifiedAuditLog -StartDate $start -EndDate $end `
-RecordType CopilotInteraction `
-Operations 'CopilotConnectorInvoked','CopilotConnectorAuthenticated','CopilotConnectorAuthorizationFailed' `
-ResultSize 5000 |
Export-Csv .\artifacts\2.16\connector-invocations.csv -NoTypeInformation
Script 4: Snapshot scoped Entra groups per connector
Import-Csv .\artifacts\2.16\connector-posture.csv |
Where-Object { $_.scopedGroupIds } |
ForEach-Object {
$connector = $_.displayName
foreach ($groupId in ($_.scopedGroupIds -split ';')) {
Get-MgGroupMember -GroupId $groupId -All |
Select-Object @{n='Connector';e={$connector}},
@{n='UPN';e={$_.AdditionalProperties.userPrincipalName}}
}
} | Export-Csv .\artifacts\2.16\connector-scope-membership.csv -NoTypeInformation
Script 5: Package evidence
$stamp = Get-Date -Format 'yyyyMMdd-HHmm'
Compress-Archive -Path .\artifacts\2.16\* `
-DestinationPath ".\artifacts\2.16\federated-connector-evidence-$stamp.zip"
Operational Guidance
| Task | Cadence | Notes |
|---|---|---|
| Portal access-policy capture | Monthly and after policy changes | Captures Allowed agent types, connector allowed-user scopes, and staged groups |
| Supplemental connector inventory | Monthly | Detects catalog changes for reconciliation; does not prove effective access |
| Sign-in and invocation audit pull | Weekly | Detects authentication patterns to unsanctioned services |
| Scoped-group membership reconciliation | Quarterly | Aligns scope to vendor-risk decisions |
| Vendor reassessment | Annually or per third-party policy | Per OCC Bulletin 2023-17 lifecycle expectations |
Next Steps
- Continue to Verification & Testing for scope and DLP validation.
- Reference Troubleshooting for inventory and audit issues.
FSI Copilot Governance Framework v1.8.0 - July 2026 - Back to Control 2.16