 |
|
|
Script to get transport queues
|
Sort:
|
|
Prev Next |
You are not authorized to post a reply. |
|
Yogesh
 New Member Posts:30

 |
| 24 Jun 2010 05:01 AM |
|
Hello Friends,
I was looking for a script through which I can get all queues from all HUB transport servers:
Here is the script :
$exchangeserversQ=Get-ExchangeServer | where-object {$_.admindisplayversion.major -eq 8 -and $_.IsHubTransportServer -eq $true} foreach ($Tserver in $exchangeserversQ) {
$GetQ=Get-Queue -server $Tserver | Select-object @{Name="Queue";Expression={[String]$_.Identity.type}} , status , Deliverytype | ft Queue,status,@{Expression={$_.Deliverytype};label="type";width=50}
foreach ($Q in $GetQ)
{ $Qtext=@($Q.Queue + "`t" + $Q.status)
}
But when I checked the value of $Qtext it was "blank" hence not the
right result.
But when I ran :
$exchangeserversQ=Get-ExchangeServer | where-object
{$_.admindisplayversion.major -eq 8 -and $_.IsHubTransportServer -eq
$true}
foreach ($Tserver in $exchangeserversQ)
{
$GetQ=Get-Queue -server $Tserver | Select-object
@{Name="Queue";Expression={[String]$_.Identity.type}} , status ,
Deliverytype | ft
Queue,status,@{Expression={$_.Deliverytype};label="type";width=50} }
} I get the correct value for $getq.
Please let me know where i
am wrong in the full script.
|
|
|
|
|
Marco Shaw (MVP)
 Veteran Member Posts:1643

 |
| 24 Jun 2010 05:07 AM |
|
You've massaged all the elments in $GetQ quite a bit. The fact you pass the variable data to Format-Table renders it pretty much useless except to display on screen or write to a file. Sorry, I don't have access to try this out right now. Exchange 2007? |
|
Marco
*Microsoft MVP - Windows PowerShell
https://mvp.support.microsoft.com/profile/Marco.Shaw
*Co-Author - Sams Windows PowerShell Unleashed 2nd Edition
*Blog - http://marcoshaw.blogspot.com |
|
|
Yogesh
 New Member Posts:30

 |
| 24 Jun 2010 05:33 AM |
|
yeah again it is 2007 :) I also have a limitation of only one HUB server, so what do you say , will $getQ give all queues from all HUB server or only from one HUB server ? |
|
|
|
|
Steven
 New Member Posts:5

 |
| 19 Jul 2010 02:46 PM |
|
What are you looking to get exactly? That might help. If you're trying to just get the queue types and status how about this:
$exchangeserversQ=Get-ExchangeServer | where-object {$_.admindisplayversion.major -eq 8 -and $_.IsHubTransportServer -eq $true}
foreach ($Tserver in $exchangeserversQ)
{
$GetQ += Get-Queue -server $Tserver | Select-object @{Name="Queue";Expression={[String]$_.Identity.type}} , status , Deliverytype
}
$GetQ | format-table Queue,status,@{Expression={$_.Deliverytype};label="type";width=50}
|
|
|
|
|
Chris Merritt
 New Member Posts:28

 |
| 21 Feb 2011 05:07 AM |
|
I was looking at something about queues but came across this, seems a bit long winded when you could simply do: Get-TransportServer | Get-Queue |
|
|
|
|
| You are not authorized to post a reply. |
|
Active Forums 4.3
|
|
 |