Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
1 contributor

Users who have contributed to this file

57 lines (53 sloc) 1.98 KB
######## Extracting List of AppProxy applictions via PowerShell ###############
### Start of Function to check the Logins###
Function Login-check
{
try
{
$Az = Get-AzureADDomain -ErrorAction Stop
}
catch
{
$Fault = $PSItem.message.exception
}
if ($Az)
{
Write-Host -ForegroundColor Cyan "User logged into Azure"
}
else
{
Write-Host -ForegroundColor red "Login Required"
Connect-AzureAD
}
}
### Start of core Script###
Login-check
$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 inforamtion" -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 ###
$SavingDirectory = "C:\Temp\"
If ((Test-Path -Path $SavingDirectory) -eq $false) {New-Item -ItemType Directory -Path $SavingDirectory | Out-Null}
$Filepath = $SavingDirectory + "App-proxy Application list Master Copy" + " " + (Get-Date -Format "dd/MM/yyyy_HH.mm.ss") + ".csv"
$Appproxy_List | Export-Csv -Path $Filepath -NoTypeInformation
##### End of Script##########################################################################
You can’t perform that action at this time.