Link to home
Start Free TrialLog in
Avatar of kimakabane
kimakabaneFlag for Japan

asked on

[Exchange 2007/2010] How to run "get-transportagent" remotely for multiple 100 servers?

How to run "get-transportagent" remotely for multiple 100 servers?
Looks easy but totally not.
I need to check get-transportagent result for over 100 servers from a management server.
Avatar of Busbar
Busbar
Flag of Egypt image

by default when you run this command it displays a summary list of all transport agents installed on all Exchange servers in your organization.
Avatar of kimakabane

ASKER

busbar,

Thanks but they show different result as hub transport servers in my organization have different agent setup. I need to run it individually on 100 servers.
so your issue in the reporting, have you tried format list
get-transportagent | FL

THis will will return a list and in structured format, am I following correctly ?!
busbar,
No, you're not following my question.

1. I have 100 Hub transport servers
2. I need to see "get-transportagent" result on each individual servers because each server shows different result.

"get-transportagent" doesn't have "-server" option. I tried invoke-command but not worked for exchangeshell.

I don't want to run the command by logging on via RDP to 100 servers.
that is what I am telling you, when you run the command it will return all the agents installed on all the servers in your organization, you don't need to use -server switch
Sorry it returns the config on all servers for Exchange 2013, I mixed stuff, can you verify that it returns all the config from all servers in the org in 2010
ASKER CERTIFIED SOLUTION
Avatar of kimakabane
kimakabane
Flag of Japan image

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 Kim,
I don't have Exchange 2010 in my lab, but as it looks it does return the config per server.

In this case you will need to make a script to loop through your servers, connect remotely and run the command.

create a csv with a header serverfqdn server names and then try:
Import-CSV CreateRecipients.csv | ForEach {
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://$_.serverfqdn/PowerShell/ -Authentication Kerberos
Import-PSSession $Session
get-transportaget | export-csv $_.serverfqdn.csv
}
This will loop through the CSV file, read the server, connect remotely run the powershell and export the output to csv file with the server name, I created this script on the fly so you need to test it, report if any errors (which I believe you will receive).
The command provided was reasonable one.