Skip to content

Instantly share code, notes, and snippets.

@bill-long
Created February 28, 2025 19:52
Show Gist options
  • Save bill-long/52a0bfdda49f5690ff46e41b2e820202 to your computer and use it in GitHub Desktop.
Save bill-long/52a0bfdda49f5690ff46e41b2e820202 to your computer and use it in GitHub Desktop.
# Get-NamedProperties
#
# Example:
# .\Get-NamedProperties.ps1 -Mailbox user1 | ft Prop*
[CmdletBinding()]
param (
[Parameter()]
[string]
$Mailbox
)
$mb = Get-Mailbox $Mailbox
. $exscripts\ManagedStoreDiagnosticFunctions.ps1
$mbTableResult = Get-StoreQuery -Database "$($mb.Database.ToString())" -Query "SELECT MailboxNumber FROM Mailbox WHERE MailboxGuid = '$($mb.ExchangeGuid.ToString())'"
Write-Host "Found mailbox $($mb.DisplayName) with mailbox number $($mbTableResult.MailboxNumber)."
$mailboxNumber = $mbTableResult.MailboxNumber
Get-StoreQuery -Database "$($mb.Database.ToString())" -Query "SELECT * FROM ExtendedPropertyNameMapping WHERE MailboxNumber = $mailboxNumber"
@bill-long
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment