The DisablePollingForNodes verb is not working for me. It works in SWQL studio as exampled in: https://documentation.solarwinds.com/en/success_center/sam/content/sam-asset-inventory-enable-for-multiple-nodes.htm.
But it doesn't work using the PowerShell module (SwisPowerShell). I tested it using 8 different variations of how to include the NodeID in the call:
Import-Module SwisPowerShell
# SWIS Connection
$SwisHostname = "orion.example.com"
$SwisCredential = Get-Credential
$Swis = Connect-Swis -Hostname $SwisHostname -Credential $SwisCredential
# Node
[int]$NodeId = 5334
# Alternate ways to test
$TestArguments = @(
$NodeId,
"$NodeId",
("'" + $NodeId + "'"),
"$NodeId"
)
foreach ($TestArgument in $TestArguments) {
# Test with argument as array
Invoke-SwisVerb -SwisConnection $Swis -EntityName "Orion.AssetInventory.Polling" -Verb "DisablePollingForNodes" -Arguments @($TestArgument)
# Test with argument plain
Invoke-SwisVerb -SwisConnection $Swis -EntityName "Orion.AssetInventory.Polling" -Verb "DisablePollingForNodes" -Arguments $TestArgument
}
The output for each different variation is the same:
Invoke-SwisVerb : Verb Orion.AssetInventory.Polling.DisablePollingForNodes cannot unpackage parameter 0 of type System.Int32[]
At line:23 char:5
+ Invoke-SwisVerb -SwisConnection $Swis -EntityName "Orion.AssetInv ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Invoke-SwisVerb], FaultException`1
+ FullyQualifiedErrorId : SwisError,SwisPowerShell.InvokeSwisVerb
Anyone know what I'm doing wrong?