As a network engineer, I spend a lot of time hunting for information inside SolarWinds โ especially in NCM configuration archives and IPAM. Out of the box, SolarWinds gives you a lot of power, but when you need fast, adโhoc searches across configs and IP address data, the UI can start to feel a bit slow and clickโheavy.To solve this, I wrote a small PowerShell script, search-solarwinds.ps1, that connects directly to the SolarWinds API and lets me search NCM configs and IPAM from the command line with a single command.
Why I Built This Script
The main pain points I wanted to fix:
- Too many clicks: Jumping between NCM, IPAM, and search panels just to answer a simple question like โWhere is this IP used?โ or โWhich devices mention this hostname in their configs?โ.
- Slow, repetitive workflows: I was repeating the same types of searches many times a day.
- Lack of quick context: I wanted fast answers in a single place, without having to export or manually filter results.
A simple PowerShell script that talks to the SolarWinds Information Service (SWIS) API turned out to be the most efficient way to streamline this.
What the Script Does
The search-solarwinds.ps1 script takes one main input โ a search term โ and does two things:
1.Searches NCM configuration archives
- Looks through running configurations downloaded in the last N days.
- Finds any configs that contain your search term (IP, hostname, string, etc.).
- Excludes devices with โStandbyโ in their name.
- Returns only the latest running config per device (no duplicates).
- Shows:
- Device name
- Config type
- Download time
- Then summarizes the exact lines where the search term appears.
2. Searches IPAM
- Checks for: IpAddress or name(string)
- Shows:
- IP address
- Status (USED, AVAILABLE, RESERVED, TRANSIENT, UNKNOWN)
- Reverse DNS (DnsBackward)
- Last sync time
- Comments
In practice, this means I can type a single command and immediately see where an IP or hostname shows up in both configs and IPAM.
How It Works Behind the Scenes
The script uses the SolarWinds Information Service v3 JSON API over HTTPS. It:
- Reads the SolarWinds hostname and credentials from a simple env file in your home folder:
- SOLARWINDS_HOST
- SOLARWINDS_USER
- SOLARWINDS_PASS
- Builds a basic authentication header and sends REST API queries with Invoke-RestMethod.
- Runs two SQLโlike queries:
- One against NCM.ConfigArchive and related tables.
- One against IPAM.IPNode.
The NCMย partย filtersย onlyย ‘Running’ configs fromย theย lastย Nย days andย thenย groupsย byย device to get theย newestย config for each device. Onย top of that, theย scriptย parsesย theย configurationย text itselfย toย find the actual linesย thatย containย yourย search term, which is incrediblyย usefulย whenย youโre troubleshooting. Forย IPAM, the queryย isย simplerย but effective: itย matchesย the IP directly, orย anythingย in theย ‘DnsBackward’ย (reverse DNS) that containsย your search term.
Usage Examples
Once the script and environment variables are in place, the usage is straightforward.
Basic hostname search
.\search-solarwinds.ps1 webserver01
This will:
- Search all recent NCM running configs for โwebserver01โ.
- Search IPAM for:
- IP addresses equal to webserver01 (rare, but possible if you paste IPs),
- Any reverse DNS that contains webserver01.
Search by IP
.\search-solarwinds.ps1 172.16.1.100
This is great for those โWhere is this IP used?โ moments. The script will:
- Show which devices mention that IP in their configs.
- Show IPAM details for that address or anything matching its hostname.
Adjusting the time window
By default, the script searches configs from the last 7 days. You can change this by passing a second parameter:
.\search-solarwinds.ps1 webserver01 30
This searches 30 days of NCM config archives instead.
Forย now, though, thisย lightweightย PowerShell scriptย alreadyย saves me a lotย of time andย givesย me a faster way toย extractย useful information from SolarWinds.
Code:
You can find the source codeย here:
https://github.com/czirakim/PowerShell.Solarwinds