This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Invoke-SwisVerb : Access to Orion.Nodes.Unmanage verb denied.


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.

  • What version of NPM are you using? Could you post the commands you are using to connect to SWIS and call the verb?

  • 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.

  • Can you post the command you are using to call the verb?

  • 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.