tdanner et. al;
Can anyone identify what the "DisableSensors" verb is looking for in Orion.HardwareHealth.HardwareItem ?
Trying the ID is coming back with an error in PowerShell:
Script:
# Clear PowerShell and add the SwisSnapin
Clear-Host
if (-not (Get-PSSnapin | Where-Object { $_.Name -eq 'SwisSnapin' })) {
Add-PSSnapin 'SwisSnapin'
}
# Connect to SWIS using AD pass-through
$hostname = 'SolarWindsPoller'
$swis = Connect-Swis -Hostname $hostname -Trusted
# Query SWIS to get an array of Sensor IDs to disable
$query = "SELECT ID, FullyQualifiedName FROM Orion.HardwareHealth.HardwareItem WHERE Name LIKE 'System Memory'"
$results = Get-SwisData $swis $query
# Loop through the array to disable the sensors
Foreach($sensor in $results){ Invoke-SwisVerb $swis Orion.HardwareHealth.HardwareItem DisableSensors $($sensor[0].ID) Write-Host "Disabling Hardware Sensor On: $($sensor[0].FullyQualifiedName)"
}
This is an example of what is being passed (adding a Write-Host to the front of the Invoke)
Invoke-SwisVerb SolarWinds.InformationService.Contract2.InfoServiceProxy Orion.HardwareHealth.HardwareItem DisableSensors 136
Disabling Hardware Sensor On: System Memory on hostname.domain.local
And this is the error:
Invoke-SwisVerb : Verb Orion.HardwareHealth.HardwareItem.DisableSensors cannot unpackage parameter 0 of type System.Collections.Generic.IEnumerable`1[SolarWinds.HardwareHealth.Common.Models.HardwareHealth.HardwareHealthItemKey]
At line:36 char:2
+ Invoke-SwisVerb $swis Orion.HardwareHealth.HardwareItem DisableSe ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Invoke-SwisVerb], FaultException`1
+ FullyQualifiedErrorId : SwisError,SwisPowerShell.InvokeSwisVerb
Any and all help is appreciated!