Spotlight on SQL Server - Powershell API

I am highly interested in expansion of the Powershell API to automate administration tasks.  When dealing with hundreds of connections, working through the GUI is not preferable.

 

Here are some new API functions that would save me a lot of time:

  1. Get all connections on a DS (useful since we have federation)
  2. Create View
  3. Add Connections to a View (List would be nice, but for loop is easy enough) 
  4. Get connections from View
  5. Delete connection
  6. Apply an alarm template to a connection (would apply everything in the template)

 

And please add example code in your documentation! 

  • Hi Carl,

    Below please find answers to your questions that I can provide in this post. I would suggest to contact our support team for extensive assistance.

    1.    Get all connections on a DS (useful since we have federation) -

    Answer: Get-Connection returns the Diagnostic Server name in 'DS' field. However, I don't believe DS can be passed as a parameter. You could run Get-Connection individually on each federated Diagnostic Server. Keep in mind the Configuration DS will return all connections. See attached screen capture.
     


    2.    Create View
    And
    3.    Add Connections to a View (List would be nice, but for loop is easy enough)
    Answer: I would look at KB Article 233988 for an export utility to export connections to a CSV file.

    4.    Get connections from View
    Answer: Our current API only handles manual additions passed by parameters. Example: Add-Connection -Address address1,address2,address3. This can be requested as a future product enhancement through our support team.

    5.    Delete connection
    Use Remove-connection command and ensure to add "*" at end of connection name. You'll be prompted before removing the connection.
    Example: Remove-Connection -Name connection1*
    See attached screen capture



    6.    Apply an alarm template to a connection (would apply everything in the template)
    This is possible from Properties window of each connection. I don't see a possibility for our existing API to handle templates, so that would a future product enhancement as well.

    Gita

  • I would add to the wishlist:

    7. Add tags when adding/editing connections 

    (unless the functionality is already there but not documented)

  • HI Serge,

    Adding tags to connections using Powershell command is a future product enhancement. You can find more details about this improvement in KB Article 235656.

  • See Manage and automate Spotlight by PowerShell Command Line Access blog for the latest features of Powershell scripting in Spotlight 13.1.