PowerShell: Getting ICA and HDX Metrics, monitoring data and policy settings via WMI

10:54 AM
PowerShell: Getting ICA and HDX Metrics, monitoring data and policy settings via WMI -

I recently wrote a blog post (which you can read here), such as XenApp and XenDesktop users can through the following advice in CTX0370 including methods with HDX monitor and WMIC command line.

to determine the HDX display mode as it is possible, you can use WMIC to access this information from the command line and to do so within a PowerShell script WMIC call.

I thought it might be useful to explore the possibilities of using PowerShell on a sample script.

below you can find a script that is used, or modified, by an average of HDX to demonstrate or ICA metrics. The same metrics that are presented by HDX Monitor available and. This could provide the user with the flexibility to use the raw data for a thorough analysis.

was written this script from one of our test developer Praveen Prakash for some internal testing of HDX. What got me thinking, maybe we should expand the HDX metrics to cover other key figures such averaged data. Feedback welcome in the comments section below!

 $ DebugPreference = "Next" $ VerbosePreference = "Continue" function support_hdx_CalculateAverage {param ([Parameter(Mandatory=$false,Position =0)] [string] $ class = 'Citrix_VirtualChannel_Thinwire_Enum', [Parameter(Mandatory=$false,Position =1)] [string] $ parameters = 'Component_fps', [Parameter(Mandatory=$false,Position =2)] [int] $ interval = 2, [Parameter(Mandatory=$false,Position =3)] [int] $ timeout = 30 [Parameter(Mandatory=$false,Position =4)] [string] $ path = "c:  fps txt.") write-verbose "invoking support_hdx_CalculateAverage "try {#finding average value given $ count = [int] ($ timeOut / $ interval); $ ValueSum = 0; for ($ index = 0; $ index -lt $ count; $ index ++) {$ ParamValue = Get-WmiObject namespace root  Citrix  HDX class $ class; $ ValueSum = $ valueSum + [int] ($ ParamValue $ parameters.); $ CurrentFPS = [int] ($ ParamValue $ parameters.); Write-Debug "Current FPS: $ currentFPS" Add-Content $ path "Current FPS: $ currentFPS" sleep $ interval; } $ Avg = $ valueSum / $ count} catch {Write-Verbose "Unable to take an average. Leaving funtion" return 0} Write-Verbose "Leaving support_hdx3dpro_CalculateAverage" Write-Debug "Average $ avg" return $ avg} #Calling function support_hdx_CalculateAverage # Copyright (c) Citrix Systems, Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification are permitted provided that the following conditions # are true: # # 1) disclosure of the source code has the copyright - # - notice, this list of conditions and the following disclaimer , # # 2) passing in binary form must provided with the distribution for the disposal of the above # copyright notice, this list of conditions and the following disclaimer in the # documentation and / or other materials #. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO THE IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE #. IN NO EVENT SHALL THE # Copyright OR ITS EMPLOYEES LIABLE FOR ANY DIRECT, # INDIRECT, SPECIAL, OR CONSEQUENTIAL DAMAGES # (INCLUDING BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # SERVICES, LOSS OF DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # OF ANY CAUSE OR THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY #, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED # ABOUT POSSIBILITY OF SUCH DAMAGE. # 

Disclaimer

The sample code is provided to you AS IS without representations, warranties or conditions of any kind. You can use, modify and apply it to their own to distribute risk. CITRIX DISCLAIMS ALL WARRANTIES OF ANY KIND, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) may include the sample code errors, design flaws or other problems that may cause data loss or damage to property; (B) it may not be possible to make the sample code fully functional; and (c) Citrix may, without notice or liability to you, no longer available to make the current version and / or future versions of the sample code. In no event should the code to support ultra-hazardous activities, including but not limited to use life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS IN BREACH OF CONTRACT OR ANY OTHER LIABILITY FOR DAMAGES RESULTING FROM THE USE OF THE SAMPLE CODE, INCLUDING DIRECT, SPECIAL, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Although the copyright belongs in the code to Citrix, any distribution of the code should have only your own standard of the owner of the rights, and not by Citrix. You agree to indemnify and defend Citrix against any claims arising from the use, modification or distribution of the code created.

Previous
Next Post »
0 Komentar