Transcript
SolarWinds SWIS API Cheat Sheet
by Jan Elias (ernest) via cheatography.com/2243/cs/840/ Query SWIS with PowerShell
SWQL supported constructs
SWQL - NOT SUPPORTED
Add-PSSnapin SwisSnapin
SELECT ... FROM ...
SELECT *
You must list the actual
Get-Credential
WHERE
FROM
properties you want to select.
Connect-Swis -Credential $creds -Hostname
GROUP BY ... HAVING ...
UPDATE,
You can only use SWQL to
localhost
ORDER BY
INSERT,
read data
Get-SwisData $swis 'SELECT nodeID,
INNER JOIN
Caption FROM Orion.Nodes Where
LEFT/RIGHT OUTER JOIN
Vendor=@v' @{v='Cisco'} Invoke-SwisVerb $swis Orion.Nodes Unmanage @("N:1",$now,$later,"false") The Invoke-SwisVerb cmdlet argument lists support XmlElement objects from Orion SDK
SELECT TOP n SELECT DISTINCT
update them to use the InnerText property of
Subqueries in FROM/JOIN
the returned element.
Aggregates SUM, MAX, MIN, AVG, COUNT
C:\Windows\Microsoft.NET\Framework\v4.0.303 19\InstallUtil.exe 'C:\Program Files\SolarWinds\Orion SDK\SWQL Studio\SwisPowerShell.dll' C:\Windows\Microsoft.NET\Framework64\v4.0.3
Functions ISNULL, ABS Credit The cheat sheet was created in conformity with SolarWinds Orion SDK 1.5. SWQL unique
0319\InstallUtil.exe 'C:\Program Files
Navigation Properties
(x86)\SolarWinds\Orion SDK\SWQL
SELECT I.Caption, I.Node.Contact FROM
Studio\SwisPowerShell.dll'
Orion.NPM.Interfaces I WHERE
If you installed the Orion SDK to a different
I.TypeName='ieee80211'
folder, adjust the path to SwisPowerShell.dll
Row Windows
accordingly.
SELECT NodeID, Caption, IPAddress, Status
The same DLL works in both 32- and 64-bit shells, but you have to register it separately for each context.
read, update, or delete entities.
UNION ALL
Subqueries in SELECT
choco install orionsdk -y
You must use CRUD operations to create,
UNION
1.5. If your scripts rely on the original behavior,
Installing SWIS PowerShell
DELETE
FROM Orion.Nodes ORDER BY Caption WITH ROWS 100 TO 199
Don't forget that you need to run the Powershell as Administrator. By Jan Elias (ernest)
Published 13th February, 2013.
Sponsored by CrosswordCheats.com
cheatography.com/ernest/
Last updated 4th July, 2017.
Learn to solve cryptic crosswords!
Page 1 of 1.
http://crosswordcheats.com