A cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.
Create a scheduled task that connects to Exchange and runs once a day:
$NewMailboxes = Get-Mailbox -ResultSize unlimited -RecipientTypeDetails RoomMailbox |?{$_.WhenMailboxCreated -gt (get-date).AddHours(-24)}
$Report = (
$NewMailboxes.userprincipalname|
Sort-Object UserPrincipalname |
ft -AutoSize |
Out-String
)
$count = ($NewMailboxes).Count
if ($($NewMailboxes | measure).Count -gt 0) {send-mailmessage -to ******@contoso.com -smtpserver **yourMailServer** -subject " $count Room Mailboxe(s) Created in the last hour" -From
******@contoso.com -Body $Report}