Solved

Help with Exchange Powershell

Posted on 2011-03-04
5
297 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 500 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
Find out what you should include to make the best professional email signature for your organization.
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…
To show how to create a transport rule 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 >> Rules tab.:  To cr…

863 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

24 Experts available now in Live!

Get 1:1 Help Now