Skip to content

Commit

Permalink
Update Microsoft Exchange Online.ps1
Browse files Browse the repository at this point in the history
Switch from using Identity in data reads (Permissions and AutoReply) to GUID.
Mailbox Identity field can match a different mailbox due to the free form nature of the Identity property.  GUID ensures it is unique.
  • Loading branch information
T4E-JAnderson committed Dec 9, 2024
1 parent 2e11af3 commit e5c539e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Microsoft Exchange Online.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,7 @@ function Idm-MailboxesRead {
# Push mailbox GUIDs into a global collection
$Global:Mailboxes.Clear()
foreach($mb in $mailboxes) {
[void]$Global:Mailboxes.Add( @{ Identity = $mb.$key } )
[void]$Global:Mailboxes.Add( @{ Identity = $mb.$key; GUID = $mb.GUID } )
}
}
catch {
Expand Down Expand Up @@ -1558,7 +1558,7 @@ function Idm-MailboxAutoReplyConfigurationsRead {

LogIO info "Get-MsExchangeMailboxAutoReplyConfiguration" -In @call_params

$data = $Global:Mailboxes.Identity.GUID | Get-MsExchangeMailboxAutoReplyConfiguration @call_params
$data = $Global:Mailboxes.GUID.GUID | Get-MsExchangeMailboxAutoReplyConfiguration @call_params

$data | Select-Object $properties

Expand Down Expand Up @@ -1700,8 +1700,8 @@ function Idm-MailboxPermissionsRead {
# v Cloud

LogIO info "Get-EXOMailboxPermission" -In @call_params
$data = $Global:Mailboxes.Identity | Get-EXOMailboxPermission @call_params

$data = $Global:Mailboxes.GUID.GUID | Get-EXOMailboxPermission @call_params
$data | Select-Object $Properties
}
catch {
Expand Down

0 comments on commit e5c539e

Please sign in to comment.