Forum Discussion
Unused Enterprise applications
Try the below PS:
# Connect to Azure AD
Connect-AzureAD
# Set the number of days to check for stale applications
$staleDays = 30
# Get the list of enterprise applications
$apps = Get-AzureADServicePrincipal -All $true
# Filter out the applications that have had a sign-in within the last $staleDays days
$staleApps = $apps | Where-Object {
(Get-AzureADAuditSignInLogs -ObjectId $_.ObjectId -All $true -Top 1).createdDateTime -lt (Get-Date).AddDays(-$staleDays)
}
# Display the list of stale applications
$staleApps | Select-Object DisplayName, AppId
- lfk73Nov 24, 2024Brass Contributor
Tried it get:
Get-AzureADAuditSignInLogs : The term 'Get-AzureADAuditSignInLogs' is not recognized as the name of a cmdlet, function, script file, or operable program
Googled it, tried everything. Nothing works.