Forum Discussion
Export Enterprise apps and signin count
I need to export all the configured enterprise apps and login count for each. This script does the job, but it truncates the application name (see example screen shot) and I can't figure out how to export the results to csv. Can anyone help?
#To enable verbose
[CmdletBinding()]
Param()
#Retrieve list of applications
$Apps = Get-AzureADApplication
#Loop through each application
ForEach($App in $Apps){
Write-Verbose "Processing $($App.DisplayName)"
#Retrieve logs filtered on AppID
$Log = Get-AzureADAuditSignInLogs -All $true -filter "appid eq '$($App.AppID)'"
#Create a custom object for output
[PSCustomObject]@{
ApplicationName = $App.DisplayName
ApplicationID = $App.AppID
SignIns = $Log.count
}
#To prevent throttling on Sign-in Log querying, insert a sleep
Start-Sleep 1
}
- There's a built-in report you can use for that. You can find it under the Entra portal > Enterprise apps > Usage & Insights > Microsoft Entra application activity.
Or directly via this link: https://portal.azure.com/#view/Microsoft_AAD_IAM/EnterpriseApplicationsInsightsMenuBlade/~/ApplicationActivity- lfk73Brass Contributor
VasilMichev thanks didn't know about that. Not sure if there is anything that can be done by both these methods only retrieve data for last 30 days.
Any idea how to get a longer period?
- 30 days is the retention period for the sign-in logs, which is what said reports are built on. If you want to cover larger timeframes, you'll have to export them to external system.