powershellexchange-serversystem-administration

What is difference between commands Disable-MailUser and Disable-Mailbox in MS Exchange


I can't find any results explaining the difference between these two commands.

My main question is: which command is better to use in modern exchange systems, such as MS Exchange 2019 on-premise?

Reading the MS documentation and searching on Google about this question didn't give me enough information.


Solution

  • There is a significant difference that mail users have no mailboxes in the Exchange organization that is being considered, but may exist in GAL to facilitate messaging. T

    "Mail users (also known as mail-enabled users) have email addresses and accounts in the Exchange organization, but they don't have Exchange mailboxes. Email messages sent to mail users are delivered to the specified external email address."

    Ref: https://learn.microsoft.com/en-us/powershell/module/exchange/new-mailuser?view=exchange-ps

    Disable-Mailbox removes the association between the Active Directory account that the mailbox was connected to and the mailbox. This mailbox can then be attached to another account or purged in x number of days.

    Disable-Mailuser removes mail attributes of an object that is used as mail user. This object may be an external contact having email attributes or Active Directory account without a mailbox in this organization but has an external email address associated with this AD account. Disable-mailuser command removes mail attributes from either of these object types.