I'm new to SWQL and Powershell, and I've been scratching my head over this for a day or so now and I'm officially confused.
I'm attempting to pull data from our SolarWinds Environment to use to validate a asset management application I created. I simply need to pull a list of server names. This is easy enough, the confusing part is the export should be just as simple.
So for the case below, I'm pulling the DisplayName and IPAddress from Nodes. This works great. The .csv is created with the proper DisplayName strings and the IP addresses in tact. Now I only require the DisplayName, but if i remove the requirement for IPAddress ('SELECT DisplayName), the CSV file is created with a list of integer values? I imagine this is because it's technically an ID value that's possibly connecting to a different table so it's only gathering the value in the Nodes table? Is there a simple way to get the actual string value for the displayname and can someone explain why this works with multiple fields queried and not a single field?
Appreciate it.
Import-ModuleSqlServer
#other variable not show due to privacy of the connection string
Get-SwisData (Connect-Swis-Hostname$Server -Username$username-Password$password) -Query'SELECT DisplayName,IPAddress FROM Orion.Nodes Where MachineType=''Windows 2012 R2 Server''
|Export-Csv-Path$path-NoTypeInformation