This repository was archived by the owner on Dec 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 525
/
Copy pathget-all-default-domain-apps.ps1
41 lines (27 loc) · 1.68 KB
/
get-all-default-domain-apps.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# This sample script gets all Azure AD Application Proxy application "non-custom domain" apps (.msappproxy.net).
#
# This script requires PowerShell 5.1 (x64) and one of the following modules:
# AzureAD 2.0.2.52
# AzureADPreview 2.0.2.53
#
# Before you begin:
# Run Connect-AzureAD to connect to the tenant domain.
# Required Azure AD role: Global Administrator or Application Administrator or Application Developer
Write-Host "Reading service principals. This operation might take longer..." -BackgroundColor "Black" -ForegroundColor "Green"
$aadapServPrinc = Get-AzureADServicePrincipal -Top 100000 | where-object {$_.Tags -Contains "WindowsAzureActiveDirectoryOnPremApp"}
Write-Host "Reading Azure AD applications. This operation might take longer..." -BackgroundColor "Black" -ForegroundColor "Green"
$allApps = Get-AzureADApplication -Top 100000
Write-Host "Reading application. This operation might take longer..." -BackgroundColor "Black" -ForegroundColor "Green"
$aadapApp = $aadapServPrinc | ForEach-Object { $allApps -match $_.AppId}
Write-Host "Displaying all non-custom domain apps (.msappproxy) applications..." -BackgroundColor "Black" -ForegroundColor "Green"
Write-Host " "
foreach ($item in $aadapApp) {
$tempApps = Get-AzureADApplicationProxyApplication -ObjectId $item.ObjectId
If ($tempApps.ExternalUrl -match ".msappproxy.net") {
$aadapServPrinc[$aadapApp.IndexOf($item)].DisplayName + " (AppId: " + $aadapServPrinc[$aadapApp.IndexOf($item)].AppId + ")"
$tempApps | select ExternalUrl,InternalUrl,ExternalAuthenticationType | fl
}
}
Write-Host ("")
Write-Host ("Finished.") -BackgroundColor "Black" -ForegroundColor "Green"
Write-Host ("")