locked
need to get real time queue status via html/url RRS feed

  • Question

  • Hi,

    I am looking to create a script where I can define a url http://servername/queue to get queue details of all Exchange 2010 servers. Every time we access the url we should be able to get real time data of the queue.

    We had this in Exchange 2003 but it was a custom tool by a previous vendor that supported their environment and does not work for the new 2010 servers. Also, the installation files do not show anything.

    Any way of scripting to help achieve this will be highly appreciated. I am aware of scripts that can send an alert in case queues are high but that does not suffice my requirement as I need to provide the data to non technical guys and would prefer a simple route for them so that they can check this any time themselves.

    Wednesday, January 20, 2016 1:42 PM

Answers

  • Exchange's PowerShell commands will pull the data and can output the format as a web page.  I'd build a "wrapper" web page that has the page that PowerShell builds as a frame inside it.  The command you need to pull your queue data is:

    Get-TransportServer H* | Sort Name | Get-Queue | ConvertTo-Html > .\QueuePage.htm

    This writes your data to an HTML-formatted file.  The wrapper file needs only have the frame for the QueuePage.htm, but you can also add a title and a refresh button so someone needn't close the page (or even press the F5 button) to refresh the data.


    Will Martin ...
    -join ('77696c6c406d617274696e2d66616d696c6965732e6f7267' -split '(?<=\G.{2})' | ? { $_ } | % { [char][int]"0x$_" })

    • Marked as answer by Imaam_21 Thursday, February 4, 2016 12:01 PM
    Thursday, January 21, 2016 1:01 PM

All replies

  • In order to get this sort of dynamic updates on a web page, you'll need to update the background data regularly - you can't make it real-time, since that means a continuous connection to the data source, which isn't available in any web scripting I know of.  But with DHTML, you should be able to pull the data regularly from your queues so you can get the appearance of real-time.

    BTW, your statement "Every time we access the url we should be able to get real time data of the queue" implies you are closing the web page each time.  If this is truly the case, no dynamic updates are necessary - you can write a web page that pulls the data once each time you open the web page.  However, I don't believe this is what you wanted.


    Will Martin ...
    -join ('77696c6c406d617274696e2d66616d696c6965732e6f7267' -split '(?<=\G.{2})' | ? { $_ } | % { [char][int]"0x$_" })

    • Proposed as answer by EMMmmmmmm Thursday, January 21, 2016 10:16 AM
    Wednesday, January 20, 2016 5:49 PM
  • Will,

    "you can write a web page that pulls the data once each time you open the web page. "

    This is exactly what I need. But, I am not sure about the script/code part and need assistance. It has been a terrible mistake of not exploring things other than exchange which makes me the noob to ask this.


    • Edited by Imaam_21 Thursday, January 21, 2016 11:36 AM
    Thursday, January 21, 2016 11:35 AM
  • Exchange's PowerShell commands will pull the data and can output the format as a web page.  I'd build a "wrapper" web page that has the page that PowerShell builds as a frame inside it.  The command you need to pull your queue data is:

    Get-TransportServer H* | Sort Name | Get-Queue | ConvertTo-Html > .\QueuePage.htm

    This writes your data to an HTML-formatted file.  The wrapper file needs only have the frame for the QueuePage.htm, but you can also add a title and a refresh button so someone needn't close the page (or even press the F5 button) to refresh the data.


    Will Martin ...
    -join ('77696c6c406d617274696e2d66616d696c6965732e6f7267' -split '(?<=\G.{2})' | ? { $_ } | % { [char][int]"0x$_" })

    • Marked as answer by Imaam_21 Thursday, February 4, 2016 12:01 PM
    Thursday, January 21, 2016 1:01 PM
  • I was on a vacation so have just checked this couple of days back.. I am yet to get the wrapper page right and struggling with that part but I have marked this as an answer because it helps me get the information needed. I just need to find a way to present it correctly and make it more readable so will be trying that over the next few days.

    Thanks Will for your help :)

    Thursday, February 4, 2016 12:03 PM
  • A wrapper page can be as simple as saving the following in a file saved as Wrapper.htm:

    <HTML>
    <HEAD>
    <TITLE>System Summary</TITLE>
    </HEAD>

    <FRAMESET ROWS="15%,*">
       <FRAME SRC="maildata.htm" NAME=TITLE SCROLLING=NO>
    </FRAMESET>
    </DIV>
    </HTML>

    Your PowerShell export file would be named maildata.htm to use this.


    Will Martin ...
    -join ('77696c6c406d617274696e2d66616d696c6965732e6f7267' -split '(?<=\G.{2})' | ? { $_ } | % { [char][int]"0x$_" })

    Thursday, February 4, 2016 2:58 PM