Skip to content

Commit

Permalink
Merge pull request #199 from mrxinu/inventory-enable
Browse files Browse the repository at this point in the history
Add example of node inventory enabling
  • Loading branch information
danjagnow committed Oct 25, 2019
2 parents caaf46f + e7ef583 commit 5ea2029
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Samples/PowerShell/Node.Inventory.Enable.ps1
@@ -0,0 +1,19 @@
Import-Module SwisPowerShell

$OrionServer = 'localhost'
$Username = 'admin'
$Password = ''

$swis = Connect-Swis -Hostname $OrionServer -Username $Username -Password $Password

$query = "
SELECT TOP 5
Nodes.NodeID
FROM Orion.Nodes AS Nodes
"

$nodeids = Get-SwisData -SwisConnection $swis -Query $query

# details about the reason for the arguments format can be found here:
# https://github.com/solarwinds/OrionSDK/wiki/Alerts#verb-resumealerts
Invoke-SwisVerb -SwisConnection $swis -Entity 'Orion.ADM.NodeInventory' -Verb 'Enable' -Arguments @( , [int[]] $nodeids ) | Out-Null

0 comments on commit 5ea2029

Please sign in to comment.