Follow this article to check the Enterprise App expiration date.
As a service, LiveTiles can help you keep track on your App expiration date. By letting us know, we will store the date in our system and notify you 30 days before that date so you have time to have it renewed.
Prerequisites
Before you start, you’ll need the following:
1) SharePoint Online Management Shell will have to be installed on the development computer. Download it here
2) A tenant administrator user for the Office 365 tenant where the App was registered.
3) 'Temp' folder on the C: drive - C:\Temp
Save and executing the script
1) Save below script as 'ListAppPrincipleExpiryInSPO.ps1'
# Connect to SharePoint Online
# Find expiration of Intranet Enterprise app in SharePoint Online.
# Prerequisites before running the script
# Microsoft Online Services Sign-In Assistant is installed on the development computer.
# Microsoft Online Services PowerShell Module (32-bit; 64-bit) is installed on the development computer.
# You need to be a tenant administrator for the Office 365 tenant where the add-in was registered with.
Connect-MsolService
# File containing details of the app expiry status
#$outputFile = (Resolve-Path .\).Path + "\ListOfWizdomApps.csv"
$outputFile = "C:\Temp\ListOfWizdomApps.csv"
# Collect the app principles from the tenancy and output to file
$listOfApps = Get-MsolServicePrincipal -MaxResults 2000000 | Where-Object -FilterScript { ($_.DisplayName -notlike "*Microsoft*") -and ($_.DisplayName -notlike "autohost*") -and ($_.ServicePrincipalNames -notlike "*localhost*") }
# Array of the app details
$appDetails = @()
foreach ($app in $listOfApps) {
$principalId = $app.AppPrincipalId
$principalName = $app.DisplayName
# Collect details about the app
Get-MsolServicePrincipalCredential -AppPrincipalId $principalId -ReturnKeyValues $true | Where-Object { ($_.Type -ne "Other") -and ($_.Type -ne "Asymmetric") } | ForEach-Object {
$date = $_.EndDate.ToShortDateString()
$appDetail = New-Object PSObject
$appDetail | Add-Member -MemberType NoteProperty -Name "EnterpriseAppName" -Value "$($principalName)"
$appDetail | Add-Member -MemberType NoteProperty -Name "ClientID" -Value "$($principalId)"
$appDetail | Add-Member -MemberType NoteProperty -Name "Key" -Value "$($_.KeyId)"
$appDetail | Add-Member -MemberType NoteProperty -Name "Type" -Value "$($_.type)"
$appDetail | Add-Member -MemberType NoteProperty -Name "ExpiryDate" -Value "$($date)"
$appDetail | Add-Member -MemberType NoteProperty -Name "Usage" -Value "$($_.Usage)"
$appDetail | Add-Member -MemberType NoteProperty -Name "Value" -Value "$($_.Value)"
$appDetails += $appDetail
$appDetail
}
}
$appDetails | Export-Csv -Path $outputFile -NoTypeInformation
Write-Host "File created: " $outputFile
2) To execute the script in the file, first navigate to the folder where the 'ListAppPrincipleExpiryInSPO.ps1' script is. Execute the script as follows:
3) Run the script and you will be prompted to login with your tenant administrator account.
4) Once you have logged in, the script will start to run automatically.
Result
When the script has finished, you are now able to see the full output directly in the SharePoint Online Management Shell program or in the file that was generated in the 'Temp' folder.
The output is saved as a CSV file in MS Excel. The output will be written as follows:
NOTE: Date format is written as MM/DD/YYYY.
Looking at this output, you can see that this App is set to expire on January 16th, 2022.
Microsoft Excel tips and tricks
For better overview of the CSV output, we now give you some tips and tricks to see the data.
1) Mark the A column
2) In the ribbon, select the 'Data' section and click the 'Text to Columns'.
3) In Step 1 of 3, make sure that the Delimited type is selected and click 'Next'.
4) In Step 2 of 3, select the Comma delimiter and click 'Finish'
The data now shows correctly in columns (A-F)
5) Mark the columns that contains data and double-click on the vertical column separator line. The data now shows aligned.
6) Click on the A1 cell, go to the 'Data' section in the ribbon and click the 'Filter'.
7) In the B column (ClientID), you can filter on the current ClientID of the App you are searching for. Similar for the D column (Type), you only have to display the Password type.
8) For this App, we can see 3 registrations. The initial one that expired in 2016, the first extended one that expired in 2019 and now the current one that will expire in 2022.
Comments
0 comments
Article is closed for comments.