PARENT_TENANT
Summary
Description
Identification
Import-Module Microsoft.Graph.Users
Import-Module Microsoft.Graph.Groups
Import-Module Microsoft.Graph.Applications
Connect-MgGraph -Scopes "User.Read.All", "Group.Read.All", "Application.Read.All"
$tenantId = (Get-MgContext).TenantId
# Get all users and their parent tenant
Get-MgUser -All | Select-Object DisplayName, Id, @{N='ParentTenantId';E={$tenantId}} | Format-Table -AutoSize
# Get all groups and their parent tenant
Get-MgGroup -All | Select-Object DisplayName, Id, @{N='ParentTenantId';E={$tenantId}} | Format-Table -AutoSize
# Get all applications and their parent tenant
Get-MgApplication -All | Select-Object DisplayName, Id, @{N='ParentTenantId';E={$tenantId}} | Format-Table -AutoSize
# Get all service principals and their parent tenant
Get-MgServicePrincipal -All | Select-Object DisplayName, Id, @{N='ParentTenantId';E={$tenantId}} | Format-Table -AutoSizeExploitation
Mitigation
Detection
References
Last updated
Was this helpful?