none
Direct .net call instead of slow Get-ScomClassInstance RRS feed

  • Question

  • Hi all

    Somewhere in internets i saw solution to use .net commands instead of scom powershell cmdlets and it was ~3 times faster

    Maybe someone saw it ? Or any examples ?

    Many hhanks


    none

    Saturday, October 19, 2019 9:09 AM

All replies

  • Hi,

    I would say that the Operations Manager Shell is very fast and efficient, I don't know where you've seen/read anything else.

    Unlike traditional command-line environments that work by returning text results to the end user or routing ("piping") text to different command-line utilities, Windows PowerShell manipulates Microsoft .NET Framework objects directly. This provides a more robust and efficient mechanism for interacting with the system.

    Best regards,
    Leon


    Blog: https://thesystemcenterblog.com LinkedIn:

    Saturday, October 19, 2019 10:26 AM
  • Hi,

     

    Based as I know, The Operations Manager Shell is built on Windows PowerShell. Windows PowerShell is based on the .NET Framework. PowerShell Core, on the other hand, is based on the .NET Core Runtime instead. Many improvements of performance across PowerShell, including in startup time, various built-in cmdlets, and interaction with native binaries are made in PowerShell core. Meanwhile, there are some Performance improvements in .Net Core 3.0. The following article for your reference:

     

    https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-core-3-0/

     

    Hope it can help.

     

    Best regards.

    Crystal


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, October 21, 2019 1:19 AM
  • The get-scomclassinstance cmdlet uses the SDK service at the following method:


    $mg = get-scommanagementgroup

    $mg.EntityObjects.GetObjectReader



    There are limited examples of talking via dotnet methods that are faster, but ultimately the information you are working with comes from / goes to the opsDB.

    Since you're ultimately talking to the database in this example, there won't be any available .net performance improvements beyond what is available through the SDK service (via the $mg variable above).

    Please try and find the article you mentioned, without that I would first check if theres another method signature to use thats more efficient.

    Monday, October 21, 2019 2:22 AM
  • Maybe there are sql command to get instance of class ?

    its about 15 seconds to get Get-ScomClassInstance for some sql objects -very slow


    none

    Wednesday, October 23, 2019 8:10 AM