PowerShell 스크립트 예제는 와일드카드 게시를 사용하는 모든 Microsoft Entra 애플리케이션 프록시 애플리케이션을 나열합니다.
Azure 구독없는 경우 시작하기 전에 Azure 체험 계정 만듭니다.
메모
Azure Az PowerShell 모듈을 사용하여 Azure와 상호 작용하는 것이 좋습니다. 시작하려면 Azure PowerShell 설치를 참조하세요. Az PowerShell 모듈로 마이그레이션하는 방법을 알아보려면 azureRM에서 Az Azure PowerShell 마이그레이션참조하세요.
샘플에는 microsoft Graph Beta PowerShell 모듈 2.10 이상의 필요합니다.
샘플 스크립트
# This sample script gets all Microsoft Entra application proxy application wildcard published apps.
#
# Version 1.0
#
# This script requires PowerShell 5.1 (x64) and one of the following modules:
#
# Microsoft.Graph ver 2.10 or newer
#
# Before you begin:
#
# Required Microsoft Entra role at least Application Administrator or Application Developer
# or appropriate custom permissions as documented https://learn.microsoft.com/azure/active-directory/roles/custom-enterprise-app-permissions
#
#
Import-Module Microsoft.Graph.Beta.Applications
Connect-MgGraph -Scope Directory.Read.All -NoWelcome
Write-Host "Reading service principals. This operation might take longer..." -BackgroundColor "Black" -ForegroundColor "Green"
$allApps = Get-MgBetaServicePrincipal -Top 100000 | where-object {$_.Tags -Contains "WindowsAzureActiveDirectoryOnPremApp"}
$numberofAadapApps = 0
Write-Host "Displaying wildcard Microsoft Entra application proxy applications..." -BackgroundColor "Black" -ForegroundColor "Green"
Write-Host " "
foreach ($item in $allApps) {
$aadapApp = $null
$aadapAppId = Get-MgBetaApplication -Top 100000 | where-object {$_.AppId -eq $item.AppId}
$aadapApp = Get-MgBetaApplication -ApplicationId $aadapAppId.Id -ErrorAction SilentlyContinue -select OnPremisesPublishing | select OnPremisesPublishing -expand OnPremisesPublishing
if (($aadapApp -ne $null) -and ($aadapApp.ExternalUrl -match "\*.")) {
Write-Host $item.DisplayName"(AppId: " $item.AppId ", ObjId:" $item.Id")"
Write-Host
Write-Host "External Url: " $aadapApp.ExternalUrl
Write-Host "Internal Url: " $aadapApp.InternalUrl
Write-Host
$numberofAadapApps = $numberofAadapApps + 1
}
}
Write-Host
Write-Host "Number of the Microsoft Entra application proxy applications: " $numberofAadapApps
Write-Host
Write-Host "Finished." -BackgroundColor "Black" -ForegroundColor "Green"
Write-Host "To disconnect from Microsoft Graph, please use the Disconnect-MgGraph cmdlet."
스크립트 설명
명령 | 노트 |
---|---|
Connect-MgGraph | Microsoft Graph에 연결 |
get-MgBetaServicePrincipal | 서비스 주체를 가져옵니다. |
Get-MgBetaApplication | 엔터프라이즈 애플리케이션을 가져옵니다. |
다음 단계
- Microsoft Graph PowerShell 개요
- Microsoft Entra 애플리케이션 프록시 PowerShell 예제