Forum Discussion
JohnBromilow
Sep 11, 2023Copper Contributor
Help with Group-Object not working as expected
I am trying to count the number of messages stuck in quarantine for specified recipients. I can return the data fine but when I try to group it using Group-Object it returns a strange answer. Her...
JohnBromilow
Sep 11, 2023Copper Contributor
I have done some more investigation and have read that the Format-Table command can cause problems. I have modified the code as follows (removed the Format-Table command):
$messages = Get-QuarantineMessage -RecipientAddress $recipients
$messages | ft -Property RecipientAddress
$messages | Group-Object -Property RecipientAddress | Format-Table -Wrapand the output is now
Which is still wrong but seems to be getting closer