Mailbox : WhenCreated vs WhenMailboxCreated

You should have noticed the two attributes WhenCreated and WhenWhenMailbox while fetching the information through powershell using the cmdlet Get-Mailbox. The WhenMailboxCreated attribute shows the time when the mailbox was created or license assigned (in office 365). On the other side, the WhenCreated attribute gives time when the mailbox associated AD user or Azure AD user was actually created. So, the value of these two attributes may or may not equal.

WhenMailboxCreated : Gives the time when the mailbox was created.

WhenCreated : The time of when the AD user or Azure AD user of the associated mailbox was created.

So, if you want to get the list of mailboxes that are created in last 7 days. You need to use following powershell command.

Get-Mailbox | Where-Object {$_.WhenMailboxCreated –ge ((Get-Date).Adddays(-7))}

You may get incorrect results when you use whencreated to get mailboxes that are created in past N days. But, you can use below command to get actual AD users who are created in last 7 days.

Get-Mailbox | Where-Object {$_.WhenCreated –ge ((Get-Date).Adddays(-7))}
Advertisement

2 thoughts on “Mailbox : WhenCreated vs WhenMailboxCreated”

  1. Very informative article!

    Just wondering how we can get the users of a UserMailbox. Also which role they are assigned with. And in case if we want to update the role of the user (for example: Promote a user’s role to Administrator), do we have any powershell command let available for that? And any PowerShell command let to get the list of appointments created in the bookings mailbox?

    To fetch the mailboxes I am using below command:

    $mailBoxes = Get-ExoMailbox -RecipientTypeDetails “SchedulingMailbox” -ResultSize Unlimited

    Pardon me If I have asked too much here. I did lot of research but did not find any relevant article which gives the needed information.

    Reply

Leave a Comment