Running a Powershell script and I can't seem to get the Unmanage verb working. Running SDK 1.6
Connect and Query run run fine and I am in an AD group with full access to Orion.
NPM - 10.4.2
Made a little progress last night. I swiched my connect
From - $swis = Connect-Swis -Credential $cred -Hostname 'Host'
To - $swiss = Connect-Swis -Trusted -Hostname 'Host'
Now when I look in Orion at the node events, I see a message that says "User changes node property unmanaged".
However, the node status is still green and the node is still managed.
I have it working but, it’s not 100%.
$swis = Connect-Swis -Trusted -Hostname 'Host'
Get-SwisData $swis 'SELECT NodeID, IPAddress, NextPoll FROM Orion.Nodes WHERE Vendor=@v' @{v=$Vend}
$NodeID = "N:1008"
$now=[DateTime]::Now
$later=$now.AddDays(1)
Invoke-SwisVerb -SwisConnection $swis -EntityName Orion.Nodes Unmanage-Arguments @"$NodeID",$now,$later,"false")
If the re-manage time ($later) is set to days it works.
If the re-manage time is set to minutes or hours it does not work.
In orion the event time is wonky… UnManageUntil from 6/21/2013 7:40:42 AM to 6/21/2013 12:52:45 PM
These times need to be specified in UTC. Change the $now line to "$now=[DateTime]::UtcNow" and it should behave.
And it looks like the example in the documentation under "Invoke-SwisVerb" does it incorrectly as well. I'll get that fixed.
The reason you were seeing it "work" when you set a remanage time of a day or more is that with a 24-hour window, "now" is still in the unmanage period even when you slide the unmanage period by the UTC adjustment.
SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 195,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process.