如何列出 Entra ID 租户内的所有目录扩展定义?

问题描述 投票:0回答:1

如何列出 Entra ID 租户内的所有目录扩展定义。

Get-MgDirectoryObjectAvailableExtension
仅返回一些源自多租户应用程序的目录扩展定义:

返回所有已注册的目录扩展定义 在目录中,包括通过多租户应用程序。

特别是,不会返回在租户中的应用程序上创建的目录扩展定义。它们由

Get-MgApplicationExtensionProperty -ApplicationId ApplicationId
返回,这需要应用程序 ID。

https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.directoryobjects/get-mgdirectoryobjectavailableextensionproperty?view=graph-powershell-1.0

https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.applications/get-mgapplicationextensionproperty?view=graph-powershell-1.0

azure powershell microsoft-entra-id entra
1个回答
0
投票

要列出 Microsoft Entra ID 租户中的所有目录扩展定义,请使用以下 PowerShell 脚本作为解决方法:

# Retrieve all applications in the tenant
$applications = Get-MgApplication
$allExtensions = @()

# Loop through each application to get its extension properties
foreach ($app in $applications) {
    $extensions = Get-MgApplicationExtensionProperty -ApplicationId $app.Id
    $allExtensions += $extensions
}

# Retrieve available extension properties for directory objects
$directoryExtensions = Get-MgDirectoryObjectAvailableExtensionProperty

# Combine both results
$allExtensions += $directoryExtensions
$allExtensions

enter image description here

  • 没有直接命令来获取目录和所有应用程序扩展属性。
© www.soinside.com 2019 - 2024. All rights reserved.