Trying to figure out the best way to identify devices that were not discovered/imported during large automated processes.
Below is a block of code that reads a list of IP's from your original spreadsheet IPsToAdd.csv. It reads each IP from the spreadsheet then does a lookup in the database to see if the node exists.
You could use a similar lookup command after the node was added to verify it exists in the database and output any that were missed to the screen or to a file.
$csv = Import-Csv C:\PowershellScripts\IPsToADD.csv$csv | ForEach-Object { $IP = $_.IP $nodeuri = Get-SwisData $swis "SELECT Uri FROM Orion.Nodes WHERE IP_Address LIKE '$IP'" if ($nodeuri) { Write-Host "node $NodeIPAddress already exists - skipping to the next one"}
Thank you very much for the quick response. I will give it a try.