Skip to content

Commit ddcd836

Browse files
committed
Add ExternalDirectoryObjectId to ListMailbox
1 parent 02f7091 commit ddcd836

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Modules/CIPPCore/Public/Entrypoints/Invoke-ListMailboxes.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Function Invoke-ListMailboxes {
2020
# Interact with query parameters or the body of the request.
2121
$TenantFilter = $Request.Query.TenantFilter
2222
try {
23-
$Select = 'id,ExchangeGuid,ArchiveGuid,UserPrincipalName,DisplayName,PrimarySMTPAddress,RecipientType,RecipientTypeDetails,EmailAddresses,WhenSoftDeleted,IsInactiveMailbox,ForwardingSmtpAddress,DeliverToMailboxAndForward,ForwardingAddress'
23+
$Select = 'id,ExchangeGuid,ExternalDirectoryObjectId,ArchiveGuid,UserPrincipalName,DisplayName,PrimarySMTPAddress,RecipientType,RecipientTypeDetails,EmailAddresses,WhenSoftDeleted,IsInactiveMailbox,ForwardingSmtpAddress,DeliverToMailboxAndForward,ForwardingAddress'
2424
$ExoRequest = @{
2525
tenantid = $TenantFilter
2626
cmdlet = 'Get-Mailbox'
@@ -59,7 +59,7 @@ Function Invoke-ListMailboxes {
5959
}
6060

6161
Write-Host ($ExoRequest | ConvertTo-Json)
62-
$GraphRequest = (New-ExoRequest @ExoRequest) | Select-Object id, ExchangeGuid, ArchiveGuid, WhenSoftDeleted, @{ Name = 'UPN'; Expression = { $_.'UserPrincipalName' } },
62+
$GraphRequest = (New-ExoRequest @ExoRequest) | Select-Object id, ExchangeGuid, ExternalDirectoryObjectId, ArchiveGuid, WhenSoftDeleted, @{ Name = 'UPN'; Expression = { $_.'UserPrincipalName' } },
6363

6464
@{ Name = 'displayName'; Expression = { $_.'DisplayName' } },
6565
@{ Name = 'primarySmtpAddress'; Expression = { $_.'PrimarySMTPAddress' } },

0 commit comments

Comments
 (0)