Please help. I"m having trouble trying to unmanage a list of devices. Below is my script.
When it gets to invoke-swisverb it errors out with this message:
Could not find file 'C:\Users\userid\AppData\Local\Temp\zfye57a-.dll'.
At H:\unmange.ps1:22 char:22
+ Invoke-SwisVerb <<<< $swis Orion.Nodes Unmanage @("$nodeID",$now,$($myLine[1]),$false)
+ CategoryInfo : NotSpecified: (:) [], FileNotFoundException
+ FullyQualifiedErrorId : System.IO.FileNotFoundException
SCRIPT
$swis = Connect-Swis #--Credential $creds
$a = Get-Content h:\opt\hd\hostsunmanage.txt
foreach ($line in $a)
{
if ($line -ne "")
{
$now=[DateTime]::UtcNow
$line = $line.Trim()
$myLine = $line.split(",")
$retStuff = Get-SwisData $swis "SELECT NodeID FROM Orion.Nodes WHERE DNS = '$($myLine[0]).Trim()'"
$nodeID = "N:$retStuff"
Write-Host $($myLine[0]) " will be unmanaged from $now util " $($myLine[1])
Invoke-SwisVerb $swis Orion.Nodes Unmanage @("$nodeID",$now,$($myLine[1]),$false)
}
}