Haven't got a script, but this PS command will tell you what user is in what database if that's any help?
Get-Mailbox | ft name,Database -AutoSize
Haven't got a script, but this PS command will tell you what user is in what database if that's any help?
Get-Mailbox | ft name,Database -AutoSize