Combining the two Exchange server PowerShell to grab Meeting room permission ?

Ask your Windows PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
ITEngineer
Posts: 131
Joined: Wed Oct 12, 2011 10:52 am

Combining the two Exchange server PowerShell to grab Meeting room permission ?

Post by ITEngineer » Tue Jul 24, 2018 11:55 pm

Hi People,

How can I combine the below PowerShell script to get the list of permissions that are already configured to the Remote Office365 Meeting room?

Script:

Code: Select all

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic –AllowRedirection
Import-PSSession $Session

Get-RemoteMailbox -ResultSize Unlimited -Filter 'DisplayName -like "*Site 1*"' | % {Get-MailboxCalendarFolder $($_.PrimarySmtpAddress + ":\Calendar")} | Select-Object Identity,User,AccessRights | Sort-Object Identity
returns error, despite when I execute the first section of the script it returns the list of the meeting room?

Script: Get-RemoteMailbox -ResultSize Unlimited -Filter 'DisplayName -like "*Site 1*"'

Thanks in advance

https://docs.microsoft.com/en-us/powers ... xchange-ps
https://docs.microsoft.com/en-us/powers ... xchange-ps
/* IT Engineer */

User avatar
jvierra
Posts: 13128
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Combining the two Exchange server PowerShell to grab Meeting room permission ?

Post by jvierra » Wed Jul 25, 2018 12:26 am

Code: Select all

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic –AllowRedirection
Import-PSSession $Session

$mbx = Get-Mailbox -ResultSize Unlimited -Filter 'DisplayName -like "*Site 1*"'
$mbx |
    ForEach-Object{
        Get-MailboxFolderPermission  "$($_.Alias):\Calendar"
    } | 
    Select-Object Identity,User,AccessRights | 
    Sort-Object Identity

Locked