Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources: Active Threads
Viewing all articles
Browse latest Browse all 8411

Reverse lookup on archive mailbox

$
0
0

Hi All, hope you're well.

Wondering if anyone knows how to do a reverse look up on a an archive mailbox.

So if you do a 

Get-Mailboxstatistics-Database DatabaseName

on a mailbox database that has Exchange 2010 Archives in it, you get the stats of each mailbox in that database. I'm trying to find a way in PowerShell to look up the mailbox that is associated with that Archive.

At the moment I'm doing some string manipulation to do it.

So a mailbox called 'Mouse, Mikey (UK - London)' would have an archive called 'Personal Archive - Mouse, Mikey (UK - London)'

So to get the mailbox I'm basically putting all the archive mailboxes into a variable called for example $archives and then doing this

$archives | select @{l="DisplayName";e={$_.DisplayName.Trim("Personal Archive - ")}} |
Foreach{get-mailbox-Identity$_.DisplayName}

the problem is that this does depend on the archive name being formatted correctly which isn't always the case in an environment this size.

I've done a

get-mailboxstatistics MailboxName | GM

and

get-mailboxstatistics MailboxName -archive | GM

to compare an archive and mailbox but can't see anything.

Any thoughts?


Viewing all articles
Browse latest Browse all 8411

Trending Articles