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.

Powershell Script to unmanage nodes on SW NPM

Hi All,

I am trying to create a powershell script, which will assist our limited access engineers to place node(s) in unmanage state for a period of time, depending on the dontime/activity schedule. The aim to make it simple, mention the node name, start & end date and time, and node will be unamaged during the mentioned time period

Have anyone done this before or came cross such script? Or any other easier way to fullfill that other than accessing the SW GUI.

appreciate your help emoticons_happy.png I am still in the first stages of learning powershell

  • Check out the Orion SDK. You'll need to import the API powershell module first, then the rest should be fairly simple to achieve using the SDK documentation and the powershell examples that come with it emoticons_happy.png

  • On a side not, not sure if you are aware but in NPM 11.5 the permission to unmanage/remanage nodes is now a separate account privilege you can assign to certain users (whereas previously they would have needed the more powerful "Node Management" option granted)

  • This is pretty easy to do with SQL if they are allowed to access the database. Otherwise you could write an API if they aren't.

  • Thank You.That really helped to get me startedemoticons_happy.png

  • silverbacksaysprawijjonnie

    Hi All,

    I have reached a point where i need to execute swisinvoke to placed a node in unmanaged . but I am unable to get that exe work. always showing swisinvoke stopped working when it is called.

    Powershell Script:

    Add-PSSnapin SwisSnapin

    $SWSERVER = 'kw1pzos'

    $creds = Get-Credential

    $swis = Connect-swis -Credential $creds -hostname $SWSERVER

    $Sitenodes = Read-Host "Node Name:"

    $nodeid = Get-SwisData $swis 'SELECT NodeID FROM Orion.Nodes WHERE Caption=@v' @{v="$Sitenodes"}


    c:\Users\isaab\Desktop\SWUNM\SwisInvoke /h=10.200.33.21 /u=xxxx /p=yyyy Orion.Nodes.Unmanage N:$nodeid 2015-05-11T16:35:00 2015-05-11T16:40:00 false

    Any Ideas?

  • Hi all...

    Thanks for the push in the correct direction  silverbacksays

    i was able to pull it off, and i have even created different powershell functions that we use now to place a node in unmanaged state (through IP address or node name), remanage node, list unmanaged nodes, list nodes  and put multiple nodes under one location/city into unmanaged state

    It was fun emoticons_happy.png!!!

  • FormerMember
    0 FormerMember in reply to isaab

    Hi isaab,

    I was looking to tackle the same issue that you posted about and wondered if you would mind posting your solution?  I'd like to just copy what you have and modify to suit my needs.

    Thanks,

    -Jim