/lighthouse-operations:gdap-manage [--action create|list|renew|terminate|assign] [--customer-tenant-id <id>]from lighthouse-operations
Manages GDAP relationship lifecycle — create, list, renew, terminate relationships and assign security group roles with audit trail.
Ships in lighthouse-operations. Installing the plugin adds it to Claude Code.
Full lifecycle management for Granular Delegated Admin Privilege relationships.
Ask which action to perform if not provided via --action:
Ask for:
Contoso MSP — Full Administration)TOKEN=$(az account get-access-token --resource https://graph.microsoft.com --query accessToken -o tsv)
az rest --method POST \
--url "https://graph.microsoft.com/v1.0/tenantRelationships/delegatedAdminRelationships" \
--headers "Authorization=Bearer ${TOKEN}" \
--body '{
"displayName": "<name>",
"duration": "P730D",
"autoExtendDuration": "P180D",
"customer": { "tenantId": "<customer-tenant-id>" },
"accessDetails": {
"unifiedRoles": [
{ "roleDefinitionId": "194ae4cb-b126-40b2-bd5b-6091b380977d" },
{ "roleDefinitionId": "5d6b6bb7-de71-4623-b4af-96380a352509" },
{ "roleDefinitionId": "f2ef992c-3afb-46b9-b7cf-a126ee74c451" },
{ "roleDefinitionId": "fe930be7-5e62-47db-91af-98c3a49a38b1" },
{ "roleDefinitionId": "729827e3-9c14-49f7-bb1b-9608f156bbb8" },
{ "roleDefinitionId": "29232cdf-9323-42fd-ade2-1d097af3e4de" }
]
}
}'
After creation, extract the id from the response and generate the customer approval URL:
Customer approval URL:
https://admin.microsoft.com/AdminPortal/Home#/partners/invitation/granularAdminRelationships/{relationship-id}
Send this URL to the customer's Global Administrator.
They must approve it in the Microsoft 365 admin center before access is granted.
Once status transitions to active (poll every 5 min or instruct user to re-run with --action assign), proceed with role assignments.
# Get all relationships with status and expiry
az rest --method GET \
--url "https://graph.microsoft.com/v1.0/tenantRelationships/delegatedAdminRelationships?\$select=id,displayName,customer,status,endDateTime,autoExtendDuration&\$orderby=endDateTime asc" \
--headers "Authorization=Bearer ${TOKEN}"
Output table:
Relationship | Customer | Status | Expires | Auto-Extend
------------------------------------|-------------------|---------|--------------|------------
Contoso MSP — Full Admin | Contoso | active | 2027-03-01 | 180 days
Fabrikam MSP — Security | Fabrikam Ltd. | active | 2026-04-15 | None ⚠️
Woodgrove MSP — Read Only | Woodgrove Bank | expiring| 2026-03-28 | None ⚠️
OldCustomer MSP | Old Corp | expired | 2026-01-01 | — 🔴
Flag: relationships expiring in < 30 days, expired, or without auto-extend.
List all expiring or expired relationships. For each:
{name} — Renewal {date}--action assignaz rest --method POST \
--url "https://graph.microsoft.com/v1.0/tenantRelationships/delegatedAdminRelationships/{id}/requests" \
--headers "Authorization=Bearer ${TOKEN}" \
--body '{"@odata.type": "#microsoft.graph.delegatedAdminRelationshipRequest", "action": "terminate"}'
Assign security groups to roles on an active relationship.
az rest --method POST \
--url "https://graph.microsoft.com/v1.0/tenantRelationships/delegatedAdminRelationships/{id}/accessAssignments" \
--headers "Authorization=Bearer ${TOKEN}" \
--body '{
"accessContainer": {
"accessContainerId": "<group-object-id>",
"accessContainerType": "securityGroup"
},
"accessDetails": {
"unifiedRoles": [
{ "roleDefinitionId": "194ae4cb-b126-40b2-bd5b-6091b380977d" },
{ "roleDefinitionId": "5d6b6bb7-de71-4623-b4af-96380a352509" }
]
}
}'
az rest --method GET \
--url "https://graph.microsoft.com/v1.0/tenantRelationships/delegatedAdminRelationships/{id}/accessAssignments" \
--headers "Authorization=Bearer ${TOKEN}"
--action create|list|renew|terminate|assign: Skip action selection--customer-tenant-id <id>: Pre-populate customer tenant for create/assign actionsFiles this command reads when invoked
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub thelobbi/claude-m --plugin lighthouse-operations6 commands in this plugin
/azure-lighthouse-delegatelighthouse-operations:azure-lighthouse-delegateGenerate ARM/Bicep templates for Azure Lighthouse delegation, configure authorization tiers (permanent + JIT eligible), deploy to customer subscriptions or resource groups, verify delegation, and optionally set up cross-tenant Azure Policy assignments./baseline-deploylighthouse-operations:baseline-deployScan M365 Lighthouse management template compliance across all managed tenants, identify non-compliant tenants, generate remediation plans with GDAP role requirements, and apply supported management actions via the Lighthouse API./lighthouse-alertslighthouse-operations:lighthouse-alertsManage M365 Lighthouse alerts across all managed tenants — list and triage active alerts by severity, acknowledge or dismiss alerts, generate remediation actions for risky users and malware, and configure alert notification rules./lighthouse-reportlighthouse-operations:lighthouse-reportGenerate a comprehensive cross-tenant status report across all M365 Lighthouse managed tenants — MFA coverage, device compliance, risky users, GDAP expiry, baseline deployment, and Azure delegation health — formatted for MSP customer reviews or internal QBRs./lighthouse-setuplighthouse-operations:lighthouse-setupConfigure partner tenant app registration for M365 Lighthouse access, verify GDAP connectivity, test Lighthouse API endpoints, and generate a readiness report showing which managed tenants are onboarded and accessible.Other plugins' commands for the same job