Exchange remoting output not as expected

This topic contains 2 replies, has 2 voices, and was last updated by  Mark Prior 1 year ago.

  • Author
    Posts
  • #55036

    Mark Prior
    Participant

    Hi guys

    building a exchange checker (basically a one click GUI that will go off and check RPC, Transport queues, active DB mounts, Ping times etc........)

    99% of this is working however when i try to retrieve the transport queues i get the below

    "Snippet of transport section" (EURXMBS08 has a transport role selected)

    
    $Username = "global\mark.prior"
    	$Password = ConvertTo-SecureString "passwordgoeshere" -AsPlainText -Force
    	$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
    	
    	$SESJA_EX = New-PSSession -Credential $cred -ConnectionUri http://eurxmbs08/powershell -ConfigurationName microsoft.exchange
    	Import-PSSession $SESJA_EX -AllowClobber
    
    $servers = Get-ExchangeServer eurxhts* | select name -ExpandProperty name
    foreach ($Server in $Servers)
    {
        Get-Queue | where-OBJECT {$_.messAGECOUNT -GE 0} | select identity, messagecount, nexthopdomain
    }
    
    

    command works fine but the output below is wrong, as you can see from the first query "$servers = Get-ExchangeServer eurxhts* | select name -ExpandProperty name" it should be returning results for any servers that match "eurxhts*" instead it simply checks its own transport queue 3 times (3 HTS servers are returned in $servers EURXHTS01,02 & 03)

    Identity MessageCount
    ——– ————
    EURXMBS08\1548255 0
    EURXMBS08\1548260 1
    EURXMBS08\1548270 0
    EURXMBS08\1548279 0
    EURXMBS08\1548322 0
    EURXMBS08\1548325 5
    EURXMBS08\1548335 2
    EURXMBS08\1548347 0
    EURXMBS08\1548462 0
    EURXMBS08\1548470 0
    EURXMBS08\1548476 0
    EURXMBS08\1548477 0
    EURXMBS08\1548478 0
    EURXMBS08\Submission 0
    EURXMBS08\Shadow\1547710 1
    EURXMBS08\Shadow\1548110 13
    EURXMBS08\Shadow\1548272 1
    EURXMBS08\Shadow\1548369 1
    EURXMBS08\Shadow\1548381 2
    EURXMBS08\Shadow\1548426 1
    EURXMBS08\Shadow\1548457 1
    EURXMBS08\Shadow\1548468 1
    EURXMBS08\Shadow\1548471 0
    EURXMBS08\Shadow\1548472 1
    EURXMBS08\Shadow\1548474 0
    EURXMBS08\Shadow\1548475 1

    Identity MessageCount
    ——– ————
    EURXMBS08\1548255 0
    EURXMBS08\1548260 1
    EURXMBS08\1548270 0
    EURXMBS08\1548279 0
    EURXMBS08\1548322 0
    EURXMBS08\1548325 5
    EURXMBS08\1548335 2
    EURXMBS08\1548347 0
    EURXMBS08\1548462 0
    EURXMBS08\1548470 0
    EURXMBS08\1548476 0
    EURXMBS08\1548477 0
    EURXMBS08\1548478 0
    EURXMBS08\Submission 1
    EURXMBS08\Shadow\1547710 1
    EURXMBS08\Shadow\1548110 13
    EURXMBS08\Shadow\1548272 1
    EURXMBS08\Shadow\1548369 1
    EURXMBS08\Shadow\1548381 2
    EURXMBS08\Shadow\1548426 1
    EURXMBS08\Shadow\1548457 1
    EURXMBS08\Shadow\1548468 1
    EURXMBS08\Shadow\1548471 0
    EURXMBS08\Shadow\1548472 1
    EURXMBS08\Shadow\1548474 0
    EURXMBS08\Shadow\1548475 1

    Identity MessageCount
    ——– ————
    EURXMBS08\1548255 0
    EURXMBS08\1548260 1
    EURXMBS08\1548270 0
    EURXMBS08\1548279 0
    EURXMBS08\1548322 0
    EURXMBS08\1548325 5
    EURXMBS08\1548335 3
    EURXMBS08\1548347 0
    EURXMBS08\1548462 0
    EURXMBS08\1548470 0
    EURXMBS08\1548476 0
    EURXMBS08\1548477 0
    EURXMBS08\1548478 0
    EURXMBS08\Submission 0
    EURXMBS08\Shadow\1547710 1
    EURXMBS08\Shadow\1548110 13
    EURXMBS08\Shadow\1548272 1
    EURXMBS08\Shadow\1548369 1
    EURXMBS08\Shadow\1548381 2
    EURXMBS08\Shadow\1548426 1
    EURXMBS08\Shadow\1548457 1
    EURXMBS08\Shadow\1548468 1
    EURXMBS08\Shadow\1548471 0
    EURXMBS08\Shadow\1548472 1

  • #55063

    Don Jones
    Keymaster

    Look at this piece:

    $servers = Get-ExchangeServer eurxhts* | select name -ExpandProperty name
    foreach ($Server in $Servers)
    {
        Get-Queue | where-OBJECT {$_.messAGECOUNT -GE 0} | select identity, messagecount, nexthopdomain
    }
    

    You're populating $servers, but you're not using that with Get-Queue, right? Get-Queue is just running against the default, which is the local server. I'd expect you to be passing it $server in a parameter of some kind.

  • #55101

    Mark Prior
    Participant

    oh dear i blaming this firmly on it being friday and being in need of a beer,

    Many thanks Don

You must be logged in to reply to this topic.