Exchange Online

Master document for managing all things in the Exchange Admin Center and Exchange Online Management via powershell. FYI, windows is case insensitive, meaning you dont need to capitlize anything. Except when calling groups with capitlized names.

Table of Contents

Exchange Admin Center

Powershell Commands

Connecting to Exchange Online Management in Powershell

set-executionpolicy unrestricted -scope processs
import-module exchangeonlinemanagement
connect-exchangeonline

Dynamic Distribution Groups

  1. Store dynamic distribution group as a variable to make it easier to call later on. Some commands also require the group to be stored as a variable to run.

    $groupname = get-dynamicdistributiongroup "group_name_here"
  2. Example of creating a filter and storing as a variable.

    $filter = '(Company -eq "Xenter, Inc.") -and (ExchangeUserAccountControl -ne "AccountDisabled") -and (StateOrProvince -eq "CA")'
  3. Apply a filter to a dynamic distribution group

    set-dynamicdistributiongroup -identity $groupname -recipientfilter $filter
  4. Check if a recipient filter has been properly applied to a dynamic distribution group

    get-dynamicdistributiongroup -identity $groupname | format-List Name,RecipientFilter
  5. Preview members in a dynamic distribution group using the currently set filter.

    get-recipient -recipientpreviewfilter $groupname.RecipientFilter | select Alias
  6. Force membership refresh of a dynamic distribution group. You only get a couple forced refreshes in a 24 hour period.

    set-dynamicdistributiongroup -identity $groupname -forcemembershiprefresh
  7. Check the SMTP emails in a dynamic distribution group

    Get-Recipient -RecipientPreviewFilter ($groupname.RecipientFilter) -OrganizationalUnit ($groupname.RecipientContainer) | ForEach {$_ | select PrimarySmtpAddress}
  8. Check users in a dynamic distribution group

    Get-DynamicDistributionGroupMember -Identity $groupname | select Alias,Company

Set Calendar Permissions

  1. Add a user to have edit permissions on another users calendar.

    Add-MailboxFolderPermission -Identity "USERS_EMAIL_HERE:\Calendar" -User EDITORS_EMAIL_HERE -AccessRights Editor
  2. Check who has permissions on a users calendars.

    Get-MailboxFolderPermission -Identity "USERS_EMAIL_HERE:\Calendar"
  3. Remove a user’s permissions from another users calendar.

    Remove-MailboxFolderPermission -Identity "USERS_EMAIL_HERE:\Calendar" -User EDITORS_EMAIL_HERE