Solved

Get all mailboxes, but not from specific database

Posted on 2013-06-25
3
286 Views
Last Modified: 2013-06-30
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?
0
Comment
Question by:Kasper Katzmann
  • 2
3 Comments
 
LVL 23

Expert Comment

by:Stelian Stan
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

Open in new window

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

Open in new window

0
 

Accepted Solution

by:
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')}

Open in new window

0
 

Author Closing Comment

by:Kasper Katzmann
ID: 39287925
It solves the problem and answers the question
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Local Continuous Replication is a cost effective and quick way of backing up Exchange server data. The following article describes the steps required to configure Local Continuous Replication. Also, the article tells you how to restore from a backup…
Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
In this video we show how to create an Accepted Domain 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 Mail Flow >> Ac…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question