Summary
This article describes how to use PowerShell Commandlet to get the list for SMTP address and Last connection time for all the users.
Steps to implement the request
Step 1: Run the following to authenticate yourself and import PowerShell commands to your local session:
$Session = New-PSSession -ConfigurationName Microsoft.Exchange-ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
Import-PSSession $Session
Image may be NSFW.
Clik here to view.
Image 1
Step 2: Run the Commandlet to get the SMTP address and Last connection time for all the users
Commandlet to get SMTP address:
Get-Mailbox | fl EmailAddresses, identity > C:\Emailaddress.csv
Image may be NSFW.
Clik here to view.
Image 2
Image may be NSFW.
Clik here to view.
Image 3
Image may be NSFW.
Clik here to view.
Image 4
Commandlet to get Last connection time:
Get-Mailbox -ResultSize unlimited | Get-MailboxStatistics | select-object identity,lastlogontime,lastlogofftime,DisplayName | sort-object DisplayName -descending | export-csv C:\Lastlogontime.csv
Image may be NSFW.
Clik here to view.
Image 5
Image may be NSFW.
Clik here to view.
Image 6
Image may be NSFW.
Clik here to view.
Image 7
Enjoy Image may be NSFW.
Clik here to view.
Clik here to view.
