Forum Discussion
Chirannjevi
Aug 21, 2020Copper Contributor
AzureAD users last login time stamp report
Can someone please provide the PowerShell script to run the report of all the AAD licensed users along the last login time stamp?
1 Reply
Sort By
- MwoehrleBrass Contributor
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 belowLast log in time and date PowerShell script for Office 365 to desktop csv file