I’m trying to extract some information from App Proxy applications in Azure and am using the PowerShell script below. So far it’s working fine to extract the DisplayName, ObjectId, InternalUrl, and ExternalUrl and exporting the results to a CSV file.
### Start of core Script###
$aadapServPrinc = Get-AzureADServicePrincipal -Top 100000 | where-object {$_.Tags -Contains "WindowsAzureActiveDirectoryOnPremApp"}
$App = Get-AzureADApplication -All $true | Select-Object Displayname, ObjectId
$i = 1
$Appproxy_List = @()
$count = $app.count
Foreach ($apps in $app)
{
Write-Progress -Activity "Getting $($apps.DisplayName) App-proxy information" -Status "$i of $count" -PercentComplete ($i/$count*100)
try {
$proxy = Get-AzureADApplicationProxyApplication -ObjectId "$($apps.Objectid)" -ErrorAction Stop
#####The Above cmdlet is used to get list of App-proxy Applications###########
$result = " " | Select-Object DisplayName, ObjectId, InternalUrl, ExternalUrl
$result.DisplayName = $($apps.Displayname)
$result.ObjectId = $($apps.Objectid)
$result.InternalUrl = $($proxy.InternalUrl)
$result.ExternalUrl = $($proxy.ExternalUrl)
$Appproxy_List += $result
} #End of Try Statement
catch {
$Problem = $PSItem.exception.message
} #End of Catch statement
$i++
} #End of Foreach loop
### End of Core ###
### Output ###
$Appproxy_List | export-csv C:UsersuserDesktopAProxyExtract.csv -NoTypeInformation
##### End of Script##############################################
I’d like to also extract the Connector Group each app belongs to, app usage e.g. whether there has been any sign-in activity in the last 30 days/month, and the groups/users assigned to the App Proxy.
For example when trying to extract the Connector Group I’ve tried using:
$connector = Get-AzureADApplicationProxyConnectorGroup | Select-Object Id, Name, ConnectorGroupType, IsDefault
and adding the below to Foreach section of the script:
$result.Id = $($connector.Id)
$result.Name = $($connector.Name)
However I don’t get any information in the CSV output file. Not sure what I’m doing incorrectly but any help would be most appreciated from you scripting wizards.
Thanks in advance.
Dark Paladin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.