Link to home
Start Free TrialLog in
Avatar of Kasper Katzmann
Kasper KatzmannFlag for Denmark

asked on

Get all mailboxes, but not from specific database

I have 7 databases on my Exchange 2010 server. Lets call them A, B, C, D, E, F and G.
I need to get all mailboxes from all databases, except database C and F.

I have tried with
Get-Mailbox -ResultSize Unlimited | Where {MailboxDatabase -ne 'C' OR 'F'}

Open in new window

But without any success.

Can anyone help me here?
Avatar of Stelian Stan
Stelian Stan
Flag of Canada image

You can do one database at the time and exported to a txt or csv file:

Get-MailboxDatabase "IT" | Get-Mailbox | Out-File C:\it.txt

Open in new window

Get-MailboxDatabase "IT" | Get-Mailbox | Export-Cvs C:\it.csv

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Kasper Katzmann
Kasper Katzmann
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Kasper Katzmann

ASKER

It solves the problem and answers the question