Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Help with Exchange Powershell

Posted on 2011-03-04
5
Medium Priority
?
316 Views
Last Modified: 2012-05-11
1. In Exchange 2007 environment, we have three regions - emea, apac, ltam.

EMEA Hub Transports servers are along the naming convention of hub-emea1, hub-emea2, hub-emea3 etc.

APAC Hubs are hub-apac1, hub-apac2 and so on.

Sometimes I just want to search on the EMEA or APAC or LTAM Hubs.

Does anyone know how I can run a Powershell along the lines of:

Get-transport server -[EMEA Hub Transport servers only] | Get-messagetrackinglog -sender ....etc etc

2. Sometimes, I'd like to view details of Exchange certificates on other servers, I've tried

Get-Exchangeserver -identity mailboxserver1 | get-exchangecertificate

Does anyone know the correct way?

3. Finally, for, say Exch1-SG1-IS1 database, is there an easy way to find out the count of mailboxes on there?
0
Comment
Question by:kam_uk
  • 3
  • 2
5 Comments
 
LVL 49

Expert Comment

by:Akhater
ID: 35042000
Get-transport | ?{ $_.name -like "*emea*"} | Get-messagetrackinglog -sender ....etc etc


>> 2. Sometimes, I'd like to view details of Exchange certificates on other servers, I've tried

As far as I know this won't work on exchange 2007 you will need exchange 2010 for it

>> 3. Finally, for, say Exch1-SG1-IS1 database, is there an easy way to find out the count of mailboxes on there?

$mbx = get-mailbox -database Exch1-SG1-IS -resultsize unlimited
$mbx.count
0
 
LVL 3

Author Comment

by:kam_uk
ID: 35044294
Thanks Akhater.

Couple of follow up questions..

#1: Get-transport | ?{ $_.name -like "*emea*"} | Get-messagetrackinglog -sender

Excellent, thanks very much for this. I've also seen people use the word "where" when specifying servers such as hub-emea1, hub-emea2 ,etc. Do you know if it's possible in this case or is  ?{ $_.name -like "*emea*"}  the only way?

#3: >> 3. Finally, for, say Exch1-SG1-IS1 database, is there an easy way to find out the count of mailboxes on there?

$mbx = get-mailbox -database Exch1-SG1-IS -resultsize unlimited
$mbx.count

Sorry, I should have mentioned, our EMEA Mailbox servers are also EMEA-Exch1, EMEA-Exch2, etc. Do you know how I would amend you query so I am only returned results for EMEA Mailbox servers?
0
 
LVL 49

Expert Comment

by:Akhater
ID: 35044305
#1

? is nothing by  a shortcut to where

#1: Get-transport | where { $_.name -like "*emea*"} | Get-messagetrackinglog -sender

is exactly the same

#3 I am not sure I understood your question you want the count of all mailboxes on emea-exch1 or emea-exch2 ? that's it ?
0
 
LVL 3

Author Comment

by:kam_uk
ID: 35044318
Hi Akhater

#1 Ah makes sense :) Thanks for clarifying that!

#3: I would like a count of mailboxes on all stores for servers starting with emea-exch* please?
0
 
LVL 49

Accepted Solution

by:
Akhater earned 2000 total points
ID: 35044401
Oki this should do it (sorry from the top of my head i can't test right now but it should be fine)

$servers = get-MailboxServer | ? { $_.name -like "emea-exch*"}
$mbxes = Get-Mailbox -ResultSize unlimited | ? {$servers -contains $_.servername}
$mbxes.count
0

Featured Post

Lessons on Wi-Fi & Recommendations on KRACK

Simplicity and security can be a difficult  balance for any business to tackle. Join us on December 6th for a look at your company's biggest security gap. We will also address the most recent attack, "KRACK" and provide recommendations on how to secure your Wi-Fi network today!

Question has a verified solution.

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

A walk-through example of how to obtain and apply new DID phone numbers to your cloud PBX enabled users that are configured in Office 365. Whether you have 1, 10 or 100+ users in your tenant, it's quite easy to get them phone-enabled and making/rece…
Mailbox Corruption is a nightmare every Exchange DBA wishes he never has. Recovering from it can be super-hectic if not entirely futile. And though techniques like the New-MailboxRepairRequest cmdlet have been designed to help with fixing minor corr…
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…
Loops Section Overview

971 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