Wednesday, September 18, 2013

Powershell - Test all mailboxes in a store

9/18/2013: This is another item I wrote a few years ago to tackle testing of Content Indexing and Exchange Search function, on an Exchange 2007 CCR cluster that was experiencing drive I/O issues, leading to sporadic problems with the update speed and function of the Content Indexing processes:

Test all mailboxes in a store (in this case using the test-exchangesearch cmdlet)

Two variants...

# database is identified using -database parameter 
# and the db's Identity string
get-mailbox -database Server1\Sg1\Db1 |
foreach {
write-host $_.Alias; (test-exchangesearch $_ |
select ResultFound,SearchTime |
ft -auto)
}
 
Typical output:
WalkerTest

ResultFound SearchTime
----------- ----------
False       -1

# Run Test with a one-per-line output reporting just Alias & SearchTime:
get-mailbox -database Server1\SG1\DB1 |
foreach { `
write-host ($_.Alias + " ") -NoNewline ;
(test-exchangesearch $_).SearchTime ;
}
 
Typical output:
WalkerTest 101
TestMailbox 115

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.