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.
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.
Get-MailboxDatabase -Server servername
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
ASKER
There was a typo in the command where an additional space was not supposed to be there.
Get-Mailbox -ResultSize unlimited -Database "Database1" -server "exchangeservername"