Solved

Help with Exchange Powershell

Posted on 2011-03-04
5
296 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
Comment Utility
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
Comment Utility
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
Comment Utility
#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
Comment Utility
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 500 total points
Comment Utility
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

Want to promote your upcoming event?

Attending an event? Speaking at a conference? Or exhibiting at a tradeshow? Easily inform your contacts by using a promotional banner in your email signature. This will ensure your organization’s most important contacts are in the know.

Join & Write a Comment

ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
how to add IIS SMTP to handle application/Scanner relays into office 365.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now