Version: 1.0.0 Author: Ufuk Kocak Website: horizonconsulting.it LinkedIn: linkedin.com/in/ufukkocak
A PowerShell WinForms GUI tool that lets Citrix ADC / NetScaler administrators instantly search the ns.conf of one or more appliances simultaneously — without SSH, Python or any additional software.
Built for NetScaler administrators who need to quickly locate configuration lines across multiple appliances without manually opening each config file.
DISCLAIMER — USE AT YOUR OWN RISK
This software is provided as-is, without any warranty. The author accepts no liability whatsoever for damage, data loss, service interruption or any other consequence arising from the use of this software. Always test in a dedicated test environment before deploying to production. See the LICENSE file for the full disclaimer.
- Multi-appliance search — query the
ns.confof multiple NetScalers in a single operation - Live download via NITRO REST API — always searches the current running configuration
- Text and regex search — supports plain text, wildcards and full regular expressions
- Session cache — ns.conf is downloaded once per session; subsequent searches are instant
- Notepad++ integration — double-click any result to open the file directly at the correct line number
- Colour-coded results — each NetScaler gets a unique row colour for instant visual separation
- No installation required — double-click the
.batto start; automatic file unblocking included - Pure PowerShell 5.1 — no external modules or dependencies
- How it works
- File structure
- Requirements
- Configuration
- Starting the tool
- Interface overview
- Search tips
- Troubleshooting
- Author
- License
- Connects via HTTPS NITRO REST API to each selected NetScaler
- Downloads the current
ns.conf(base64-encoded via/nitro/v1/config/systemfile) - Searches all lines for the specified term (text or regular expression)
- Displays per match: NetScaler name, line number and the full configuration line
- Opens the file directly at the correct line number in Notepad++ on double-click
The ns.conf is cached per session. Use Clear cache to force a fresh download (e.g. after a configuration change).
NetScalerSearch\
├── Search-NetScaler.bat # Double-click launcher (recommended)
├── Search-NetScaler.ps1 # Main script — PowerShell WinForms GUI
└── README.md # This file
Temporary files are created in %TEMP%\NSConfSearch\ and automatically removed when the tool is closed.
| Requirement | Notes |
|---|---|
| Windows PowerShell 5.1 | Included in Windows Server 2016+ and Windows 10/11 |
| Notepad++ | Required for the open-at-line-number feature. Checked in Program Files, Program Files (x86) and the Windows App Paths registry key |
| HTTPS access (port 443) | From the machine running the tool to all configured NetScaler IP addresses |
| NetScaler account | With NITRO API read access (read-only or operator role is sufficient) |
Open Search-NetScaler.ps1 and update the CONFIGURATION section at the top of the file:
$NetScalers = @(
[PSCustomObject]@{ Name = "NS-ADC-01"; HostName = "192.168.1.10"; Protocol = "https" }
[PSCustomObject]@{ Name = "NS-ADC-02"; HostName = "192.168.1.20"; Protocol = "https" }
[PSCustomObject]@{ Name = "NS-ADC-03"; HostName = "192.168.1.30"; Protocol = "https" }
)
# Domain appended automatically to the username (leave empty to disable)
$Domain = "yourdomain.local"
# Prefix pre-filled in the username field
$UserPrefix = "admin-"Add or remove NetScaler entries as needed. The colour-coded row scheme supports any number of appliances (colours cycle automatically). If $Domain is left empty, the username is sent as-is.
To add a custom Notepad++ path:
$NppPaths = @(
"D:\Tools\Notepad++\notepad++.exe" # <-- add your own path here
"${env:ProgramFiles}\Notepad++\notepad++.exe"
"${env:ProgramFiles(x86)}\Notepad++\notepad++.exe"
)Double-click Search-NetScaler.bat — this is the recommended method.
The batch launcher automatically removes the Windows block flag (Zone.Identifier) that Windows sets on files copied from another machine or drive. Without this step, PowerShell may refuse to run the script on servers with a strict execution policy.
Note: On first run Windows may show a security warning ("The publisher could not be verified"). Click Run to continue. This is a one-time prompt.
Alternatively, run directly from PowerShell:
.\Search-NetScaler.ps1| Field | Description |
|---|---|
| Username | Enter the username. The domain suffix (e.g. @yourdomain.local) is added automatically. |
| Password | Password for the NetScaler account |
| Checkboxes | Select which NetScalers to include in the search (all checked by default) |
| Element | Description |
|---|---|
| Search | The text to search for in the ns.conf |
| Regex | Enable to use a regular expression as the search term |
| Case sensitive | Disabled by default — search is case-insensitive |
| Search [F5] | Run the search. Also triggered by F5 or Enter in the search field |
| Clear cache | Forces a fresh ns.conf download on the next search |
Each row is colour-coded by NetScaler. Columns: NetScaler | Line # | Configuration line
| Action | Result |
|---|---|
| Double-click a row | Opens the ns.conf in Notepad++ directly at the matching line number |
| Enter (row selected) | Same as double-click |
| Open in Notepad++ [Enter] | Opens the selected row in Notepad++ at the correct line |
| Open all ns.conf files | Opens each cached ns.conf as a separate tab in Notepad++ |
| Goal | Search term (example) |
|---|---|
| All load balancing vServers | add lb vserver |
| Specific vServer by name | add lb vserver MY-APP |
| All SSL vServer bindings | bind ssl vserver |
| LDAP authentication servers | add authentication ldapAction |
| Find a specific IP address | 10.0.0.1 |
| Gateway configuration | add vpn vserver |
| All commented-out lines | ^# (enable Regex) |
Lines starting with add |
^add (enable Regex) |
Symptom: PowerShell reports cannot be loaded, the file is not digitally signed or nothing happens after double-clicking the bat.
Cause: Windows marks files copied from another drive or server as blocked (Zone.Identifier).
Solution: Always use Search-NetScaler.bat to start the tool. The bat automatically unblocks all files in the folder before launching the script.
If the issue persists (e.g. due to a Group Policy that overrides this), unblock manually:
Get-ChildItem -Path "C:\Scripts\NetScalerSearch" -File | Unblock-FileOr via Explorer: right-click the file → Properties → tick Unblock → OK.
Symptom: Red error row with Authentication failed or a NITRO error code.
Possible causes:
- Wrong username or password
- The NetScaler requires a specific username format — try without the domain (
admin) or with NetBIOS format (DOMAIN\admin)
To change the username format, find this line in Search-NetScaler.ps1:
$nitroUser = if (-not $Domain -or $username -match "@") { $username } else { "$username@$Domain" }Change to plain username (no domain):
$nitroUser = $username -replace "@.*$", ""Or to NetBIOS format:
$nitroUser = "DOMAIN\$($username -replace '@.*$', '')"Symptom: Pop-up Notepad++ not found.
Solution: Add the installation path to $NppPaths in Search-NetScaler.ps1 (see Configuration).
Symptom: Red error row with Connection failed or a timeout message.
Check:
- Is port 443 reachable from this machine to the NetScaler IP?
Test-NetConnection -ComputerName 192.168.1.10 -Port 443
- Is the NITRO API enabled on the NetScaler? (enabled by default on all VPX instances)
- Verify that the
Protocolin$NetScalersmatches the appliance (httpsvshttp)
Symptom: Red error row with Cannot retrieve ns.conf or errorcode: 1.
Cause: The account has insufficient permissions on the NetScaler. The account needs at minimum a read-only or operator role in the NITRO system.
Verify via browser:
https://192.168.1.10/nitro/v1/config/systemfile?args=filename:ns.conf,filelocation:%2Fnsconfig
If the browser returns a JSON response after login, the API is working correctly.
Ufuk Kocak Horizon IT Consulting Website: horizonconsulting.it LinkedIn: linkedin.com/in/ufukkocak
This project is licensed under the MIT License — see the LICENSE file for details.
You are free to use, modify and distribute this project in any environment, including commercial, as long as the original copyright notice is retained.
NetScalerSearch is an open-source project. Contributions and issue reports are welcome via GitHub.