I wish to script the procedure to bring the mailbox back from Dumpster. In my normal procedure I do as below
'$Dumpster = Get-MailboxServer | Get-Mailboxstatistics'
'$Dumpster | ? {$_.DisplayName -like "Display Name"} | ft DisplayName, MailboxGUID, ItemCount, TotalItemSize, Database -AutoSize
DisplayName MailboxGuid ItemCount TotalItemSize Database
----------- ----------- --------- ------------- --------
Display Name 437cdd37-d54c-4f96-aae0-8d523707ca41 1 3.891 KB (3,984 bytes) DB53 '
and then create an emailbox just like the deleted one and recover it from dupmster as below
'New-MailboxRestoreRequest -SourceDatabase "DB53" -SourceStoreMailbox "437cdd37-d54c-4f96-aae0-8d523707ca41" -TargetMailbox dname@domain.tld -AllowLegacyDNMismatch'
So the MailboxGUID and Source-mailboxDB I wish to get them into two variables. How can I do it?