Hi
Am using the below script to unmanage the nodes. but the problem is if i give a node that is not in solarwinds its trying to unmanage instead of mentioning the node is not in solarwinds. Can some one help me to get the details of nodes that is not in solarwinds and to unmanage other nodes from the given excel file
Add-Pssnapin swissnapin
$swis = Connect-Swis -Hostname orion -Username admin -Password supersecret
$captions = Get-Content .\nodes-to-unmanage.txt
$nodes = Get-SwisData $swis "SELECT Uri FROM Orion.Nodes WHERE Caption IN @captions AND Unmanaged=0" @{captions=$captions}
$nodes | Set-SwisObject $swis -Properties @{UnmanageFrom=[DateTime]::UtcNow;UnmanageUntil=[DateTime]::UtcHours}