Managing NetScaler upgrades using NITRO API

With the release of NetScaler 11.1 there was a new API module available which I haven’t seen before which was “install” API which allows us to handle upgrades/downgrades of NetScaler versions using the NITRO API.

There isn’t so much about it on the docs yet, luckily I got some response from the NetScaler team on the NetScaler masterclass today and I got the link I was looking for in the documentation.

The simplest way to do this now (If you don’t have MAS or Command Center) is to do it using PowerShell Smilefjes som blunker note this does not apply for CPX I have another blog coming there later on.

For this to work I placed my latest netscaler firmware on an IIS servere which all HTTP request have access to the file. So I placed the firmware under C:\inetpub\wwwroot on a specific computer. Then I can reference that in the NITRO API.

There aren’t so many parameters available in the API call, you just need to specify where to get the firmware and specify if you want to force the upgrade and enable callhome.

I’ve been using the PowerShell cmdlets on Github which you can find here

So basically just added another function to it. If you want to try it out without using the entire PowerShell cmdlet you can use this. Simple and split into two functions. (NOTE I HAVE HARDCODED THE VARIABLES SO YOU SEE WHICH TO CHANGE AND ADD YOURSELVES Smilefjes)

function Login-NS {

# Login to the NetScaler
$body = ConvertTo-JSON @{
Invoke-RestMethod -uri “” -body $body -SessionVariable NSSession `
-Headers @{“Content-Type”=”application/”} -Method POST
$Script:NSSession = $local:NSSession

function upgrade-NS {

$body = @{
$body = ConvertTo-JSON $body  
Invoke-RestMethod -uri “” -body $body -WebSession $NSSession `
-Headers @{“Content-Type”=”application/json”} -Method POST


So basically just run Login-NS (Where you change the variables username and password and same with URI and IP address) and since you need to authenticate against the NetScaler first. Then the second command which is upgrade-NS which fetches the firmware from 106 using that filename and then asks the 171 NetScaler to get the firmware from that location.

Leave a Reply

Scroll to Top