Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
Sample.ps1 Initial commit of ADM.psm1 May 1, 2019

Citrix Application Delivery Management Powershell Modu1e


Module Introduction

Citrix's Application Delivery Management (ADM) product is a linux-based Virtual appliance that serves as a centralized configuration management and analytics system for monitoring, analyzing, and maintaining Citrix Application Delivery Controllers (ADCs), which are formerly known as NetScalers.


Citrix ADM & ADC appliances include an API SDK called Nitro, which is implemented as a RESTful interface. This module provides a set of functions that are tailored for the Nitro REST interfaces to facilitate command line interaction with a target ADM host, as well as the ADCs that it manages, through the use of PowerShell cmdlets.

Getting Started

The easiest way to get started is to copy the '.\Sample.ps1' script (in this path) to the script that you want to create. The only requirement is that ADM.psm1 be in the same directory.

The following steps explain how to start from scratch, and outline the various functions in the ADM Powershell 'Invoke-RestMethod' helper module.

First, import module using the Import-Module command:

Import-Module '\ADM.psm1'

From there, a call to Connect-ADM should be stored to a variable to be used for any subsequent calls to [Invoke-ADMNitro].

External Module Functions

The following functions can be used as Powershell cmdlets to interact with a target ADM host.


This function builds a websession object to be used by Invoke-ADMNitro.


The following example will prompt a user for credentials and store an ADMSession object in [PSObject]$ADMSession to be used later on:

$ADMSession = Connect-ADM https://adm Get-Credential


This function closes a websession object when it is no longer needed.


Disconnect-ADM $ADMSession


This is the primary function in the module, and acts as the interpreter for input parameters to be executed against a target ADM host.


The following parameters are used by this function:


Mandatory=$true [PSObject]
This required parameter takes an ADMSession web session object to be used for the subsequent Invoke-Restmethod command


Mandatory=$true [ValidateSet("DELETE","GET","POST","PUT")] [string]$OperationMethod
The REST method to be used by Invoke-RestMethod command


Mandatory=$true [string]$ResourceType
The target nitro object class, for example configuration_template

Resource Name

Mandatory=$false [string]$ResourceName
Additional name added to the URL string $uri = "$($ADMSession.Endpoint)/nitro/v1/$ApiType/$ResourceType" if (-not [string]::IsNullOrEmpty($ResourceName)) { $uri += "/$ResourceName" }


Mandatory=$false [string]$Action
The target nitro method to execute against the specified nitro class


Mandatory=$false [ValidateScript({$OperationMethod -in @("GET", "DELETE")})] [hashtable]$Arguments=@{}
Additional arguments to be passed in the URL string in a ?key=value


Mandatory=$false [ValidateScript({$OperationMethod -notin @("GET", "DELETE")})] [hashtable]$Payload=@{}
Payload data in a hashtable key/value pair to send as JSON payload data to the REST interface.


Mandatory=$false [ValidateSet("upload", "config")] [ValidateSet("config","GET","POST","PUT")] [string]$ApiType="config"
Specify an the root API path to target, defaults to config.


Mandatory=$false [string]$ADCProxy
Specify a target ADC to proxy the API calls to


Get All ADM Configuration Templates

The following command will Get configuration_template objects from an $ADMSession

Invoke-ADMNitro -ADMSession $ADMSession -OperationMethod GET -ResourceType configuration_template
Delete the ADM Configuration Template Named Template

The following command will Get configuration_template objects from an $ADMSession

$Args = @{
   name = $Template.Name
   id = $
Invoke-ADMNitro -ADMSession $ADMSession -OperationMethod Delete -ResourceType configuration_template -Arguments $Args
Get the running configuration from every ADC in ADM

The following script will get the running configuration from each ADC in an ADM's inventory:

$ADCS = Invoke-ADMNitro -ADMSession $ADMSession -OperationMethod GET -ResourceType ns
$RunningConfigs = @()
foreach ($ADC in $ADCs.ns)
	$RunningConfigs += (Invoke-ADMNitro -ADMSession $ADMSession -OperationMethod GET -ResourceType nsrunningconfig -ADCHost $ADC.ip_address).nsrunningconfig
You can’t perform that action at this time.