I have several room's accounts that has correct configuration set as 'LimitedDetails' in AccessRight attibute for 'Default' user, but in other hand there is a several accounts that the configuration is not correct (is set as 'AvailabilityOnly').
I need a list of accounts that has 'AvailabilityOnly' set in Default user and I did this, it works but the result shows different as I expected: "Microsoft.Exchange.Management.StoreTasks.MailboxFolderPermission" instead of "LimitedDetails" or "AvailabilityOnly".
This is my script:
$rooms=Get-Mailbox -ResultSize unlimited | where-object {$_.Recipienttypedetails -like "RoomMailbox"}
$report_file="\\my_machine\rooms_$(Get-Date -Format yyyy_MM_dd-hh_mm_ss).csv"
Add-Content $report_file "SAN;Name;DisplayName;Mail;Permission" -Encoding UTF8
foreach($room in $rooms){
$calendar=Get-CalendarProcessing -Identity $room.Identity | select sAMAccountName,displayName,PrimarySmtpAddress
$id_AD=Get-ADUser -Filter "mail -eq '$($room.UserPrincipalName)'" -Properties *
$room2=$room.Identity
$room2=$room2+"@myemail.com:\Calendar"
$Mailbox=Get-MailboxFolderPermission -Identity $room2 -User Default
Add-Content $report_file "$($id_AD.SamAccountName);$($room.name);$($room.displayName);$($room.PrimarySmtpAddress);$($Mailbox)" -Encoding UTF8
}
In fact, I need list of this from list of rooms in txt or csv file:
What I get with this script:
What I need: