Aug 21 2020 10:51 AM
Can someone please provide the PowerShell script to run the report of all the AAD licensed users along the last login time stamp?
Oct 12 2020 08:12 AM
@Chirannjevi You can try something like below, or you can use the reports from your O365 admin center.....O365 admin center -> Reports -> Usage -> Active users.
$LiveCred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
Set-ExecutionPolicy RemoteSigned
Import-PSSession $Session
(Get-Mailbox) | Foreach {Get-MailboxStatistics $_.Identity | Select DisplayName, LastLogonTime} | Export-CSV $Home\Desktop\LastLogonDate.csv
Remove-PSSession $Session
Link to article below
Last log in time and date PowerShell script for Office 365 to desktop csv file