Link to home
Start Free TrialLog in
Avatar of namido
namido

asked on

Get-Mailbox command from a CAS server

I was using the command below from the Mailbox server fine, but due to inconsistent errors, I need to run this from the CAS server with a higher Service pack level. So from the CAS, how can I modify the command to find the database on the mailbox server?

Get-Mailbox -ResultSize unlimited -Database "Database1" | export-mailbox –ExcludeFolders \Journal, \Calendar, \Contacts, \Notes, \Tasks -ContentKeywords "My company tag phrase" –DeleteContent

I have tried changing: -Database "servername\database1" and other variances of this with no luck. Any help will be much appreciated.
Avatar of BT15
BT15
Flag of United States of America image

does it work if you do:


Get-Mailbox -ResultSize unlimited -Database "Database1" -server "exchangeservername"
Avatar of R--R
Get-MailboxDatabase -Server servername
Avatar of namido
namido

ASKER

I've tried both of those without success already.

Here is what I used:

Get-Mailbox -ResultSize unlimited -Database "Database1" -Server "Server1" | export-mailbox –ExcludeFolders \Journal, \Calendar, \Contacts, \Notes, \Tasks -ContentKeywords "My company tag phrase" –DeleteContent

I also went and tried this with -Server then -Database but returns the same error
ASKER CERTIFIED SOLUTION
Avatar of namido
namido

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
Hi

use below cmd

Get-exchangeserver | Get-Mailbox -ResultSize unlimited -Database "Database1" | export-mailbox –ExcludeFolders \Journal, \Calendar, \Contacts, \Notes, \Tasks -ContentKeywords "My company tag phrase" –DeleteContent
Avatar of namido

ASKER

There was a typo in the command where an additional space was not supposed to be there.