question

RaymondTan-2701 avatar image
0 Votes"
RaymondTan-2701 asked RaymondTan-2701 commented

Powershell Cmd to extract all mailbox, all M365 license and all date of last access of mailbox

Hi All,

Good day. Appreciate if any kind soul can help to extract the below,

  1. all mailbox

  2. all M365 license

  3. all date of last access of mailbox

Thanks



windows-server-powershell
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered RaymondTan-2701 commented

Hello,

Thanks for reaching out,

Get-MsolUser -All | Where-Object {($_.licenses).AccountSkuId -match "ENTERPRISEPREMIUM"} | ft
--To list all users using (consuming) a specific licensing plan, use the following command:


Get-Mailbox -ResultSize unlimited | Format-Table DisplayName,
--To get all Mailboxes

Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Select-Object DisplayName,LastLogonTime
--To bet all mailboxes lastaccess or last logon time

Hope this helps.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi !

Thanks for the reply! May i know the command to connect to my tenant via powershell for the 3 cmdlet.

I am using exchange online and M365.

Cheers

0 Votes 0 ·