I am new to community and solarwinds. I want to write a powershell script that would enable to list all nodes and node IDs, separated by space or comma in a text file. Please advise.
Why not use the Report Writer for this? You can then use the export features.
To expand on Jeff's reply, you can:
1) create a report in reportwriter that shows the fields you want
2) on the SolarWinds website, display the report
3) add "&dataformat=xls" to the end of the URL and hit enter.
...or "TXT" or "CSV"
What you will get is the report exported to the format you specify.
UNLESS this is something you need to run programatically in the background to feed some other process. In which case your first thought (SDK) may be one of your better options.
Hi, Jamilhs,
do you mean something like this? (Modify target to the Orion machine and uncomment add-PSSnapin sequence in case you haven't added it yet)
#Add-PSSnapin SWISSnapin
$Target="localhost"
$Credentials = get-credential
$swis = Connect-Swis -host $Target -Credential $Credentials
Get-SwisData $swis "Select NodeID, Caption from Orion.Nodes" | Export-Csv C:\Nodelist.txt
I tried adding the &dataformat=xls and got an error. Youare talking about adding in report scheduler, correct?
No. Straight on the web server. Just like viewing a report.