Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# Get all mailboxes, but not from specific database

Posted on 2013-06-25
Medium Priority
291 Views
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'}

But without any success.

Can anyone help me here?
0
Question by:Kasper Katzmann
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 2

LVL 23

Expert Comment

ID: 39276120
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

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

0

Accepted Solution

Kasper Katzmann earned 0 total points
ID: 39276315
I've found the solution by juggling a little bit around:
Get-Mailbox | 
Where-Object {
($_.Database -ne 'C') -AND  ($_.Database -ne 'F')}
`
0

Author Closing Comment

ID: 39287925
It solves the problem and answers the question
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will help to fix the below errors for MS Exchange Server 2013 I. Certificate error "name on the security certificate is invalid or does not match the name of the site" II. Out of Office not working III. Make Internal URLs and Externa…
Know the reasons and solutions to move/import EDB to New Exchange Server. Also, find out how to recover an Exchange .edb file and to restore the file back.
In this video we show how to create a Contact in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Contact ta…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
###### Suggested Courses
Course of the Month8 days, 9 hours left to enroll