trevorpalmer Posted February 2, 2007 Report Share Posted February 2, 2007 I am using PowerGadgets Out-Chart to monitor all the Exchange 2007 Queues in our Environment. My PowerShell script get-exchangeserver | where-object {$_.IsHubTransportServer -eq $True} | get-queue | ft Identity, MessageCount Produces the following output Identity MessageCount-------- ------------GIMLDNEXH01\1466 0GIMLDNEXH01\1467 0GIMLDNEXH01\Submission 0GIMLDNEXH02\Submission 0GIMLDNEXHUB01\1520 0GIMLDNEXHUB01\1521 0GIMLDNEXHUB01\Submission 0 But when I pipe this to Out-Chart my X Axis is just numbered as 1 2 3 4 5 6 7 instead of the actual Queue names shown in the Identity column. Is this a known limitation, a bug, or have I done something wrong? Many thanks. Link to comment Share on other sites More sharing options...
JuanC Posted February 2, 2007 Report Share Posted February 2, 2007 Please note that by using format-table as the last element in your pipe, you are transforming the output into a table and although on the console it looks like the right data, properties are buried deep into the output, e.g. In a folder with a couple of CSV files type the following command dir *.csv | get-member You will see many properties and methods supported by the System.IO.FileInfo object, this means that potentially any of the numerical properties could be charted and any string properties could be used as labels. Now type the following dir *.csv | ft Length,Name | get-member Now instead of the 2 properties you will see a bunch of Internal objects like FormatStartData, GroupStartData, etc. none of these objects will show Length or Name as properties. You have 2 options to get the chart you want 1) Use select-object (select) instead of format-table (ft) get-exchangeserver | where-object {$_.IsHubTransportServer -eq $True} | get-queue | select {$_.Identity.ToString()}, MessageCount | out-chart[edit]Note that because Identity is a complex object you want to use ToString() in the select cmdlet This cmdlet selects a subset of properties so that in the console the output looks similar to that of format-table but under the covers this cmdlet is doing a very different job. It is creating a new object that supports only the properties you selected, You can confirm this by typing dir *.csv | select Length,Name | get-member 2) use -values and -label in out-chart to specify the columns you want to use get-exchangeserver | where-object {$_.IsHubTransportServer -eq $True} | get-queue | out-chart -values MessageCount -label {$_.Identity}[edit]Note that because Identity is a complex object you want to use a scriptblock in the label parameter. You can also use Identity.ToString as in option 1. Regards, JuanC Link to comment Share on other sites More sharing options...
trevorpalmer Posted February 5, 2007 Author Report Share Posted February 5, 2007 Hi Juan Thanks for your reply, but I am still having trouble with this out-chart. I am having to create these charts in PowerGadgets Creator. as when I use out-chart with these exchange cmdlets nothing happens. If I issue a get-process | out-chart it does display the chart correctly. If I use your first option, again it looks ok in the powershell, but I still do not get the queue names in my chart, it continues to display the 1 2 3 4 5 6 7 etc instead of the names. [PS] C:\Shellscripts>get-exchangeserver | where-object {$_.IsHubTransportServer-eq $True} | get-queue | select {$_.Identity.ToString()}, MessageCount $_.Identity.ToString() MessageCount---------------------- ------------GIMLDNEXH01\2092 0GIMLDNEXH01\2093 0GIMLDNEXH01\Submission 0GIMLDNEXH02\Submission 0GIMLDNEXHUB01\1899 0GIMLDNEXHUB01\1902 0GIMLDNEXHUB01\1903 0GIMLDNEXHUB01\1904 0GIMLDNEXHUB01\Submission 0GIMLDNEXHUB02\Submission 0 In the creator, I select the Auto-Format option and my queue names display correctly until the auto-refresh runs and then they go back to being numbers. I can't use your second option because the out-chart doesn't display at all. Regards Trevor Link to comment Share on other sites More sharing options...
marco.shaw Posted February 5, 2007 Report Share Posted February 5, 2007 What is the exact out-chart command you are using? As JuanC indicates, you have to call it something like "out-chart -values MessageCount -label {$_.Identity}" to get it to properly display like I think you want it. [Edit: I clearly missed that the Creator was being used, and out-chart wasn't being called directly from the PowerShell command-line.] Link to comment Share on other sites More sharing options...
trevorpalmer Posted February 5, 2007 Author Report Share Posted February 5, 2007 At the moment I can't use the out-chart commands for Exchange as the chart never appears (if I run a non Exchange cmdlet with the out-chart it is fine. eg get-process | out-chart) So I have been building my charts with the PowerGadgets Creator, so I can only use the cmdlet without the out-chart bit as the Creator won't run when using the out-chart as it is doing that bit automatically. In PG Creator I have the cmdlet line get-exchangeserver | where-object {$_.IsHubTransportServer -eq $True} | get-queue | select {$_.Identity.ToString()}, MessageCount When you click the test button it produces the result $_.Identity.ToString() MessageCount---------------------- ------------GIMLDNEXH01\2134 0GIMLDNEXH01\2135 0GIMLDNEXH01\Submission 0GIMLDNEXH02\Submission 0GIMLDNEXHUB01\1990 0GIMLDNEXHUB01\2000 0GIMLDNEXHUB01\2001 0GIMLDNEXHUB01\Submission 0GIMLDNEXHUB02\Submission 0 But when I click the Finish button the actual chart instead of showing the Identity of the Queues (shown by the test button) it shows 1 2 3 4 5 6 7 8 9 Regards Link to comment Share on other sites More sharing options...
trevorpalmer Posted February 5, 2007 Author Report Share Posted February 5, 2007 It must be a fault in the licenced version we have, as I have downloaded the Trial version again, and it is displaying everything corrrectly. Link to comment Share on other sites More sharing options...
JuanC Posted February 5, 2007 Report Share Posted February 5, 2007 The licensed version you are using is probably out of date. You can check the version of the installer by right clicking on the installer exe and check the FileVersion. Note that our most recent trial is build 2588. JuanC Link to comment Share on other sites More sharing options...
IGSFX Posted February 5, 2007 Report Share Posted February 5, 2007 The latest licensed version available is also 1.0.2588. If you have an older version you may want to re-download the latest version from the URL indicated in the email you received with your purchase. Please make sure you uninstall your previous version before installing the latest build. IvanG Link to comment Share on other sites More sharing options...
trevorpalmer Posted February 6, 2007 Author Report Share Posted February 6, 2007 I have downloaded the new version and it is now working properly thanks. Can you email your licenced users when a new version is available, so that we know to download it, or at least have what the latest version number is on your homepage. Thanks for all your help. PowerGadgets Rocks!! TestGraphLocalization.zip Link to comment Share on other sites More sharing options...
marco.shaw Posted February 6, 2007 Report Share Posted February 6, 2007 What I'm thinking is creating an HTTP get in my PowerShell profile that can get the current version and send me a popup when it appears a new version is out. I'll share the code in the tips forum... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.