Working with Exchange accounts

Before we delve into scripting, we would like to review the different Exchange concepts we will be working with. All of these entities have the usual commands to create/update/delete them. As mentioned earlier, an exhaustive review of all the commands is impractical, but we will supply what we hope is a good review of the most common maintenance scenarios:

  • User: An Active Directory account that can access Office 365 services but does not have Exchange access. These users cannot be recipients and are usually not accessible via Outlook.
  • Mailbox: A mailbox is the most important entity within Exchange. In addition to emails, it contains scheduling, calendar, and all the Exchange features for a user account. Mailboxes are provisioned not only to users, but for also for shared, room, and other resources.
  • Mail user: A mail user is an Active Directory account that can log in to the different services offered by Office 365. However, the account does not have a mailbox in the tenant's Exchange. The user can send an email to an external email address.
  • Contact: A contact is available in Outlook and can receive email similarly to mail users. However, the contact does not have a username/password and, therefore, cannot access services. Contacts are usually used as email recipients and can also be included in distribution lists.
  • Group: A group contains a list of members that can be sent emails or given access as a single entity.
  • Distribution list: A distribution list is similar to groups in that it is a collection of recipients, but it cannot be given access to services via security assignments.

When creating new user accounts in Office 365, one of the steps is to create an Exchange mailbox for it. Regardless of whether you take this step or not, a user record will be created in Exchange. This record allows the user to be found by other users even if they do not have a mailbox. If a user is set up with an external email account, they may also receive emails. A user may also be part of a security group even if their mailbox is later removed.

User records are also created for other entities that you may not think of as a user, for example, meeting rooms, shared mailboxes, and equipment will get user accounts so that they can be included in meetings and other features. The user accounts for these entities are disabled (for most types) and cannot be used to log in (they also do not count in licensing equations). Even though Exchange management usually involves working with user mailboxes, it is important to know about users and mail users as they have different properties and you usually have to work with them in maintenance scenarios.

Mailbox users, as the name indicates, are users with an Exchange mailbox that will store their emails. Mail users are users with a valid email but without a local Exchange mailbox (an email account managed outside the tenant's Exchange). A record can change the type depending on the requirements. For example, if you delete a mailbox, its record will be demoted from UserMailbox to user and promoted back to UserMailbox if the mailbox is recreated.

We will begin with a query to show the existing user records. Note that the RecipientType parameter is set to UserMailbox for users with active mailboxes. The Get-User command will return UserMailbox, user, and MailUser records. The Get-Mailbox and Get-MailUser commands can be used to get UserMailbox and MailUser separately:

Get-User | Select Name, RecipientType, RecipientTypeDetails, WindowsEmailAddress | Sort RecipientTypeDetails

Name RecipientType RecipientTypeDetails WindowsEmailAddress
---- ------------- -------------------- -------------------
DiscoverySearchMailbox... UserMailbox DiscoveryMailbox DiscoverySearchMailb...
Printer B UserMailbox EquipmentMailbox [email protected]...
test4 MailUser MailUser [email protected]
Meeting Room A UserMailbox RoomMailbox meetingrooma2@mytest...
Support UserMailbox SharedMailbox [email protected]...
Accounting UserMailbox SharedMailbox accounting@mytest321...
Test123 User User
test2 User User
chelsea UserMailbox UserMailbox [email protected]....
martin UserMailbox UserMailbox [email protected]....
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.235.176