-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSnakeApplications.ps1
More file actions
38 lines (31 loc) · 1.16 KB
/
SnakeApplications.ps1
File metadata and controls
38 lines (31 loc) · 1.16 KB
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
# Get all Azure applications
$allApplications = Get-AzureADApplication
# Initialize an empty array to store application details
$applicationDetails = @()
# Iterate through each application
foreach ($app in $allApplications) {
$appId = $app.ApplicationId
$appDetails = Get-AzureADApplication -ObjectId $appId
# Extract relevant details
$displayName = $appDetails.DisplayName
$appIdUri = $appDetails.IdentifierUris -join ', '
$replyUrls = $appDetails.ReplyUrls -join ', '
# Create a custom object with the extracted details
$appInfo = [PSCustomObject]@{
ApplicationName = $displayName
ApplicationId = $appId
AppIdUri = $appIdUri
ReplyUrls = $replyUrls
}
# Add the custom object to the array
$applicationDetails += $appInfo
}
# Display the application details as a table
$applicationDetails | Format-Table -AutoSize
$downloadCsv = Read-Host "Do you want to download the output as a CSV file? (Y/N)"
if ($downloadCsv -eq "Y") {
$applicationDetails | Export-Csv -Path "applications.csv" -NoTypeInformation
Write-Host "Output saved to applications.csv"
} else {
Write-Host "CSV file not saved."
}