Office 365 – List members of Shared Mailboxes

List members of Shared Mailboxes (Microsoft 365)

1. Connect to Office 365 PowerShell, run the PowerShell ISE as Administrator and execute the following command:

Set-ExecutionPolicy RemoteSigned
$Cred = Get-Credential

2. Type your user ID and password in the Windows PowerShell Credential Request and click OK.

3. Create a session using the following command, modifying –ConnectionUri parameter based on your Exchange Online location:

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $Cred -Authentication Basic –AllowRedirection

4. Connect to Exchange Online:

Import-PSSession $Session –DisableNameChecking

5. Copy and run the following script, adjusting the filters for the specific user you want to report on and specifying the desired path for the CSV file output:

Get-Mailbox -RecipientTypeDetails SharedMailbox -ResultSize:Unlimited | Get-MailboxPermission |Select-Object Identity,User,AccessRights | Where-Object {($_.user -like ‘*@*’)}|Export-Csv C:\Temp\sharedfolders.csv  -NoTypeInformation 

6. Review the resulting CSV report:

7. Terminate your session with following cmdlet:

Remove-PSSession$Session

Office 365 – Room Lists

Create Room List Distribution Groups

New-DistributionGroup -Name “Name of Room List” –RoomList creates a new Room List Distribution Group using the cmdlet’s minimum required parameters for a Room List Distribution Group. If you don’t specify any additional parameters, then they will be set for you.

You may want to take control of your recipient object’s attributes by using additional parameters, e.g. –Alias, –DisplayName, –PrimarySmtpAddress, etc. You can find a full list of available parameters at TechNet New-DistributionGroup: Exchange 2010 SP1 Help.

New-DistributionGroup -Name Bldg_HUB -DisplayName “Student Union Building Conf Rooms” –PrimarySmtpAddress Bldg_HUB@contoso.edu –RoomList

Add existing Room Mailboxes to Room List Distribution Groups

Add-DistributionGroupMember –Identity “Name of Room List” –Member “Name of Room Mailbox“adds Room Mailboxes to Room List Distribution Groups. It requires that you specify the Room List Distribution Group using the –Identity parameter and the Room Mailbox to be added using the –Member parameter.

Add-DistributionGroupMember –Identity Bldg_HUB -Member Room_HUB1001 
Add-DistributionGroupMember –Identity Bldg_HUB -Member Room_HUB1002

You can use the DisplayName, Identity, PrimarySmtpAddress and various other values with the –Identity and –Memberparameters. You might find it helpful to list them.

The following command will list the Room List Distribution Groups.

Get-DistributionGroup | Where {$_.RecipientTypeDetails -eq “RoomList”} | Format-Table DisplayName,Identity,PrimarySmtpAddress

The following command will list the existing Room Mailboxes.

Get-Mailbox | Where-Object {$_.RecipientTypeDetails -eq “RoomMailbox”} | Format-Table DisplayName,Identity,PrimarySmtpAddress