Which connector group publishes and Azure Application Proxy app?

I had the issue that I need Enterprise Applications to be published via another Connector Group. Azure doesn’t only not show a reliable value of how many app are using a specific Connector Group, but also doesn’t show which those are. So I wrote this little script to take care of it:


$AppConnectorAssignment = @()

Get-AzureADApplication -All $true | % {
	try {
		$ConnectorGroup = (Get-AzureADApplicationProxyApplicationConnectorGroup -ObjectId $_.ObjectID).Name
		$Line = "" | Select AppName,ConnectorGroup
		$Line.AppName = $_.DisplayName
		$Line.ConnectorGroup = $ConnectorGroup
		$AppConnectorAssignment += $Line