1

I'm trying to find any softdeleted mailbox that may be in the recycle bin, due to the licence removal (office or Exchange).
Initialy I used Get-Mailbox -SoftDeletedMailbox but the results where null


After this disappointing result I did Get-MsolUser -ReturnDeletedUsers to check if I was really connected,and I got 2 results, deleted 2 other users with mailboxs, now I have 1 result.


Now I have 3 questions:
the initial one: how do I find a mailbox of an user that has lost his licence?,
and a new one: why do I have 1 result when I should have at least 2?,
and a bonus: if they where shared mailbox would it be any different?
BR
Vasco

Ezeq
  • 53
  • 1
  • 3
  • 7

2 Answers2

2

Try get-mailbox -InactiveMailboxOnly. Unlicensed mailboxes are not SoftDeletedMailboxes. That only occurs after the user is deleted or the mailbox is deleted.

Shared mailboxes don’t require a license, so it doesn’t apply here.

I’m not sure I understand your second question. If you delete a user from Office 365, the associated mailbox will change to SoftDeleted status and the user will show up in the recycle bin. Try get-msoluser -all -ReturnDeletedUsers instead.

Appleoddity
  • 3,488
  • 2
  • 13
  • 33
-2

mailboxes whose license was removed become immediately unavailable but are not soft-deleted. Those mailboxes are not visible from the Exchange Admin console, nor set as inactive, unless you set retention/litigation. You do this by running

Get-MsolUser -UnlicensedUsersOnly | Where-Object MSExchRecipientTypeDetails -eq 2147483648
Jenny D
  • 27,780
  • 21
  • 75
  • 114
  • 2
    This needs an explanation. Don't just drop cryptic code here without explaining what it is supposed to do and how it would answer the question. – Sven Oct 13 '18 at 00:07
  • mailboxes whose license was removed become unavailable but are not soft-deleted. Those mailboxes are not set as inactive, unless you set retention/litigation. The way I found was to list the recoverable mailboxes whose license was removed is using a particular MSExch attribute indicating that a mailbox exists `Get-MsolUser -UnlicensedUsersOnly | Where-Object MSExchRecipientTypeDetails -eq 2147483648`. The values can be found here: [link](https://answers.microsoft.com/en-us/msoffice/forum/msoffice_o365admin-mso_exchon-mso_o365b/recipient-type-values/7c2620e5-9870-48ba-b5c2-7772c739c651) – Alberto Schiavon Oct 13 '18 at 16:39