J81.NSToolkit.Config/Public/ns-functions-config-ns.ps1
function Invoke-NSAddNsacl { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Configuration for ACL entry resource. .PARAMETER Aclname Name for the extended ACL rule. Must begin with an ASCII alphabetic or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER Aclaction Action to perform on incoming IPv4 packets that match the extended ACL rule. Available settings function as follows: * ALLOW - The Citrix ADC processes the packet. * BRIDGE - The Citrix ADC bridges the packet to the destination without processing it. * DENY - The Citrix ADC drops the packet. Possible values = BRIDGE, DENY, ALLOW .PARAMETER Td Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0. Maximum value = 4094 .PARAMETER Srcip IP address or range of IP addresses to match against the source IP address of an incoming IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 10.102.29.30-10.102.29.189. .PARAMETER Srcipop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Srcipval IP address or range of IP addresses to match against the source IP address of an incoming IPv4 packet. In the command line interface, separate the range with a hyphen. For example:10.102.29.30-10.102.29.189. .PARAMETER Srcipdataset Policy dataset which can have multiple IP ranges bound to it. .PARAMETER Srcport Port number or range of port numbers to match against the source port number of an incoming IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. .PARAMETER Srcportop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Srcportval Port number or range of port numbers to match against the source port number of an incoming IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. .PARAMETER Srcportdataset Policy dataset which can have multiple port ranges bound to it. .PARAMETER Destip IP address or range of IP addresses to match against the destination IP address of an incoming IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 10.102.29.30-10.102.29.189. .PARAMETER Destipop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Destipval IP address or range of IP addresses to match against the destination IP address of an incoming IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 10.102.29.30-10.102.29.189. .PARAMETER Destipdataset Policy dataset which can have multiple IP ranges bound to it. .PARAMETER Destport Port number or range of port numbers to match against the destination port number of an incoming IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. Note: The destination port can be specified only for TCP and UDP protocols. .PARAMETER Destportop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Destportval Port number or range of port numbers to match against the destination port number of an incoming IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. Note: The destination port can be specified only for TCP and UDP protocols. .PARAMETER Destportdataset Policy dataset which can have multiple port ranges bound to it. .PARAMETER Ttl Number of seconds, in multiples of four, after which the extended ACL rule expires. If you do not want the extended ACL rule to expire, do not specify a TTL value. Maximum value = 2147483647 .PARAMETER Srcmac MAC address to match against the source MAC address of an incoming IPv4 packet. .PARAMETER Srcmacmask Used to define range of Source MAC address. It takes string of 0 and 1, 0s are for exact match and 1s for wildcard. For matching first 3 bytes of MAC address, srcMacMask value "000000111111". . .PARAMETER Protocol Protocol to match against the protocol of an incoming IPv4 packet. Possible values = ICMP, IGMP, TCP, EGP, IGP, ARGUS, UDP, RDP, RSVP, EIGRP, L2TP, ISIS, GGP, IPoverIP, ST, CBT, BBN-RCC-M, NVP-II, PUP, EMCON, XNET, CHAOS, MUX, DCN-MEAS, HMP, PRM, XNS-IDP, TRUNK-1, TRUNK-2, LEAF-1, LEAF-2, IRTP, ISO-TP4, NETBLT, MFE-NSP, MERIT-INP, SEP, 3PC, IDPR, XTP, DDP, IDPR-CMTP, TP++, IL, IPv6, SDRP, IPv6-Route, IPv6-Frag, IDRP, GRE, MHRP, BNA, ESP, AH, I-NLSP, SWIPE, NARP, MOBILE, TLSP, SKIP, ICMPV6, IPv6-NoNx, IPv6-Opts, Any-Host-Internal-Protocol, CFTP, Any-Local-Network, SAT-EXPAK, KRYPTOLAN, RVD, IPPC, Any-Distributed-File-System, TFTP, VISA, IPCV, CPNX, CPHB, WSN, PVP, BR-SAT-MO, SUN-ND, WB-MON, WB-EXPAK, ISO-IP, VMTP, SECURE-VM, VINES, TTP, NSFNET-IG, DGP, TCF, OSPFIGP, Sprite-RP, LARP, MTP, AX.25, IPIP, MICP, SCC-SP, ETHERIP, Any-Private-Encryption-Scheme, GMTP, IFMP, PNNI, PIM, ARIS, SCPS, QNX, A/N, IPComp, SNP, Compaq-Pe, IPX-in-IP, VRRP, PGM, Any-0-Hop-Protocol, ENCAP, DDX, IATP, STP, SRP, UTI, SMP, SM, PTP, FIRE, CRTP, CRUDP, SSCOPMCE, IPLT, SPS, PIPE, SCTP, FC, RSVP-E2E-IGNORE, Mobility-Header, UDPLite .PARAMETER Protocolnumber Protocol to match against the protocol of an incoming IPv4 packet. Maximum value = 255 .PARAMETER Vlan ID of the VLAN. The Citrix ADC applies the ACL rule only to the incoming packets of the specified VLAN. If you do not specify a VLAN ID, the appliance applies the ACL rule to the incoming packets on all VLANs. Maximum value = 4094 .PARAMETER Vxlan ID of the VXLAN. The Citrix ADC applies the ACL rule only to the incoming packets of the specified VXLAN. If you do not specify a VXLAN ID, the appliance applies the ACL rule to the incoming packets on all VXLANs. Maximum value = 16777215 .PARAMETER Interface ID of an interface. The Citrix ADC applies the ACL rule only to the incoming packets from the specified interface. If you do not specify any value, the appliance applies the ACL rule to the incoming packets of all interfaces. .PARAMETER Established Allow only incoming TCP packets that have the ACK or RST bit set, if the action set for the ACL rule is ALLOW and these packets match the other conditions in the ACL rule. .PARAMETER Icmptype ICMP Message type to match against the message type of an incoming ICMP packet. For example, to block DESTINATION UNREACHABLE messages, you must specify 3 as the ICMP type. Note: This parameter can be specified only for the ICMP protocol. Maximum value = 65536 .PARAMETER Icmpcode Code of a particular ICMP message type to match against the ICMP code of an incoming ICMP packet. For example, to block DESTINATION HOST UNREACHABLE messages, specify 3 as the ICMP type and 1 as the ICMP code. If you set this parameter, you must set the ICMP Type parameter. Maximum value = 65536 .PARAMETER Priority Priority for the extended ACL rule that determines the order in which it is evaluated relative to the other extended ACL rules. If you do not specify priorities while creating extended ACL rules, the ACL rules are evaluated in the order in which they are created. Maximum value = 100000 .PARAMETER State Enable or disable the extended ACL rule. After you apply the extended ACL rules, the Citrix ADC compares incoming packets against the enabled extended ACL rules. Possible values = ENABLED, DISABLED .PARAMETER Logstate Enable or disable logging of events related to the extended ACL rule. The log messages are stored in the configured syslog or auditlog server. Possible values = ENABLED, DISABLED .PARAMETER Ratelimit Maximum number of log messages to be generated per second. If you set this parameter, you must enable the Log State parameter. Maximum value = 10000 .PARAMETER Type Type of the acl,default will be CLASSIC. Available options as follows: * CLASSIC - specifies the regular extended acls. * DFD - cluster specific acls,specifies hashmethod for steering of the packet in cluster . Possible values = CLASSIC, DFD .PARAMETER Dfdhash Specifies the type hashmethod to be applied, to steer the packet to the FP of the packet. Possible values = SIP-SPORT-DIP-DPORT, SIP, DIP, SIP-DIP, SIP-SPORT, DIP-DPORT .PARAMETER Stateful If stateful option is enabled, transparent sessions are created for the traffic hitting this ACL and not hitting any other features like LB, INAT etc. . Possible values = YES, NO .PARAMETER PassThru Return details about the created nsacl item. .EXAMPLE PS C:\>Invoke-NSAddNsacl -aclname <string> -aclaction <string> An example how to add nsacl config Object(s). .NOTES File Name : Invoke-NSAddNsacl Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsacl/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Aclname, [Parameter(Mandatory)] [ValidateSet('BRIDGE', 'DENY', 'ALLOW')] [string]$Aclaction, [double]$Td, [boolean]$Srcip, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Srcipop, [string]$Srcipval, [string]$Srcipdataset, [boolean]$Srcport, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Srcportop, [string]$Srcportval, [string]$Srcportdataset, [boolean]$Destip, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Destipop, [string]$Destipval, [string]$Destipdataset, [boolean]$Destport, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Destportop, [string]$Destportval, [string]$Destportdataset, [double]$Ttl, [string]$Srcmac, [string]$Srcmacmask = '"000000000000"', [ValidateSet('ICMP', 'IGMP', 'TCP', 'EGP', 'IGP', 'ARGUS', 'UDP', 'RDP', 'RSVP', 'EIGRP', 'L2TP', 'ISIS', 'GGP', 'IPoverIP', 'ST', 'CBT', 'BBN-RCC-M', 'NVP-II', 'PUP', 'EMCON', 'XNET', 'CHAOS', 'MUX', 'DCN-MEAS', 'HMP', 'PRM', 'XNS-IDP', 'TRUNK-1', 'TRUNK-2', 'LEAF-1', 'LEAF-2', 'IRTP', 'ISO-TP4', 'NETBLT', 'MFE-NSP', 'MERIT-INP', 'SEP', '3PC', 'IDPR', 'XTP', 'DDP', 'IDPR-CMTP', 'TP++', 'IL', 'IPv6', 'SDRP', 'IPv6-Route', 'IPv6-Frag', 'IDRP', 'GRE', 'MHRP', 'BNA', 'ESP', 'AH', 'I-NLSP', 'SWIPE', 'NARP', 'MOBILE', 'TLSP', 'SKIP', 'ICMPV6', 'IPv6-NoNx', 'IPv6-Opts', 'Any-Host-Internal-Protocol', 'CFTP', 'Any-Local-Network', 'SAT-EXPAK', 'KRYPTOLAN', 'RVD', 'IPPC', 'Any-Distributed-File-System', 'TFTP', 'VISA', 'IPCV', 'CPNX', 'CPHB', 'WSN', 'PVP', 'BR-SAT-MO', 'SUN-ND', 'WB-MON', 'WB-EXPAK', 'ISO-IP', 'VMTP', 'SECURE-VM', 'VINES', 'TTP', 'NSFNET-IG', 'DGP', 'TCF', 'OSPFIGP', 'Sprite-RP', 'LARP', 'MTP', 'AX.25', 'IPIP', 'MICP', 'SCC-SP', 'ETHERIP', 'Any-Private-Encryption-Scheme', 'GMTP', 'IFMP', 'PNNI', 'PIM', 'ARIS', 'SCPS', 'QNX', 'A/N', 'IPComp', 'SNP', 'Compaq-Pe', 'IPX-in-IP', 'VRRP', 'PGM', 'Any-0-Hop-Protocol', 'ENCAP', 'DDX', 'IATP', 'STP', 'SRP', 'UTI', 'SMP', 'SM', 'PTP', 'FIRE', 'CRTP', 'CRUDP', 'SSCOPMCE', 'IPLT', 'SPS', 'PIPE', 'SCTP', 'FC', 'RSVP-E2E-IGNORE', 'Mobility-Header', 'UDPLite')] [string]$Protocol, [double]$Protocolnumber, [double]$Vlan, [double]$Vxlan, [string]$Interface, [boolean]$Established, [double]$Icmptype, [double]$Icmpcode, [double]$Priority, [ValidateSet('ENABLED', 'DISABLED')] [string]$State = 'ENABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Logstate = 'DISABLED', [double]$Ratelimit = '100', [ValidateSet('CLASSIC', 'DFD')] [string]$Type = 'CLASSIC', [ValidateSet('SIP-SPORT-DIP-DPORT', 'SIP', 'DIP', 'SIP-DIP', 'SIP-SPORT', 'DIP-DPORT')] [string]$Dfdhash, [ValidateSet('YES', 'NO')] [string]$Stateful = 'NO', [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNsacl: Starting" } process { try { $payload = @{ aclname = $aclname aclaction = $aclaction } if ( $PSBoundParameters.ContainsKey('td') ) { $payload.Add('td', $td) } if ( $PSBoundParameters.ContainsKey('srcip') ) { $payload.Add('srcip', $srcip) } if ( $PSBoundParameters.ContainsKey('srcipop') ) { $payload.Add('srcipop', $srcipop) } if ( $PSBoundParameters.ContainsKey('srcipval') ) { $payload.Add('srcipval', $srcipval) } if ( $PSBoundParameters.ContainsKey('srcipdataset') ) { $payload.Add('srcipdataset', $srcipdataset) } if ( $PSBoundParameters.ContainsKey('srcport') ) { $payload.Add('srcport', $srcport) } if ( $PSBoundParameters.ContainsKey('srcportop') ) { $payload.Add('srcportop', $srcportop) } if ( $PSBoundParameters.ContainsKey('srcportval') ) { $payload.Add('srcportval', $srcportval) } if ( $PSBoundParameters.ContainsKey('srcportdataset') ) { $payload.Add('srcportdataset', $srcportdataset) } if ( $PSBoundParameters.ContainsKey('destip') ) { $payload.Add('destip', $destip) } if ( $PSBoundParameters.ContainsKey('destipop') ) { $payload.Add('destipop', $destipop) } if ( $PSBoundParameters.ContainsKey('destipval') ) { $payload.Add('destipval', $destipval) } if ( $PSBoundParameters.ContainsKey('destipdataset') ) { $payload.Add('destipdataset', $destipdataset) } if ( $PSBoundParameters.ContainsKey('destport') ) { $payload.Add('destport', $destport) } if ( $PSBoundParameters.ContainsKey('destportop') ) { $payload.Add('destportop', $destportop) } if ( $PSBoundParameters.ContainsKey('destportval') ) { $payload.Add('destportval', $destportval) } if ( $PSBoundParameters.ContainsKey('destportdataset') ) { $payload.Add('destportdataset', $destportdataset) } if ( $PSBoundParameters.ContainsKey('ttl') ) { $payload.Add('ttl', $ttl) } if ( $PSBoundParameters.ContainsKey('srcmac') ) { $payload.Add('srcmac', $srcmac) } if ( $PSBoundParameters.ContainsKey('srcmacmask') ) { $payload.Add('srcmacmask', $srcmacmask) } if ( $PSBoundParameters.ContainsKey('protocol') ) { $payload.Add('protocol', $protocol) } if ( $PSBoundParameters.ContainsKey('protocolnumber') ) { $payload.Add('protocolnumber', $protocolnumber) } if ( $PSBoundParameters.ContainsKey('vlan') ) { $payload.Add('vlan', $vlan) } if ( $PSBoundParameters.ContainsKey('vxlan') ) { $payload.Add('vxlan', $vxlan) } if ( $PSBoundParameters.ContainsKey('Interface') ) { $payload.Add('Interface', $Interface) } if ( $PSBoundParameters.ContainsKey('established') ) { $payload.Add('established', $established) } if ( $PSBoundParameters.ContainsKey('icmptype') ) { $payload.Add('icmptype', $icmptype) } if ( $PSBoundParameters.ContainsKey('icmpcode') ) { $payload.Add('icmpcode', $icmpcode) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('state') ) { $payload.Add('state', $state) } if ( $PSBoundParameters.ContainsKey('logstate') ) { $payload.Add('logstate', $logstate) } if ( $PSBoundParameters.ContainsKey('ratelimit') ) { $payload.Add('ratelimit', $ratelimit) } if ( $PSBoundParameters.ContainsKey('type') ) { $payload.Add('type', $type) } if ( $PSBoundParameters.ContainsKey('dfdhash') ) { $payload.Add('dfdhash', $dfdhash) } if ( $PSBoundParameters.ContainsKey('stateful') ) { $payload.Add('stateful', $stateful) } if ( $PSCmdlet.ShouldProcess("nsacl", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsacl -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNsacl -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNsacl: Finished" } } function Invoke-NSDeleteNsacl { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Configuration for ACL entry resource. .PARAMETER Aclname Name for the extended ACL rule. Must begin with an ASCII alphabetic or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .EXAMPLE PS C:\>Invoke-NSDeleteNsacl -Aclname <string> An example how to delete nsacl config Object(s). .NOTES File Name : Invoke-NSDeleteNsacl Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsacl/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Aclname ) begin { Write-Verbose "Invoke-NSDeleteNsacl: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$aclname", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nsacl -NitroPath nitro/v1/config -Resource $aclname -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNsacl: Finished" } } function Invoke-NSUpdateNsacl { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for ACL entry resource. .PARAMETER Aclname Name for the extended ACL rule. Must begin with an ASCII alphabetic or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER Aclaction Action to perform on incoming IPv4 packets that match the extended ACL rule. Available settings function as follows: * ALLOW - The Citrix ADC processes the packet. * BRIDGE - The Citrix ADC bridges the packet to the destination without processing it. * DENY - The Citrix ADC drops the packet. Possible values = BRIDGE, DENY, ALLOW .PARAMETER Srcip IP address or range of IP addresses to match against the source IP address of an incoming IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 10.102.29.30-10.102.29.189. .PARAMETER Srcipop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Srcipval IP address or range of IP addresses to match against the source IP address of an incoming IPv4 packet. In the command line interface, separate the range with a hyphen. For example:10.102.29.30-10.102.29.189. .PARAMETER Srcport Port number or range of port numbers to match against the source port number of an incoming IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. .PARAMETER Srcportop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Srcportval Port number or range of port numbers to match against the source port number of an incoming IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. .PARAMETER Destip IP address or range of IP addresses to match against the destination IP address of an incoming IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 10.102.29.30-10.102.29.189. .PARAMETER Destipop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Destipval IP address or range of IP addresses to match against the destination IP address of an incoming IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 10.102.29.30-10.102.29.189. .PARAMETER Destport Port number or range of port numbers to match against the destination port number of an incoming IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. Note: The destination port can be specified only for TCP and UDP protocols. .PARAMETER Destportop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Destportval Port number or range of port numbers to match against the destination port number of an incoming IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. Note: The destination port can be specified only for TCP and UDP protocols. .PARAMETER Srcmac MAC address to match against the source MAC address of an incoming IPv4 packet. .PARAMETER Srcmacmask Used to define range of Source MAC address. It takes string of 0 and 1, 0s are for exact match and 1s for wildcard. For matching first 3 bytes of MAC address, srcMacMask value "000000111111". . .PARAMETER Protocol Protocol to match against the protocol of an incoming IPv4 packet. Possible values = ICMP, IGMP, TCP, EGP, IGP, ARGUS, UDP, RDP, RSVP, EIGRP, L2TP, ISIS, GGP, IPoverIP, ST, CBT, BBN-RCC-M, NVP-II, PUP, EMCON, XNET, CHAOS, MUX, DCN-MEAS, HMP, PRM, XNS-IDP, TRUNK-1, TRUNK-2, LEAF-1, LEAF-2, IRTP, ISO-TP4, NETBLT, MFE-NSP, MERIT-INP, SEP, 3PC, IDPR, XTP, DDP, IDPR-CMTP, TP++, IL, IPv6, SDRP, IPv6-Route, IPv6-Frag, IDRP, GRE, MHRP, BNA, ESP, AH, I-NLSP, SWIPE, NARP, MOBILE, TLSP, SKIP, ICMPV6, IPv6-NoNx, IPv6-Opts, Any-Host-Internal-Protocol, CFTP, Any-Local-Network, SAT-EXPAK, KRYPTOLAN, RVD, IPPC, Any-Distributed-File-System, TFTP, VISA, IPCV, CPNX, CPHB, WSN, PVP, BR-SAT-MO, SUN-ND, WB-MON, WB-EXPAK, ISO-IP, VMTP, SECURE-VM, VINES, TTP, NSFNET-IG, DGP, TCF, OSPFIGP, Sprite-RP, LARP, MTP, AX.25, IPIP, MICP, SCC-SP, ETHERIP, Any-Private-Encryption-Scheme, GMTP, IFMP, PNNI, PIM, ARIS, SCPS, QNX, A/N, IPComp, SNP, Compaq-Pe, IPX-in-IP, VRRP, PGM, Any-0-Hop-Protocol, ENCAP, DDX, IATP, STP, SRP, UTI, SMP, SM, PTP, FIRE, CRTP, CRUDP, SSCOPMCE, IPLT, SPS, PIPE, SCTP, FC, RSVP-E2E-IGNORE, Mobility-Header, UDPLite .PARAMETER Protocolnumber Protocol to match against the protocol of an incoming IPv4 packet. Maximum value = 255 .PARAMETER Icmptype ICMP Message type to match against the message type of an incoming ICMP packet. For example, to block DESTINATION UNREACHABLE messages, you must specify 3 as the ICMP type. Note: This parameter can be specified only for the ICMP protocol. Maximum value = 65536 .PARAMETER Icmpcode Code of a particular ICMP message type to match against the ICMP code of an incoming ICMP packet. For example, to block DESTINATION HOST UNREACHABLE messages, specify 3 as the ICMP type and 1 as the ICMP code. If you set this parameter, you must set the ICMP Type parameter. Maximum value = 65536 .PARAMETER Vlan ID of the VLAN. The Citrix ADC applies the ACL rule only to the incoming packets of the specified VLAN. If you do not specify a VLAN ID, the appliance applies the ACL rule to the incoming packets on all VLANs. Maximum value = 4094 .PARAMETER Vxlan ID of the VXLAN. The Citrix ADC applies the ACL rule only to the incoming packets of the specified VXLAN. If you do not specify a VXLAN ID, the appliance applies the ACL rule to the incoming packets on all VXLANs. Maximum value = 16777215 .PARAMETER Interface ID of an interface. The Citrix ADC applies the ACL rule only to the incoming packets from the specified interface. If you do not specify any value, the appliance applies the ACL rule to the incoming packets of all interfaces. .PARAMETER Priority Priority for the extended ACL rule that determines the order in which it is evaluated relative to the other extended ACL rules. If you do not specify priorities while creating extended ACL rules, the ACL rules are evaluated in the order in which they are created. Maximum value = 100000 .PARAMETER Logstate Enable or disable logging of events related to the extended ACL rule. The log messages are stored in the configured syslog or auditlog server. Possible values = ENABLED, DISABLED .PARAMETER Ratelimit Maximum number of log messages to be generated per second. If you set this parameter, you must enable the Log State parameter. Maximum value = 10000 .PARAMETER Established Allow only incoming TCP packets that have the ACK or RST bit set, if the action set for the ACL rule is ALLOW and these packets match the other conditions in the ACL rule. .PARAMETER Dfdhash Specifies the type hashmethod to be applied, to steer the packet to the FP of the packet. Possible values = SIP-SPORT-DIP-DPORT, SIP, DIP, SIP-DIP, SIP-SPORT, DIP-DPORT .PARAMETER Stateful If stateful option is enabled, transparent sessions are created for the traffic hitting this ACL and not hitting any other features like LB, INAT etc. . Possible values = YES, NO .PARAMETER PassThru Return details about the created nsacl item. .EXAMPLE PS C:\>Invoke-NSUpdateNsacl -aclname <string> An example how to update nsacl config Object(s). .NOTES File Name : Invoke-NSUpdateNsacl Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsacl/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Aclname, [ValidateSet('BRIDGE', 'DENY', 'ALLOW')] [string]$Aclaction, [boolean]$Srcip, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Srcipop, [string]$Srcipval, [boolean]$Srcport, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Srcportop, [string]$Srcportval, [boolean]$Destip, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Destipop, [string]$Destipval, [boolean]$Destport, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Destportop, [string]$Destportval, [string]$Srcmac, [string]$Srcmacmask, [ValidateSet('ICMP', 'IGMP', 'TCP', 'EGP', 'IGP', 'ARGUS', 'UDP', 'RDP', 'RSVP', 'EIGRP', 'L2TP', 'ISIS', 'GGP', 'IPoverIP', 'ST', 'CBT', 'BBN-RCC-M', 'NVP-II', 'PUP', 'EMCON', 'XNET', 'CHAOS', 'MUX', 'DCN-MEAS', 'HMP', 'PRM', 'XNS-IDP', 'TRUNK-1', 'TRUNK-2', 'LEAF-1', 'LEAF-2', 'IRTP', 'ISO-TP4', 'NETBLT', 'MFE-NSP', 'MERIT-INP', 'SEP', '3PC', 'IDPR', 'XTP', 'DDP', 'IDPR-CMTP', 'TP++', 'IL', 'IPv6', 'SDRP', 'IPv6-Route', 'IPv6-Frag', 'IDRP', 'GRE', 'MHRP', 'BNA', 'ESP', 'AH', 'I-NLSP', 'SWIPE', 'NARP', 'MOBILE', 'TLSP', 'SKIP', 'ICMPV6', 'IPv6-NoNx', 'IPv6-Opts', 'Any-Host-Internal-Protocol', 'CFTP', 'Any-Local-Network', 'SAT-EXPAK', 'KRYPTOLAN', 'RVD', 'IPPC', 'Any-Distributed-File-System', 'TFTP', 'VISA', 'IPCV', 'CPNX', 'CPHB', 'WSN', 'PVP', 'BR-SAT-MO', 'SUN-ND', 'WB-MON', 'WB-EXPAK', 'ISO-IP', 'VMTP', 'SECURE-VM', 'VINES', 'TTP', 'NSFNET-IG', 'DGP', 'TCF', 'OSPFIGP', 'Sprite-RP', 'LARP', 'MTP', 'AX.25', 'IPIP', 'MICP', 'SCC-SP', 'ETHERIP', 'Any-Private-Encryption-Scheme', 'GMTP', 'IFMP', 'PNNI', 'PIM', 'ARIS', 'SCPS', 'QNX', 'A/N', 'IPComp', 'SNP', 'Compaq-Pe', 'IPX-in-IP', 'VRRP', 'PGM', 'Any-0-Hop-Protocol', 'ENCAP', 'DDX', 'IATP', 'STP', 'SRP', 'UTI', 'SMP', 'SM', 'PTP', 'FIRE', 'CRTP', 'CRUDP', 'SSCOPMCE', 'IPLT', 'SPS', 'PIPE', 'SCTP', 'FC', 'RSVP-E2E-IGNORE', 'Mobility-Header', 'UDPLite')] [string]$Protocol, [double]$Protocolnumber, [double]$Icmptype, [double]$Icmpcode, [double]$Vlan, [double]$Vxlan, [string]$Interface, [double]$Priority, [ValidateSet('ENABLED', 'DISABLED')] [string]$Logstate, [double]$Ratelimit, [boolean]$Established, [ValidateSet('SIP-SPORT-DIP-DPORT', 'SIP', 'DIP', 'SIP-DIP', 'SIP-SPORT', 'DIP-DPORT')] [string]$Dfdhash, [ValidateSet('YES', 'NO')] [string]$Stateful, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateNsacl: Starting" } process { try { $payload = @{ aclname = $aclname } if ( $PSBoundParameters.ContainsKey('aclaction') ) { $payload.Add('aclaction', $aclaction) } if ( $PSBoundParameters.ContainsKey('srcip') ) { $payload.Add('srcip', $srcip) } if ( $PSBoundParameters.ContainsKey('srcipop') ) { $payload.Add('srcipop', $srcipop) } if ( $PSBoundParameters.ContainsKey('srcipval') ) { $payload.Add('srcipval', $srcipval) } if ( $PSBoundParameters.ContainsKey('srcport') ) { $payload.Add('srcport', $srcport) } if ( $PSBoundParameters.ContainsKey('srcportop') ) { $payload.Add('srcportop', $srcportop) } if ( $PSBoundParameters.ContainsKey('srcportval') ) { $payload.Add('srcportval', $srcportval) } if ( $PSBoundParameters.ContainsKey('destip') ) { $payload.Add('destip', $destip) } if ( $PSBoundParameters.ContainsKey('destipop') ) { $payload.Add('destipop', $destipop) } if ( $PSBoundParameters.ContainsKey('destipval') ) { $payload.Add('destipval', $destipval) } if ( $PSBoundParameters.ContainsKey('destport') ) { $payload.Add('destport', $destport) } if ( $PSBoundParameters.ContainsKey('destportop') ) { $payload.Add('destportop', $destportop) } if ( $PSBoundParameters.ContainsKey('destportval') ) { $payload.Add('destportval', $destportval) } if ( $PSBoundParameters.ContainsKey('srcmac') ) { $payload.Add('srcmac', $srcmac) } if ( $PSBoundParameters.ContainsKey('srcmacmask') ) { $payload.Add('srcmacmask', $srcmacmask) } if ( $PSBoundParameters.ContainsKey('protocol') ) { $payload.Add('protocol', $protocol) } if ( $PSBoundParameters.ContainsKey('protocolnumber') ) { $payload.Add('protocolnumber', $protocolnumber) } if ( $PSBoundParameters.ContainsKey('icmptype') ) { $payload.Add('icmptype', $icmptype) } if ( $PSBoundParameters.ContainsKey('icmpcode') ) { $payload.Add('icmpcode', $icmpcode) } if ( $PSBoundParameters.ContainsKey('vlan') ) { $payload.Add('vlan', $vlan) } if ( $PSBoundParameters.ContainsKey('vxlan') ) { $payload.Add('vxlan', $vxlan) } if ( $PSBoundParameters.ContainsKey('Interface') ) { $payload.Add('Interface', $Interface) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('logstate') ) { $payload.Add('logstate', $logstate) } if ( $PSBoundParameters.ContainsKey('ratelimit') ) { $payload.Add('ratelimit', $ratelimit) } if ( $PSBoundParameters.ContainsKey('established') ) { $payload.Add('established', $established) } if ( $PSBoundParameters.ContainsKey('dfdhash') ) { $payload.Add('dfdhash', $dfdhash) } if ( $PSBoundParameters.ContainsKey('stateful') ) { $payload.Add('stateful', $stateful) } if ( $PSCmdlet.ShouldProcess("nsacl", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nsacl -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNsacl -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNsacl: Finished" } } function Invoke-NSUnsetNsacl { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for ACL entry resource. .PARAMETER Aclname Name for the extended ACL rule. Must begin with an ASCII alphabetic or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER Srcip IP address or range of IP addresses to match against the source IP address of an incoming IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 10.102.29.30-10.102.29.189. .PARAMETER Srcport Port number or range of port numbers to match against the source port number of an incoming IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. .PARAMETER Destip IP address or range of IP addresses to match against the destination IP address of an incoming IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 10.102.29.30-10.102.29.189. .PARAMETER Destport Port number or range of port numbers to match against the destination port number of an incoming IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. Note: The destination port can be specified only for TCP and UDP protocols. .PARAMETER Srcmac MAC address to match against the source MAC address of an incoming IPv4 packet. .PARAMETER Srcmacmask Used to define range of Source MAC address. It takes string of 0 and 1, 0s are for exact match and 1s for wildcard. For matching first 3 bytes of MAC address, srcMacMask value "000000111111". . .PARAMETER Protocol Protocol to match against the protocol of an incoming IPv4 packet. Possible values = ICMP, IGMP, TCP, EGP, IGP, ARGUS, UDP, RDP, RSVP, EIGRP, L2TP, ISIS, GGP, IPoverIP, ST, CBT, BBN-RCC-M, NVP-II, PUP, EMCON, XNET, CHAOS, MUX, DCN-MEAS, HMP, PRM, XNS-IDP, TRUNK-1, TRUNK-2, LEAF-1, LEAF-2, IRTP, ISO-TP4, NETBLT, MFE-NSP, MERIT-INP, SEP, 3PC, IDPR, XTP, DDP, IDPR-CMTP, TP++, IL, IPv6, SDRP, IPv6-Route, IPv6-Frag, IDRP, GRE, MHRP, BNA, ESP, AH, I-NLSP, SWIPE, NARP, MOBILE, TLSP, SKIP, ICMPV6, IPv6-NoNx, IPv6-Opts, Any-Host-Internal-Protocol, CFTP, Any-Local-Network, SAT-EXPAK, KRYPTOLAN, RVD, IPPC, Any-Distributed-File-System, TFTP, VISA, IPCV, CPNX, CPHB, WSN, PVP, BR-SAT-MO, SUN-ND, WB-MON, WB-EXPAK, ISO-IP, VMTP, SECURE-VM, VINES, TTP, NSFNET-IG, DGP, TCF, OSPFIGP, Sprite-RP, LARP, MTP, AX.25, IPIP, MICP, SCC-SP, ETHERIP, Any-Private-Encryption-Scheme, GMTP, IFMP, PNNI, PIM, ARIS, SCPS, QNX, A/N, IPComp, SNP, Compaq-Pe, IPX-in-IP, VRRP, PGM, Any-0-Hop-Protocol, ENCAP, DDX, IATP, STP, SRP, UTI, SMP, SM, PTP, FIRE, CRTP, CRUDP, SSCOPMCE, IPLT, SPS, PIPE, SCTP, FC, RSVP-E2E-IGNORE, Mobility-Header, UDPLite .PARAMETER Icmptype ICMP Message type to match against the message type of an incoming ICMP packet. For example, to block DESTINATION UNREACHABLE messages, you must specify 3 as the ICMP type. Note: This parameter can be specified only for the ICMP protocol. Maximum value = 65536 .PARAMETER Icmpcode Code of a particular ICMP message type to match against the ICMP code of an incoming ICMP packet. For example, to block DESTINATION HOST UNREACHABLE messages, specify 3 as the ICMP type and 1 as the ICMP code. If you set this parameter, you must set the ICMP Type parameter. Maximum value = 65536 .PARAMETER Vlan ID of the VLAN. The Citrix ADC applies the ACL rule only to the incoming packets of the specified VLAN. If you do not specify a VLAN ID, the appliance applies the ACL rule to the incoming packets on all VLANs. Maximum value = 4094 .PARAMETER Vxlan ID of the VXLAN. The Citrix ADC applies the ACL rule only to the incoming packets of the specified VXLAN. If you do not specify a VXLAN ID, the appliance applies the ACL rule to the incoming packets on all VXLANs. Maximum value = 16777215 .PARAMETER Interface ID of an interface. The Citrix ADC applies the ACL rule only to the incoming packets from the specified interface. If you do not specify any value, the appliance applies the ACL rule to the incoming packets of all interfaces. .PARAMETER Logstate Enable or disable logging of events related to the extended ACL rule. The log messages are stored in the configured syslog or auditlog server. Possible values = ENABLED, DISABLED .PARAMETER Ratelimit Maximum number of log messages to be generated per second. If you set this parameter, you must enable the Log State parameter. Maximum value = 10000 .PARAMETER Established Allow only incoming TCP packets that have the ACK or RST bit set, if the action set for the ACL rule is ALLOW and these packets match the other conditions in the ACL rule. .PARAMETER Stateful If stateful option is enabled, transparent sessions are created for the traffic hitting this ACL and not hitting any other features like LB, INAT etc. . Possible values = YES, NO .PARAMETER Dfdhash Specifies the type hashmethod to be applied, to steer the packet to the FP of the packet. Possible values = SIP-SPORT-DIP-DPORT, SIP, DIP, SIP-DIP, SIP-SPORT, DIP-DPORT .EXAMPLE PS C:\>Invoke-NSUnsetNsacl -aclname <string> An example how to unset nsacl config Object(s). .NOTES File Name : Invoke-NSUnsetNsacl Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsacl Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Aclname, [Boolean]$srcip, [Boolean]$srcport, [Boolean]$destip, [Boolean]$destport, [Boolean]$srcmac, [Boolean]$srcmacmask, [Boolean]$protocol, [Boolean]$icmptype, [Boolean]$icmpcode, [Boolean]$vlan, [Boolean]$vxlan, [Boolean]$Interface, [Boolean]$logstate, [Boolean]$ratelimit, [Boolean]$established, [Boolean]$stateful, [Boolean]$dfdhash ) begin { Write-Verbose "Invoke-NSUnsetNsacl: Starting" } process { try { $payload = @{ aclname = $aclname } if ( $PSBoundParameters.ContainsKey('srcip') ) { $payload.Add('srcip', $srcip) } if ( $PSBoundParameters.ContainsKey('srcport') ) { $payload.Add('srcport', $srcport) } if ( $PSBoundParameters.ContainsKey('destip') ) { $payload.Add('destip', $destip) } if ( $PSBoundParameters.ContainsKey('destport') ) { $payload.Add('destport', $destport) } if ( $PSBoundParameters.ContainsKey('srcmac') ) { $payload.Add('srcmac', $srcmac) } if ( $PSBoundParameters.ContainsKey('srcmacmask') ) { $payload.Add('srcmacmask', $srcmacmask) } if ( $PSBoundParameters.ContainsKey('protocol') ) { $payload.Add('protocol', $protocol) } if ( $PSBoundParameters.ContainsKey('icmptype') ) { $payload.Add('icmptype', $icmptype) } if ( $PSBoundParameters.ContainsKey('icmpcode') ) { $payload.Add('icmpcode', $icmpcode) } if ( $PSBoundParameters.ContainsKey('vlan') ) { $payload.Add('vlan', $vlan) } if ( $PSBoundParameters.ContainsKey('vxlan') ) { $payload.Add('vxlan', $vxlan) } if ( $PSBoundParameters.ContainsKey('Interface') ) { $payload.Add('Interface', $Interface) } if ( $PSBoundParameters.ContainsKey('logstate') ) { $payload.Add('logstate', $logstate) } if ( $PSBoundParameters.ContainsKey('ratelimit') ) { $payload.Add('ratelimit', $ratelimit) } if ( $PSBoundParameters.ContainsKey('established') ) { $payload.Add('established', $established) } if ( $PSBoundParameters.ContainsKey('stateful') ) { $payload.Add('stateful', $stateful) } if ( $PSBoundParameters.ContainsKey('dfdhash') ) { $payload.Add('dfdhash', $dfdhash) } if ( $PSCmdlet.ShouldProcess("$aclname", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nsacl -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNsacl: Finished" } } function Invoke-NSEnableNsacl { <# .SYNOPSIS Enable System/Global level configuration. config Object. .DESCRIPTION Configuration for ACL entry resource. .PARAMETER Aclname Name for the extended ACL rule. Must begin with an ASCII alphabetic or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .EXAMPLE PS C:\>Invoke-NSEnableNsacl -aclname <string> An example how to enable nsacl config Object(s). .NOTES File Name : Invoke-NSEnableNsacl Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsacl/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Aclname ) begin { Write-Verbose "Invoke-NSEnableNsacl: Starting" } process { try { $payload = @{ aclname = $aclname } if ( $PSCmdlet.ShouldProcess($Name, "Enable System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsacl -Action enable -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSEnableNsacl: Finished" } } function Invoke-NSDisableNsacl { <# .SYNOPSIS Disable System/Global level configuration. config Object. .DESCRIPTION Configuration for ACL entry resource. .PARAMETER Aclname Name for the extended ACL rule. Must begin with an ASCII alphabetic or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .EXAMPLE PS C:\>Invoke-NSDisableNsacl -aclname <string> An example how to disable nsacl config Object(s). .NOTES File Name : Invoke-NSDisableNsacl Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsacl/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Aclname ) begin { Write-Verbose "Invoke-NSDisableNsacl: Starting" } process { try { $payload = @{ aclname = $aclname } if ( $PSCmdlet.ShouldProcess($Name, "Disable System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsacl -Action disable -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDisableNsacl: Finished" } } function Invoke-NSRenameNsacl { <# .SYNOPSIS Rename System/Global level configuration. config Object. .DESCRIPTION Configuration for ACL entry resource. .PARAMETER Aclname Name for the extended ACL rule. Must begin with an ASCII alphabetic or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER Newname New name for the extended ACL rule. Must begin with an ASCII alphabetic or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER PassThru Return details about the created nsacl item. .EXAMPLE PS C:\>Invoke-NSRenameNsacl -aclname <string> -newname <string> An example how to rename nsacl config Object(s). .NOTES File Name : Invoke-NSRenameNsacl Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsacl/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Aclname, [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Newname, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSRenameNsacl: Starting" } process { try { $payload = @{ aclname = $aclname newname = $newname } if ( $PSCmdlet.ShouldProcess("nsacl", "Rename System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsacl -Action rename -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNsacl -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSRenameNsacl: Finished" } } function Invoke-NSGetNsacl { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for ACL entry resource. .PARAMETER Aclname Name for the extended ACL rule. Must begin with an ASCII alphabetic or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER GetAll Retrieve all nsacl object(s). .PARAMETER Count If specified, the count of the nsacl object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsacl Get data. .EXAMPLE PS C:\>Invoke-NSGetNsacl -GetAll Get all nsacl data. .EXAMPLE PS C:\>Invoke-NSGetNsacl -Count Get the number of nsacl objects. .EXAMPLE PS C:\>Invoke-NSGetNsacl -name <string> Get nsacl object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsacl -Filter @{ 'name'='<value>' } Get nsacl data with a filter. .NOTES File Name : Invoke-NSGetNsacl Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsacl/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Aclname, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNsacl: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsacl objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsacl -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsacl objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsacl -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsacl objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsacl -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsacl configuration for property 'aclname'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsacl -NitroPath nitro/v1/config -Resource $aclname -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nsacl configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsacl -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsacl: Ended" } } function Invoke-NSAddNsacl6 { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Configuration for ACL6 entry resource. .PARAMETER Acl6name Name for the ACL6 rule. Must begin with an ASCII alphabetic or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER Acl6action Action to perform on the incoming IPv6 packets that match the ACL6 rule. Available settings function as follows: * ALLOW - The Citrix ADC processes the packet. * BRIDGE - The Citrix ADC bridges the packet to the destination without processing it. * DENY - The Citrix ADC drops the packet. Possible values = BRIDGE, DENY, ALLOW .PARAMETER Td Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0. Maximum value = 4094 .PARAMETER Srcipv6 IP address or range of IP addresses to match against the source IP address of an incoming IPv6 packet. In the command line interface, separate the range with a hyphen. .PARAMETER Srcipop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Srcipv6val Source IPv6 address (range). .PARAMETER Srcport Port number or range of port numbers to match against the source port number of an incoming IPv6 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. Note: The destination port can be specified only for TCP and UDP protocols. .PARAMETER Srcportop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Srcportval Source port (range). .PARAMETER Destipv6 IP address or range of IP addresses to match against the destination IP address of an incoming IPv6 packet. In the command line interface, separate the range with a hyphen. .PARAMETER Destipop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Destipv6val Destination IPv6 address (range). .PARAMETER Destport Port number or range of port numbers to match against the destination port number of an incoming IPv6 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. Note: The destination port can be specified only for TCP and UDP protocols. .PARAMETER Destportop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Destportval Destination port (range). .PARAMETER Ttl Time to expire this ACL6 (in seconds). Maximum value = 2147483647 .PARAMETER Srcmac MAC address to match against the source MAC address of an incoming IPv6 packet. .PARAMETER Srcmacmask Used to define range of Source MAC address. It takes string of 0 and 1, 0s are for exact match and 1s for wildcard. For matching first 3 bytes of MAC address, srcMacMask value "000000111111". . .PARAMETER Protocol Protocol, identified by protocol name, to match against the protocol of an incoming IPv6 packet. Possible values = ICMPV6, TCP, UDP, ICMP, IGMP, EGP, IGP, ARGUS, RDP, RSVP, EIGRP, L2TP, ISIS, GGP, IPoverIP, ST, CBT, BBN-RCC-M, NVP-II, PUP, EMCON, XNET, CHAOS, MUX, DCN-MEAS, HMP, PRM, XNS-IDP, TRUNK-1, TRUNK-2, LEAF-1, LEAF-2, IRTP, ISO-TP4, NETBLT, MFE-NSP, MERIT-INP, SEP, 3PC, IDPR, XTP, DDP, IDPR-CMTP, TP++, IL, IPv6, SDRP, IPv6-Route, IPv6-Frag, IDRP, GRE, MHRP, BNA, ESP, AH, I-NLSP, SWIPE, NARP, MOBILE, TLSP, SKIP, IPv6-NoNx, IPv6-Opts, Any-Host-Internal-Protocol, CFTP, Any-Local-Network, SAT-EXPAK, KRYPTOLAN, RVD, IPPC, Any-Distributed-File-System, TFTP, VISA, IPCV, CPNX, CPHB, WSN, PVP, BR-SAT-MO, SUN-ND, WB-MON, WB-EXPAK, ISO-IP, VMTP, SECURE-VM, VINES, TTP, NSFNET-IG, DGP, TCF, OSPFIGP, Sprite-RP, LARP, MTP, AX.25, IPIP, MICP, SCC-SP, ETHERIP, Any-Private-Encryption-Scheme, GMTP, IFMP, PNNI, PIM, ARIS, SCPS, QNX, A/N, IPComp, SNP, Compaq-Pe, IPX-in-IP, VRRP, PGM, Any-0-Hop-Protocol, ENCAP, DDX, IATP, STP, SRP, UTI, SMP, SM, PTP, FIRE, CRTP, CRUDP, SSCOPMCE, IPLT, SPS, PIPE, SCTP, FC, RSVP-E2E-IGNORE, Mobility-Header, UDPLite .PARAMETER Protocolnumber Protocol, identified by protocol number, to match against the protocol of an incoming IPv6 packet. Maximum value = 255 .PARAMETER Vlan ID of the VLAN. The Citrix ADC applies the ACL6 rule only to the incoming packets on the specified VLAN. If you do not specify a VLAN ID, the appliance applies the ACL6 rule to the incoming packets on all VLANs. Maximum value = 4094 .PARAMETER Vxlan ID of the VXLAN. The Citrix ADC applies the ACL6 rule only to the incoming packets on the specified VXLAN. If you do not specify a VXLAN ID, the appliance applies the ACL6 rule to the incoming packets on all VXLANs. Maximum value = 16777215 .PARAMETER Interface ID of an interface. The Citrix ADC applies the ACL6 rule only to the incoming packets from the specified interface. If you do not specify any value, the appliance applies the ACL6 rule to the incoming packets from all interfaces. .PARAMETER Established Allow only incoming TCP packets that have the ACK or RST bit set if the action set for the ACL6 rule is ALLOW and these packets match the other conditions in the ACL6 rule. .PARAMETER Icmptype ICMP Message type to match against the message type of an incoming IPv6 ICMP packet. For example, to block DESTINATION UNREACHABLE messages, you must specify 3 as the ICMP type. Note: This parameter can be specified only for the ICMP protocol. Maximum value = 65536 .PARAMETER Icmpcode Code of a particular ICMP message type to match against the ICMP code of an incoming IPv6 ICMP packet. For example, to block DESTINATION HOST UNREACHABLE messages, specify 3 as the ICMP type and 1 as the ICMP code. If you set this parameter, you must set the ICMP Type parameter. Maximum value = 65536 .PARAMETER Priority Priority for the ACL6 rule, which determines the order in which it is evaluated relative to the other ACL6 rules. If you do not specify priorities while creating ACL6 rules, the ACL6 rules are evaluated in the order in which they are created. Maximum value = 81920 .PARAMETER State State of the ACL6. Possible values = ENABLED, DISABLED .PARAMETER Type Type of the acl6,default will be CLASSIC. Available options as follows: * CLASSIC - specifies the regular extended acls. * DFD - cluster specific acls,specifies hashmethod for steering of the packet in cluster . Possible values = CLASSIC, DFD .PARAMETER Dfdhash Specifies the type of hashmethod to be applied, to steer the packet to the FP of the packet. Possible values = SIP-SPORT-DIP-DPORT, SIP, DIP, SIP-DIP, SIP-SPORT, DIP-DPORT .PARAMETER Dfdprefix hashprefix to be applied to SIP/DIP to generate rsshash FP.eg 128 => hash calculated on the complete IP. Maximum value = 128 .PARAMETER Stateful If stateful option is enabled, transparent sessions are created for the traffic hitting this ACL6 and not hitting any other features like LB, INAT etc. . Possible values = YES, NO .PARAMETER Logstate Enable or disable logging of events related to the ACL6 rule. The log messages are stored in the configured syslog or auditlog server. Possible values = ENABLED, DISABLED .PARAMETER Ratelimit Maximum number of log messages to be generated per second. If you set this parameter, you must enable the Log State parameter. Maximum value = 10000 .PARAMETER PassThru Return details about the created nsacl6 item. .EXAMPLE PS C:\>Invoke-NSAddNsacl6 -acl6name <string> -acl6action <string> An example how to add nsacl6 config Object(s). .NOTES File Name : Invoke-NSAddNsacl6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsacl6/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Acl6name, [Parameter(Mandatory)] [ValidateSet('BRIDGE', 'DENY', 'ALLOW')] [string]$Acl6action, [double]$Td, [boolean]$Srcipv6, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Srcipop, [string]$Srcipv6val, [boolean]$Srcport, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Srcportop, [string]$Srcportval, [boolean]$Destipv6, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Destipop, [string]$Destipv6val, [boolean]$Destport, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Destportop, [string]$Destportval, [double]$Ttl, [string]$Srcmac, [string]$Srcmacmask = '"000000000000"', [ValidateSet('ICMPV6', 'TCP', 'UDP', 'ICMP', 'IGMP', 'EGP', 'IGP', 'ARGUS', 'RDP', 'RSVP', 'EIGRP', 'L2TP', 'ISIS', 'GGP', 'IPoverIP', 'ST', 'CBT', 'BBN-RCC-M', 'NVP-II', 'PUP', 'EMCON', 'XNET', 'CHAOS', 'MUX', 'DCN-MEAS', 'HMP', 'PRM', 'XNS-IDP', 'TRUNK-1', 'TRUNK-2', 'LEAF-1', 'LEAF-2', 'IRTP', 'ISO-TP4', 'NETBLT', 'MFE-NSP', 'MERIT-INP', 'SEP', '3PC', 'IDPR', 'XTP', 'DDP', 'IDPR-CMTP', 'TP++', 'IL', 'IPv6', 'SDRP', 'IPv6-Route', 'IPv6-Frag', 'IDRP', 'GRE', 'MHRP', 'BNA', 'ESP', 'AH', 'I-NLSP', 'SWIPE', 'NARP', 'MOBILE', 'TLSP', 'SKIP', 'IPv6-NoNx', 'IPv6-Opts', 'Any-Host-Internal-Protocol', 'CFTP', 'Any-Local-Network', 'SAT-EXPAK', 'KRYPTOLAN', 'RVD', 'IPPC', 'Any-Distributed-File-System', 'TFTP', 'VISA', 'IPCV', 'CPNX', 'CPHB', 'WSN', 'PVP', 'BR-SAT-MO', 'SUN-ND', 'WB-MON', 'WB-EXPAK', 'ISO-IP', 'VMTP', 'SECURE-VM', 'VINES', 'TTP', 'NSFNET-IG', 'DGP', 'TCF', 'OSPFIGP', 'Sprite-RP', 'LARP', 'MTP', 'AX.25', 'IPIP', 'MICP', 'SCC-SP', 'ETHERIP', 'Any-Private-Encryption-Scheme', 'GMTP', 'IFMP', 'PNNI', 'PIM', 'ARIS', 'SCPS', 'QNX', 'A/N', 'IPComp', 'SNP', 'Compaq-Pe', 'IPX-in-IP', 'VRRP', 'PGM', 'Any-0-Hop-Protocol', 'ENCAP', 'DDX', 'IATP', 'STP', 'SRP', 'UTI', 'SMP', 'SM', 'PTP', 'FIRE', 'CRTP', 'CRUDP', 'SSCOPMCE', 'IPLT', 'SPS', 'PIPE', 'SCTP', 'FC', 'RSVP-E2E-IGNORE', 'Mobility-Header', 'UDPLite')] [string]$Protocol, [double]$Protocolnumber, [double]$Vlan, [double]$Vxlan, [string]$Interface, [boolean]$Established, [double]$Icmptype, [double]$Icmpcode, [double]$Priority, [ValidateSet('ENABLED', 'DISABLED')] [string]$State = 'ENABLED', [ValidateSet('CLASSIC', 'DFD')] [string]$Type = 'CLASSIC', [ValidateSet('SIP-SPORT-DIP-DPORT', 'SIP', 'DIP', 'SIP-DIP', 'SIP-SPORT', 'DIP-DPORT')] [string]$Dfdhash, [double]$Dfdprefix = '128', [ValidateSet('YES', 'NO')] [string]$Stateful = 'NO', [ValidateSet('ENABLED', 'DISABLED')] [string]$Logstate = 'DISABLED', [double]$Ratelimit = '100', [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNsacl6: Starting" } process { try { $payload = @{ acl6name = $acl6name acl6action = $acl6action } if ( $PSBoundParameters.ContainsKey('td') ) { $payload.Add('td', $td) } if ( $PSBoundParameters.ContainsKey('srcipv6') ) { $payload.Add('srcipv6', $srcipv6) } if ( $PSBoundParameters.ContainsKey('srcipop') ) { $payload.Add('srcipop', $srcipop) } if ( $PSBoundParameters.ContainsKey('srcipv6val') ) { $payload.Add('srcipv6val', $srcipv6val) } if ( $PSBoundParameters.ContainsKey('srcport') ) { $payload.Add('srcport', $srcport) } if ( $PSBoundParameters.ContainsKey('srcportop') ) { $payload.Add('srcportop', $srcportop) } if ( $PSBoundParameters.ContainsKey('srcportval') ) { $payload.Add('srcportval', $srcportval) } if ( $PSBoundParameters.ContainsKey('destipv6') ) { $payload.Add('destipv6', $destipv6) } if ( $PSBoundParameters.ContainsKey('destipop') ) { $payload.Add('destipop', $destipop) } if ( $PSBoundParameters.ContainsKey('destipv6val') ) { $payload.Add('destipv6val', $destipv6val) } if ( $PSBoundParameters.ContainsKey('destport') ) { $payload.Add('destport', $destport) } if ( $PSBoundParameters.ContainsKey('destportop') ) { $payload.Add('destportop', $destportop) } if ( $PSBoundParameters.ContainsKey('destportval') ) { $payload.Add('destportval', $destportval) } if ( $PSBoundParameters.ContainsKey('ttl') ) { $payload.Add('ttl', $ttl) } if ( $PSBoundParameters.ContainsKey('srcmac') ) { $payload.Add('srcmac', $srcmac) } if ( $PSBoundParameters.ContainsKey('srcmacmask') ) { $payload.Add('srcmacmask', $srcmacmask) } if ( $PSBoundParameters.ContainsKey('protocol') ) { $payload.Add('protocol', $protocol) } if ( $PSBoundParameters.ContainsKey('protocolnumber') ) { $payload.Add('protocolnumber', $protocolnumber) } if ( $PSBoundParameters.ContainsKey('vlan') ) { $payload.Add('vlan', $vlan) } if ( $PSBoundParameters.ContainsKey('vxlan') ) { $payload.Add('vxlan', $vxlan) } if ( $PSBoundParameters.ContainsKey('Interface') ) { $payload.Add('Interface', $Interface) } if ( $PSBoundParameters.ContainsKey('established') ) { $payload.Add('established', $established) } if ( $PSBoundParameters.ContainsKey('icmptype') ) { $payload.Add('icmptype', $icmptype) } if ( $PSBoundParameters.ContainsKey('icmpcode') ) { $payload.Add('icmpcode', $icmpcode) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('state') ) { $payload.Add('state', $state) } if ( $PSBoundParameters.ContainsKey('type') ) { $payload.Add('type', $type) } if ( $PSBoundParameters.ContainsKey('dfdhash') ) { $payload.Add('dfdhash', $dfdhash) } if ( $PSBoundParameters.ContainsKey('dfdprefix') ) { $payload.Add('dfdprefix', $dfdprefix) } if ( $PSBoundParameters.ContainsKey('stateful') ) { $payload.Add('stateful', $stateful) } if ( $PSBoundParameters.ContainsKey('logstate') ) { $payload.Add('logstate', $logstate) } if ( $PSBoundParameters.ContainsKey('ratelimit') ) { $payload.Add('ratelimit', $ratelimit) } if ( $PSCmdlet.ShouldProcess("nsacl6", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsacl6 -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNsacl6 -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNsacl6: Finished" } } function Invoke-NSDeleteNsacl6 { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Configuration for ACL6 entry resource. .PARAMETER Acl6name Name for the ACL6 rule. Must begin with an ASCII alphabetic or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .EXAMPLE PS C:\>Invoke-NSDeleteNsacl6 -Acl6name <string> An example how to delete nsacl6 config Object(s). .NOTES File Name : Invoke-NSDeleteNsacl6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsacl6/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Acl6name ) begin { Write-Verbose "Invoke-NSDeleteNsacl6: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$acl6name", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nsacl6 -NitroPath nitro/v1/config -Resource $acl6name -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNsacl6: Finished" } } function Invoke-NSUpdateNsacl6 { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for ACL6 entry resource. .PARAMETER Acl6name Name for the ACL6 rule. Must begin with an ASCII alphabetic or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER Aclaction Action associated with the ACL6. Possible values = BRIDGE, DENY, ALLOW .PARAMETER Srcipv6 IP address or range of IP addresses to match against the source IP address of an incoming IPv6 packet. In the command line interface, separate the range with a hyphen. .PARAMETER Srcipop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Srcipv6val Source IPv6 address (range). .PARAMETER Srcport Port number or range of port numbers to match against the source port number of an incoming IPv6 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. Note: The destination port can be specified only for TCP and UDP protocols. .PARAMETER Srcportop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Srcportval Source port (range). .PARAMETER Destipv6 IP address or range of IP addresses to match against the destination IP address of an incoming IPv6 packet. In the command line interface, separate the range with a hyphen. .PARAMETER Destipop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Destipv6val Destination IPv6 address (range). .PARAMETER Destport Port number or range of port numbers to match against the destination port number of an incoming IPv6 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. Note: The destination port can be specified only for TCP and UDP protocols. .PARAMETER Destportop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Destportval Destination port (range). .PARAMETER Srcmac MAC address to match against the source MAC address of an incoming IPv6 packet. .PARAMETER Srcmacmask Used to define range of Source MAC address. It takes string of 0 and 1, 0s are for exact match and 1s for wildcard. For matching first 3 bytes of MAC address, srcMacMask value "000000111111". . .PARAMETER Protocol Protocol, identified by protocol name, to match against the protocol of an incoming IPv6 packet. Possible values = ICMPV6, TCP, UDP, ICMP, IGMP, EGP, IGP, ARGUS, RDP, RSVP, EIGRP, L2TP, ISIS, GGP, IPoverIP, ST, CBT, BBN-RCC-M, NVP-II, PUP, EMCON, XNET, CHAOS, MUX, DCN-MEAS, HMP, PRM, XNS-IDP, TRUNK-1, TRUNK-2, LEAF-1, LEAF-2, IRTP, ISO-TP4, NETBLT, MFE-NSP, MERIT-INP, SEP, 3PC, IDPR, XTP, DDP, IDPR-CMTP, TP++, IL, IPv6, SDRP, IPv6-Route, IPv6-Frag, IDRP, GRE, MHRP, BNA, ESP, AH, I-NLSP, SWIPE, NARP, MOBILE, TLSP, SKIP, IPv6-NoNx, IPv6-Opts, Any-Host-Internal-Protocol, CFTP, Any-Local-Network, SAT-EXPAK, KRYPTOLAN, RVD, IPPC, Any-Distributed-File-System, TFTP, VISA, IPCV, CPNX, CPHB, WSN, PVP, BR-SAT-MO, SUN-ND, WB-MON, WB-EXPAK, ISO-IP, VMTP, SECURE-VM, VINES, TTP, NSFNET-IG, DGP, TCF, OSPFIGP, Sprite-RP, LARP, MTP, AX.25, IPIP, MICP, SCC-SP, ETHERIP, Any-Private-Encryption-Scheme, GMTP, IFMP, PNNI, PIM, ARIS, SCPS, QNX, A/N, IPComp, SNP, Compaq-Pe, IPX-in-IP, VRRP, PGM, Any-0-Hop-Protocol, ENCAP, DDX, IATP, STP, SRP, UTI, SMP, SM, PTP, FIRE, CRTP, CRUDP, SSCOPMCE, IPLT, SPS, PIPE, SCTP, FC, RSVP-E2E-IGNORE, Mobility-Header, UDPLite .PARAMETER Protocolnumber Protocol, identified by protocol number, to match against the protocol of an incoming IPv6 packet. Maximum value = 255 .PARAMETER Icmptype ICMP Message type to match against the message type of an incoming IPv6 ICMP packet. For example, to block DESTINATION UNREACHABLE messages, you must specify 3 as the ICMP type. Note: This parameter can be specified only for the ICMP protocol. Maximum value = 65536 .PARAMETER Icmpcode Code of a particular ICMP message type to match against the ICMP code of an incoming IPv6 ICMP packet. For example, to block DESTINATION HOST UNREACHABLE messages, specify 3 as the ICMP type and 1 as the ICMP code. If you set this parameter, you must set the ICMP Type parameter. Maximum value = 65536 .PARAMETER Vlan ID of the VLAN. The Citrix ADC applies the ACL6 rule only to the incoming packets on the specified VLAN. If you do not specify a VLAN ID, the appliance applies the ACL6 rule to the incoming packets on all VLANs. Maximum value = 4094 .PARAMETER Vxlan ID of the VXLAN. The Citrix ADC applies the ACL6 rule only to the incoming packets on the specified VXLAN. If you do not specify a VXLAN ID, the appliance applies the ACL6 rule to the incoming packets on all VXLANs. Maximum value = 16777215 .PARAMETER Interface ID of an interface. The Citrix ADC applies the ACL6 rule only to the incoming packets from the specified interface. If you do not specify any value, the appliance applies the ACL6 rule to the incoming packets from all interfaces. .PARAMETER Priority Priority for the ACL6 rule, which determines the order in which it is evaluated relative to the other ACL6 rules. If you do not specify priorities while creating ACL6 rules, the ACL6 rules are evaluated in the order in which they are created. Maximum value = 81920 .PARAMETER Logstate Enable or disable logging of events related to the ACL6 rule. The log messages are stored in the configured syslog or auditlog server. Possible values = ENABLED, DISABLED .PARAMETER Ratelimit Maximum number of log messages to be generated per second. If you set this parameter, you must enable the Log State parameter. Maximum value = 10000 .PARAMETER Established Allow only incoming TCP packets that have the ACK or RST bit set if the action set for the ACL6 rule is ALLOW and these packets match the other conditions in the ACL6 rule. .PARAMETER Dfdhash Specifies the type of hashmethod to be applied, to steer the packet to the FP of the packet. Possible values = SIP-SPORT-DIP-DPORT, SIP, DIP, SIP-DIP, SIP-SPORT, DIP-DPORT .PARAMETER Dfdprefix hashprefix to be applied to SIP/DIP to generate rsshash FP.eg 128 => hash calculated on the complete IP. Maximum value = 128 .PARAMETER Stateful If stateful option is enabled, transparent sessions are created for the traffic hitting this ACL6 and not hitting any other features like LB, INAT etc. . Possible values = YES, NO .PARAMETER PassThru Return details about the created nsacl6 item. .EXAMPLE PS C:\>Invoke-NSUpdateNsacl6 -acl6name <string> An example how to update nsacl6 config Object(s). .NOTES File Name : Invoke-NSUpdateNsacl6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsacl6/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Acl6name, [ValidateSet('BRIDGE', 'DENY', 'ALLOW')] [string]$Aclaction, [boolean]$Srcipv6, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Srcipop, [string]$Srcipv6val, [boolean]$Srcport, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Srcportop, [string]$Srcportval, [boolean]$Destipv6, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Destipop, [string]$Destipv6val, [boolean]$Destport, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Destportop, [string]$Destportval, [string]$Srcmac, [string]$Srcmacmask, [ValidateSet('ICMPV6', 'TCP', 'UDP', 'ICMP', 'IGMP', 'EGP', 'IGP', 'ARGUS', 'RDP', 'RSVP', 'EIGRP', 'L2TP', 'ISIS', 'GGP', 'IPoverIP', 'ST', 'CBT', 'BBN-RCC-M', 'NVP-II', 'PUP', 'EMCON', 'XNET', 'CHAOS', 'MUX', 'DCN-MEAS', 'HMP', 'PRM', 'XNS-IDP', 'TRUNK-1', 'TRUNK-2', 'LEAF-1', 'LEAF-2', 'IRTP', 'ISO-TP4', 'NETBLT', 'MFE-NSP', 'MERIT-INP', 'SEP', '3PC', 'IDPR', 'XTP', 'DDP', 'IDPR-CMTP', 'TP++', 'IL', 'IPv6', 'SDRP', 'IPv6-Route', 'IPv6-Frag', 'IDRP', 'GRE', 'MHRP', 'BNA', 'ESP', 'AH', 'I-NLSP', 'SWIPE', 'NARP', 'MOBILE', 'TLSP', 'SKIP', 'IPv6-NoNx', 'IPv6-Opts', 'Any-Host-Internal-Protocol', 'CFTP', 'Any-Local-Network', 'SAT-EXPAK', 'KRYPTOLAN', 'RVD', 'IPPC', 'Any-Distributed-File-System', 'TFTP', 'VISA', 'IPCV', 'CPNX', 'CPHB', 'WSN', 'PVP', 'BR-SAT-MO', 'SUN-ND', 'WB-MON', 'WB-EXPAK', 'ISO-IP', 'VMTP', 'SECURE-VM', 'VINES', 'TTP', 'NSFNET-IG', 'DGP', 'TCF', 'OSPFIGP', 'Sprite-RP', 'LARP', 'MTP', 'AX.25', 'IPIP', 'MICP', 'SCC-SP', 'ETHERIP', 'Any-Private-Encryption-Scheme', 'GMTP', 'IFMP', 'PNNI', 'PIM', 'ARIS', 'SCPS', 'QNX', 'A/N', 'IPComp', 'SNP', 'Compaq-Pe', 'IPX-in-IP', 'VRRP', 'PGM', 'Any-0-Hop-Protocol', 'ENCAP', 'DDX', 'IATP', 'STP', 'SRP', 'UTI', 'SMP', 'SM', 'PTP', 'FIRE', 'CRTP', 'CRUDP', 'SSCOPMCE', 'IPLT', 'SPS', 'PIPE', 'SCTP', 'FC', 'RSVP-E2E-IGNORE', 'Mobility-Header', 'UDPLite')] [string]$Protocol, [double]$Protocolnumber, [double]$Icmptype, [double]$Icmpcode, [double]$Vlan, [double]$Vxlan, [string]$Interface, [double]$Priority, [ValidateSet('ENABLED', 'DISABLED')] [string]$Logstate, [double]$Ratelimit, [boolean]$Established, [ValidateSet('SIP-SPORT-DIP-DPORT', 'SIP', 'DIP', 'SIP-DIP', 'SIP-SPORT', 'DIP-DPORT')] [string]$Dfdhash, [double]$Dfdprefix, [ValidateSet('YES', 'NO')] [string]$Stateful, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateNsacl6: Starting" } process { try { $payload = @{ acl6name = $acl6name } if ( $PSBoundParameters.ContainsKey('aclaction') ) { $payload.Add('aclaction', $aclaction) } if ( $PSBoundParameters.ContainsKey('srcipv6') ) { $payload.Add('srcipv6', $srcipv6) } if ( $PSBoundParameters.ContainsKey('srcipop') ) { $payload.Add('srcipop', $srcipop) } if ( $PSBoundParameters.ContainsKey('srcipv6val') ) { $payload.Add('srcipv6val', $srcipv6val) } if ( $PSBoundParameters.ContainsKey('srcport') ) { $payload.Add('srcport', $srcport) } if ( $PSBoundParameters.ContainsKey('srcportop') ) { $payload.Add('srcportop', $srcportop) } if ( $PSBoundParameters.ContainsKey('srcportval') ) { $payload.Add('srcportval', $srcportval) } if ( $PSBoundParameters.ContainsKey('destipv6') ) { $payload.Add('destipv6', $destipv6) } if ( $PSBoundParameters.ContainsKey('destipop') ) { $payload.Add('destipop', $destipop) } if ( $PSBoundParameters.ContainsKey('destipv6val') ) { $payload.Add('destipv6val', $destipv6val) } if ( $PSBoundParameters.ContainsKey('destport') ) { $payload.Add('destport', $destport) } if ( $PSBoundParameters.ContainsKey('destportop') ) { $payload.Add('destportop', $destportop) } if ( $PSBoundParameters.ContainsKey('destportval') ) { $payload.Add('destportval', $destportval) } if ( $PSBoundParameters.ContainsKey('srcmac') ) { $payload.Add('srcmac', $srcmac) } if ( $PSBoundParameters.ContainsKey('srcmacmask') ) { $payload.Add('srcmacmask', $srcmacmask) } if ( $PSBoundParameters.ContainsKey('protocol') ) { $payload.Add('protocol', $protocol) } if ( $PSBoundParameters.ContainsKey('protocolnumber') ) { $payload.Add('protocolnumber', $protocolnumber) } if ( $PSBoundParameters.ContainsKey('icmptype') ) { $payload.Add('icmptype', $icmptype) } if ( $PSBoundParameters.ContainsKey('icmpcode') ) { $payload.Add('icmpcode', $icmpcode) } if ( $PSBoundParameters.ContainsKey('vlan') ) { $payload.Add('vlan', $vlan) } if ( $PSBoundParameters.ContainsKey('vxlan') ) { $payload.Add('vxlan', $vxlan) } if ( $PSBoundParameters.ContainsKey('Interface') ) { $payload.Add('Interface', $Interface) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('logstate') ) { $payload.Add('logstate', $logstate) } if ( $PSBoundParameters.ContainsKey('ratelimit') ) { $payload.Add('ratelimit', $ratelimit) } if ( $PSBoundParameters.ContainsKey('established') ) { $payload.Add('established', $established) } if ( $PSBoundParameters.ContainsKey('dfdhash') ) { $payload.Add('dfdhash', $dfdhash) } if ( $PSBoundParameters.ContainsKey('dfdprefix') ) { $payload.Add('dfdprefix', $dfdprefix) } if ( $PSBoundParameters.ContainsKey('stateful') ) { $payload.Add('stateful', $stateful) } if ( $PSCmdlet.ShouldProcess("nsacl6", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nsacl6 -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNsacl6 -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNsacl6: Finished" } } function Invoke-NSUnsetNsacl6 { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for ACL6 entry resource. .PARAMETER Acl6name Name for the ACL6 rule. Must begin with an ASCII alphabetic or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER Srcipv6 IP address or range of IP addresses to match against the source IP address of an incoming IPv6 packet. In the command line interface, separate the range with a hyphen. .PARAMETER Srcport Port number or range of port numbers to match against the source port number of an incoming IPv6 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. Note: The destination port can be specified only for TCP and UDP protocols. .PARAMETER Destipv6 IP address or range of IP addresses to match against the destination IP address of an incoming IPv6 packet. In the command line interface, separate the range with a hyphen. .PARAMETER Destport Port number or range of port numbers to match against the destination port number of an incoming IPv6 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. Note: The destination port can be specified only for TCP and UDP protocols. .PARAMETER Srcmac MAC address to match against the source MAC address of an incoming IPv6 packet. .PARAMETER Srcmacmask Used to define range of Source MAC address. It takes string of 0 and 1, 0s are for exact match and 1s for wildcard. For matching first 3 bytes of MAC address, srcMacMask value "000000111111". . .PARAMETER Protocol Protocol, identified by protocol name, to match against the protocol of an incoming IPv6 packet. Possible values = ICMPV6, TCP, UDP, ICMP, IGMP, EGP, IGP, ARGUS, RDP, RSVP, EIGRP, L2TP, ISIS, GGP, IPoverIP, ST, CBT, BBN-RCC-M, NVP-II, PUP, EMCON, XNET, CHAOS, MUX, DCN-MEAS, HMP, PRM, XNS-IDP, TRUNK-1, TRUNK-2, LEAF-1, LEAF-2, IRTP, ISO-TP4, NETBLT, MFE-NSP, MERIT-INP, SEP, 3PC, IDPR, XTP, DDP, IDPR-CMTP, TP++, IL, IPv6, SDRP, IPv6-Route, IPv6-Frag, IDRP, GRE, MHRP, BNA, ESP, AH, I-NLSP, SWIPE, NARP, MOBILE, TLSP, SKIP, IPv6-NoNx, IPv6-Opts, Any-Host-Internal-Protocol, CFTP, Any-Local-Network, SAT-EXPAK, KRYPTOLAN, RVD, IPPC, Any-Distributed-File-System, TFTP, VISA, IPCV, CPNX, CPHB, WSN, PVP, BR-SAT-MO, SUN-ND, WB-MON, WB-EXPAK, ISO-IP, VMTP, SECURE-VM, VINES, TTP, NSFNET-IG, DGP, TCF, OSPFIGP, Sprite-RP, LARP, MTP, AX.25, IPIP, MICP, SCC-SP, ETHERIP, Any-Private-Encryption-Scheme, GMTP, IFMP, PNNI, PIM, ARIS, SCPS, QNX, A/N, IPComp, SNP, Compaq-Pe, IPX-in-IP, VRRP, PGM, Any-0-Hop-Protocol, ENCAP, DDX, IATP, STP, SRP, UTI, SMP, SM, PTP, FIRE, CRTP, CRUDP, SSCOPMCE, IPLT, SPS, PIPE, SCTP, FC, RSVP-E2E-IGNORE, Mobility-Header, UDPLite .PARAMETER Icmptype ICMP Message type to match against the message type of an incoming IPv6 ICMP packet. For example, to block DESTINATION UNREACHABLE messages, you must specify 3 as the ICMP type. Note: This parameter can be specified only for the ICMP protocol. Maximum value = 65536 .PARAMETER Icmpcode Code of a particular ICMP message type to match against the ICMP code of an incoming IPv6 ICMP packet. For example, to block DESTINATION HOST UNREACHABLE messages, specify 3 as the ICMP type and 1 as the ICMP code. If you set this parameter, you must set the ICMP Type parameter. Maximum value = 65536 .PARAMETER Vlan ID of the VLAN. The Citrix ADC applies the ACL6 rule only to the incoming packets on the specified VLAN. If you do not specify a VLAN ID, the appliance applies the ACL6 rule to the incoming packets on all VLANs. Maximum value = 4094 .PARAMETER Vxlan ID of the VXLAN. The Citrix ADC applies the ACL6 rule only to the incoming packets on the specified VXLAN. If you do not specify a VXLAN ID, the appliance applies the ACL6 rule to the incoming packets on all VXLANs. Maximum value = 16777215 .PARAMETER Interface ID of an interface. The Citrix ADC applies the ACL6 rule only to the incoming packets from the specified interface. If you do not specify any value, the appliance applies the ACL6 rule to the incoming packets from all interfaces. .PARAMETER Logstate Enable or disable logging of events related to the ACL6 rule. The log messages are stored in the configured syslog or auditlog server. Possible values = ENABLED, DISABLED .PARAMETER Ratelimit Maximum number of log messages to be generated per second. If you set this parameter, you must enable the Log State parameter. Maximum value = 10000 .PARAMETER Established Allow only incoming TCP packets that have the ACK or RST bit set if the action set for the ACL6 rule is ALLOW and these packets match the other conditions in the ACL6 rule. .PARAMETER Stateful If stateful option is enabled, transparent sessions are created for the traffic hitting this ACL6 and not hitting any other features like LB, INAT etc. . Possible values = YES, NO .PARAMETER Dfdhash Specifies the type of hashmethod to be applied, to steer the packet to the FP of the packet. Possible values = SIP-SPORT-DIP-DPORT, SIP, DIP, SIP-DIP, SIP-SPORT, DIP-DPORT .PARAMETER Dfdprefix hashprefix to be applied to SIP/DIP to generate rsshash FP.eg 128 => hash calculated on the complete IP. Maximum value = 128 .EXAMPLE PS C:\>Invoke-NSUnsetNsacl6 -acl6name <string> An example how to unset nsacl6 config Object(s). .NOTES File Name : Invoke-NSUnsetNsacl6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsacl6 Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Acl6name, [Boolean]$srcipv6, [Boolean]$srcport, [Boolean]$destipv6, [Boolean]$destport, [Boolean]$srcmac, [Boolean]$srcmacmask, [Boolean]$protocol, [Boolean]$icmptype, [Boolean]$icmpcode, [Boolean]$vlan, [Boolean]$vxlan, [Boolean]$Interface, [Boolean]$logstate, [Boolean]$ratelimit, [Boolean]$established, [Boolean]$stateful, [Boolean]$dfdhash, [Boolean]$dfdprefix ) begin { Write-Verbose "Invoke-NSUnsetNsacl6: Starting" } process { try { $payload = @{ acl6name = $acl6name } if ( $PSBoundParameters.ContainsKey('srcipv6') ) { $payload.Add('srcipv6', $srcipv6) } if ( $PSBoundParameters.ContainsKey('srcport') ) { $payload.Add('srcport', $srcport) } if ( $PSBoundParameters.ContainsKey('destipv6') ) { $payload.Add('destipv6', $destipv6) } if ( $PSBoundParameters.ContainsKey('destport') ) { $payload.Add('destport', $destport) } if ( $PSBoundParameters.ContainsKey('srcmac') ) { $payload.Add('srcmac', $srcmac) } if ( $PSBoundParameters.ContainsKey('srcmacmask') ) { $payload.Add('srcmacmask', $srcmacmask) } if ( $PSBoundParameters.ContainsKey('protocol') ) { $payload.Add('protocol', $protocol) } if ( $PSBoundParameters.ContainsKey('icmptype') ) { $payload.Add('icmptype', $icmptype) } if ( $PSBoundParameters.ContainsKey('icmpcode') ) { $payload.Add('icmpcode', $icmpcode) } if ( $PSBoundParameters.ContainsKey('vlan') ) { $payload.Add('vlan', $vlan) } if ( $PSBoundParameters.ContainsKey('vxlan') ) { $payload.Add('vxlan', $vxlan) } if ( $PSBoundParameters.ContainsKey('Interface') ) { $payload.Add('Interface', $Interface) } if ( $PSBoundParameters.ContainsKey('logstate') ) { $payload.Add('logstate', $logstate) } if ( $PSBoundParameters.ContainsKey('ratelimit') ) { $payload.Add('ratelimit', $ratelimit) } if ( $PSBoundParameters.ContainsKey('established') ) { $payload.Add('established', $established) } if ( $PSBoundParameters.ContainsKey('stateful') ) { $payload.Add('stateful', $stateful) } if ( $PSBoundParameters.ContainsKey('dfdhash') ) { $payload.Add('dfdhash', $dfdhash) } if ( $PSBoundParameters.ContainsKey('dfdprefix') ) { $payload.Add('dfdprefix', $dfdprefix) } if ( $PSCmdlet.ShouldProcess("$acl6name", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nsacl6 -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNsacl6: Finished" } } function Invoke-NSEnableNsacl6 { <# .SYNOPSIS Enable System/Global level configuration. config Object. .DESCRIPTION Configuration for ACL6 entry resource. .PARAMETER Acl6name Name for the ACL6 rule. Must begin with an ASCII alphabetic or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .EXAMPLE PS C:\>Invoke-NSEnableNsacl6 -acl6name <string> An example how to enable nsacl6 config Object(s). .NOTES File Name : Invoke-NSEnableNsacl6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsacl6/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Acl6name ) begin { Write-Verbose "Invoke-NSEnableNsacl6: Starting" } process { try { $payload = @{ acl6name = $acl6name } if ( $PSCmdlet.ShouldProcess($Name, "Enable System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsacl6 -Action enable -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSEnableNsacl6: Finished" } } function Invoke-NSDisableNsacl6 { <# .SYNOPSIS Disable System/Global level configuration. config Object. .DESCRIPTION Configuration for ACL6 entry resource. .PARAMETER Acl6name Name for the ACL6 rule. Must begin with an ASCII alphabetic or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .EXAMPLE PS C:\>Invoke-NSDisableNsacl6 -acl6name <string> An example how to disable nsacl6 config Object(s). .NOTES File Name : Invoke-NSDisableNsacl6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsacl6/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Acl6name ) begin { Write-Verbose "Invoke-NSDisableNsacl6: Starting" } process { try { $payload = @{ acl6name = $acl6name } if ( $PSCmdlet.ShouldProcess($Name, "Disable System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsacl6 -Action disable -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDisableNsacl6: Finished" } } function Invoke-NSRenameNsacl6 { <# .SYNOPSIS Rename System/Global level configuration. config Object. .DESCRIPTION Configuration for ACL6 entry resource. .PARAMETER Acl6name Name for the ACL6 rule. Must begin with an ASCII alphabetic or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER Newname New name for the ACL6 rule. Must begin with an ASCII alphabetic or underscore \(_\) character, and must contain only ASCII alphanumeric, underscore, hash \(\#\), period \(.\), space, colon \(:\), at \(@\), equals \(=\), and hyphen \(-\) characters. .PARAMETER PassThru Return details about the created nsacl6 item. .EXAMPLE PS C:\>Invoke-NSRenameNsacl6 -acl6name <string> -newname <string> An example how to rename nsacl6 config Object(s). .NOTES File Name : Invoke-NSRenameNsacl6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsacl6/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Acl6name, [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Newname, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSRenameNsacl6: Starting" } process { try { $payload = @{ acl6name = $acl6name newname = $newname } if ( $PSCmdlet.ShouldProcess("nsacl6", "Rename System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsacl6 -Action rename -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNsacl6 -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSRenameNsacl6: Finished" } } function Invoke-NSGetNsacl6 { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for ACL6 entry resource. .PARAMETER Acl6name Name for the ACL6 rule. Must begin with an ASCII alphabetic or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER GetAll Retrieve all nsacl6 object(s). .PARAMETER Count If specified, the count of the nsacl6 object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsacl6 Get data. .EXAMPLE PS C:\>Invoke-NSGetNsacl6 -GetAll Get all nsacl6 data. .EXAMPLE PS C:\>Invoke-NSGetNsacl6 -Count Get the number of nsacl6 objects. .EXAMPLE PS C:\>Invoke-NSGetNsacl6 -name <string> Get nsacl6 object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsacl6 -Filter @{ 'name'='<value>' } Get nsacl6 data with a filter. .NOTES File Name : Invoke-NSGetNsacl6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsacl6/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Acl6name, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNsacl6: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsacl6 objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsacl6 -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsacl6 objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsacl6 -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsacl6 objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsacl6 -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsacl6 configuration for property 'acl6name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsacl6 -NitroPath nitro/v1/config -Resource $acl6name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nsacl6 configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsacl6 -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsacl6: Ended" } } function Invoke-NSRenumberNsacls { <# .SYNOPSIS Renumber System/Global level configuration. config Object. .DESCRIPTION Configuration for ACL entry resource. .PARAMETER Type Type of the acl,default will be CLASSIC. Available options as follows: * CLASSIC - specifies the regular extended acls. * DFD - cluster specific acls,specifies hashmethod for steering of the packet in cluster . Possible values = CLASSIC, DFD .EXAMPLE PS C:\>Invoke-NSRenumberNsacls An example how to renumber nsacls config Object(s). .NOTES File Name : Invoke-NSRenumberNsacls Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsacls/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateSet('CLASSIC', 'DFD')] [string]$Type ) begin { Write-Verbose "Invoke-NSRenumberNsacls: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('type') ) { $payload.Add('type', $type) } if ( $PSCmdlet.ShouldProcess($Name, "Renumber System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsacls -Action renumber -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSRenumberNsacls: Finished" } } function Invoke-NSClearNsacls { <# .SYNOPSIS Clear System/Global level configuration. config Object. .DESCRIPTION Configuration for ACL entry resource. .PARAMETER Type Type of the acl,default will be CLASSIC. Available options as follows: * CLASSIC - specifies the regular extended acls. * DFD - cluster specific acls,specifies hashmethod for steering of the packet in cluster . Possible values = CLASSIC, DFD .EXAMPLE PS C:\>Invoke-NSClearNsacls An example how to clear nsacls config Object(s). .NOTES File Name : Invoke-NSClearNsacls Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsacls/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateSet('CLASSIC', 'DFD')] [string]$Type ) begin { Write-Verbose "Invoke-NSClearNsacls: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('type') ) { $payload.Add('type', $type) } if ( $PSCmdlet.ShouldProcess($Name, "Clear System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsacls -Action clear -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSClearNsacls: Finished" } } function Invoke-NSApplyNsacls { <# .SYNOPSIS Apply System/Global level configuration. config Object. .DESCRIPTION Configuration for ACL entry resource. .PARAMETER Type Type of the acl,default will be CLASSIC. Available options as follows: * CLASSIC - specifies the regular extended acls. * DFD - cluster specific acls,specifies hashmethod for steering of the packet in cluster . Possible values = CLASSIC, DFD .EXAMPLE PS C:\>Invoke-NSApplyNsacls An example how to apply nsacls config Object(s). .NOTES File Name : Invoke-NSApplyNsacls Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsacls/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateSet('CLASSIC', 'DFD')] [string]$Type ) begin { Write-Verbose "Invoke-NSApplyNsacls: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('type') ) { $payload.Add('type', $type) } if ( $PSCmdlet.ShouldProcess($Name, "Apply System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsacls -Action apply -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSApplyNsacls: Finished" } } function Invoke-NSClearNsacls6 { <# .SYNOPSIS Clear System/Global level configuration. config Object. .DESCRIPTION Configuration for ACL6 entry resource. .PARAMETER Type Type of the acl,default will be CLASSIC. Available options as follows: * CLASSIC - specifies the regular extended acls. * DFD - cluster specific acls,specifies hashmethod for steering of the packet in cluster . Possible values = CLASSIC, DFD .EXAMPLE PS C:\>Invoke-NSClearNsacls6 An example how to clear nsacls6 config Object(s). .NOTES File Name : Invoke-NSClearNsacls6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsacls6/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateSet('CLASSIC', 'DFD')] [string]$Type ) begin { Write-Verbose "Invoke-NSClearNsacls6: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('type') ) { $payload.Add('type', $type) } if ( $PSCmdlet.ShouldProcess($Name, "Clear System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsacls6 -Action clear -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSClearNsacls6: Finished" } } function Invoke-NSApplyNsacls6 { <# .SYNOPSIS Apply System/Global level configuration. config Object. .DESCRIPTION Configuration for ACL6 entry resource. .PARAMETER Type Type of the acl,default will be CLASSIC. Available options as follows: * CLASSIC - specifies the regular extended acls. * DFD - cluster specific acls,specifies hashmethod for steering of the packet in cluster . Possible values = CLASSIC, DFD .EXAMPLE PS C:\>Invoke-NSApplyNsacls6 An example how to apply nsacls6 config Object(s). .NOTES File Name : Invoke-NSApplyNsacls6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsacls6/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateSet('CLASSIC', 'DFD')] [string]$Type ) begin { Write-Verbose "Invoke-NSApplyNsacls6: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('type') ) { $payload.Add('type', $type) } if ( $PSCmdlet.ShouldProcess($Name, "Apply System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsacls6 -Action apply -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSApplyNsacls6: Finished" } } function Invoke-NSRenumberNsacls6 { <# .SYNOPSIS Renumber System/Global level configuration. config Object. .DESCRIPTION Configuration for ACL6 entry resource. .PARAMETER Type Type of the acl,default will be CLASSIC. Available options as follows: * CLASSIC - specifies the regular extended acls. * DFD - cluster specific acls,specifies hashmethod for steering of the packet in cluster . Possible values = CLASSIC, DFD .EXAMPLE PS C:\>Invoke-NSRenumberNsacls6 An example how to renumber nsacls6 config Object(s). .NOTES File Name : Invoke-NSRenumberNsacls6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsacls6/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateSet('CLASSIC', 'DFD')] [string]$Type ) begin { Write-Verbose "Invoke-NSRenumberNsacls6: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('type') ) { $payload.Add('type', $type) } if ( $PSCmdlet.ShouldProcess($Name, "Renumber System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsacls6 -Action renumber -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSRenumberNsacls6: Finished" } } function Invoke-NSAddNsappflowcollector { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Configuration for appflowCollector resource. .PARAMETER Name Name of the AppFlow collector. .PARAMETER Ipaddress The IPv4 address of the AppFlow collector. .PARAMETER Port The UDP port on which the AppFlow collector is listening. .PARAMETER PassThru Return details about the created nsappflowcollector item. .EXAMPLE PS C:\>Invoke-NSAddNsappflowcollector -name <string> -ipaddress <string> An example how to add nsappflowcollector config Object(s). .NOTES File Name : Invoke-NSAddNsappflowcollector Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsappflowcollector/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateLength(1, 127)] [string]$Name, [Parameter(Mandatory)] [string]$Ipaddress, [int]$Port = '4739', [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNsappflowcollector: Starting" } process { try { $payload = @{ name = $name ipaddress = $ipaddress } if ( $PSBoundParameters.ContainsKey('port') ) { $payload.Add('port', $port) } if ( $PSCmdlet.ShouldProcess("nsappflowcollector", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsappflowcollector -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNsappflowcollector -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNsappflowcollector: Finished" } } function Invoke-NSDeleteNsappflowcollector { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Configuration for appflowCollector resource. .PARAMETER Name Name of the AppFlow collector. .EXAMPLE PS C:\>Invoke-NSDeleteNsappflowcollector -Name <string> An example how to delete nsappflowcollector config Object(s). .NOTES File Name : Invoke-NSDeleteNsappflowcollector Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsappflowcollector/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Name ) begin { Write-Verbose "Invoke-NSDeleteNsappflowcollector: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nsappflowcollector -NitroPath nitro/v1/config -Resource $name -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNsappflowcollector: Finished" } } function Invoke-NSGetNsappflowcollector { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for appflowCollector resource. .PARAMETER Name Name of the AppFlow collector. .PARAMETER GetAll Retrieve all nsappflowcollector object(s). .PARAMETER Count If specified, the count of the nsappflowcollector object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsappflowcollector Get data. .EXAMPLE PS C:\>Invoke-NSGetNsappflowcollector -GetAll Get all nsappflowcollector data. .EXAMPLE PS C:\>Invoke-NSGetNsappflowcollector -Count Get the number of nsappflowcollector objects. .EXAMPLE PS C:\>Invoke-NSGetNsappflowcollector -name <string> Get nsappflowcollector object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsappflowcollector -Filter @{ 'name'='<value>' } Get nsappflowcollector data with a filter. .NOTES File Name : Invoke-NSGetNsappflowcollector Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsappflowcollector/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateLength(1, 127)] [string]$Name, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNsappflowcollector: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsappflowcollector objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsappflowcollector -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsappflowcollector objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsappflowcollector -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsappflowcollector objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsappflowcollector -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsappflowcollector configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsappflowcollector -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nsappflowcollector configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsappflowcollector -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsappflowcollector: Ended" } } function Invoke-NSUpdateNsappflowparam { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for appflowParam resource. .PARAMETER Templaterefresh IPFIX template refresh interval (in seconds). Maximum value = 3600 .PARAMETER Udppmtu MTU to be used for IPFIX UDP packets. Maximum value = 1472 .PARAMETER Httpurl Enable AppFlow HTTP URL logging. Possible values = ENABLED, DISABLED .PARAMETER Httpcookie Enable AppFlow HTTP cookie logging. Possible values = ENABLED, DISABLED .PARAMETER Httpreferer Enable AppFlow HTTP referer logging. Possible values = ENABLED, DISABLED .PARAMETER Httpmethod Enable AppFlow HTTP method logging. Possible values = ENABLED, DISABLED .PARAMETER Httphost Enable AppFlow HTTP host logging. Possible values = ENABLED, DISABLED .PARAMETER Httpuseragent Enable AppFlow HTTP user-agent logging. Possible values = ENABLED, DISABLED .PARAMETER Clienttrafficonly Control whether AppFlow records should be generated only for client-side traffic. Possible values = YES, NO .EXAMPLE PS C:\>Invoke-NSUpdateNsappflowparam An example how to update nsappflowparam config Object(s). .NOTES File Name : Invoke-NSUpdateNsappflowparam Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsappflowparam/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [double]$Templaterefresh, [double]$Udppmtu, [ValidateSet('ENABLED', 'DISABLED')] [string]$Httpurl, [ValidateSet('ENABLED', 'DISABLED')] [string]$Httpcookie, [ValidateSet('ENABLED', 'DISABLED')] [string]$Httpreferer, [ValidateSet('ENABLED', 'DISABLED')] [string]$Httpmethod, [ValidateSet('ENABLED', 'DISABLED')] [string]$Httphost, [ValidateSet('ENABLED', 'DISABLED')] [string]$Httpuseragent, [ValidateSet('YES', 'NO')] [string]$Clienttrafficonly ) begin { Write-Verbose "Invoke-NSUpdateNsappflowparam: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('templaterefresh') ) { $payload.Add('templaterefresh', $templaterefresh) } if ( $PSBoundParameters.ContainsKey('udppmtu') ) { $payload.Add('udppmtu', $udppmtu) } if ( $PSBoundParameters.ContainsKey('httpurl') ) { $payload.Add('httpurl', $httpurl) } if ( $PSBoundParameters.ContainsKey('httpcookie') ) { $payload.Add('httpcookie', $httpcookie) } if ( $PSBoundParameters.ContainsKey('httpreferer') ) { $payload.Add('httpreferer', $httpreferer) } if ( $PSBoundParameters.ContainsKey('httpmethod') ) { $payload.Add('httpmethod', $httpmethod) } if ( $PSBoundParameters.ContainsKey('httphost') ) { $payload.Add('httphost', $httphost) } if ( $PSBoundParameters.ContainsKey('httpuseragent') ) { $payload.Add('httpuseragent', $httpuseragent) } if ( $PSBoundParameters.ContainsKey('clienttrafficonly') ) { $payload.Add('clienttrafficonly', $clienttrafficonly) } if ( $PSCmdlet.ShouldProcess("nsappflowparam", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nsappflowparam -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNsappflowparam: Finished" } } function Invoke-NSUnsetNsappflowparam { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for appflowParam resource. .PARAMETER Templaterefresh IPFIX template refresh interval (in seconds). Maximum value = 3600 .PARAMETER Udppmtu MTU to be used for IPFIX UDP packets. Maximum value = 1472 .PARAMETER Httpurl Enable AppFlow HTTP URL logging. Possible values = ENABLED, DISABLED .PARAMETER Httpcookie Enable AppFlow HTTP cookie logging. Possible values = ENABLED, DISABLED .PARAMETER Httpreferer Enable AppFlow HTTP referer logging. Possible values = ENABLED, DISABLED .PARAMETER Httpmethod Enable AppFlow HTTP method logging. Possible values = ENABLED, DISABLED .PARAMETER Httphost Enable AppFlow HTTP host logging. Possible values = ENABLED, DISABLED .PARAMETER Httpuseragent Enable AppFlow HTTP user-agent logging. Possible values = ENABLED, DISABLED .PARAMETER Clienttrafficonly Control whether AppFlow records should be generated only for client-side traffic. Possible values = YES, NO .EXAMPLE PS C:\>Invoke-NSUnsetNsappflowparam An example how to unset nsappflowparam config Object(s). .NOTES File Name : Invoke-NSUnsetNsappflowparam Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsappflowparam Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Boolean]$templaterefresh, [Boolean]$udppmtu, [Boolean]$httpurl, [Boolean]$httpcookie, [Boolean]$httpreferer, [Boolean]$httpmethod, [Boolean]$httphost, [Boolean]$httpuseragent, [Boolean]$clienttrafficonly ) begin { Write-Verbose "Invoke-NSUnsetNsappflowparam: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('templaterefresh') ) { $payload.Add('templaterefresh', $templaterefresh) } if ( $PSBoundParameters.ContainsKey('udppmtu') ) { $payload.Add('udppmtu', $udppmtu) } if ( $PSBoundParameters.ContainsKey('httpurl') ) { $payload.Add('httpurl', $httpurl) } if ( $PSBoundParameters.ContainsKey('httpcookie') ) { $payload.Add('httpcookie', $httpcookie) } if ( $PSBoundParameters.ContainsKey('httpreferer') ) { $payload.Add('httpreferer', $httpreferer) } if ( $PSBoundParameters.ContainsKey('httpmethod') ) { $payload.Add('httpmethod', $httpmethod) } if ( $PSBoundParameters.ContainsKey('httphost') ) { $payload.Add('httphost', $httphost) } if ( $PSBoundParameters.ContainsKey('httpuseragent') ) { $payload.Add('httpuseragent', $httpuseragent) } if ( $PSBoundParameters.ContainsKey('clienttrafficonly') ) { $payload.Add('clienttrafficonly', $clienttrafficonly) } if ( $PSCmdlet.ShouldProcess("nsappflowparam", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nsappflowparam -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNsappflowparam: Finished" } } function Invoke-NSGetNsappflowparam { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for appflowParam resource. .PARAMETER GetAll Retrieve all nsappflowparam object(s). .PARAMETER Count If specified, the count of the nsappflowparam object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsappflowparam Get data. .EXAMPLE PS C:\>Invoke-NSGetNsappflowparam -GetAll Get all nsappflowparam data. .EXAMPLE PS C:\>Invoke-NSGetNsappflowparam -name <string> Get nsappflowparam object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsappflowparam -Filter @{ 'name'='<value>' } Get nsappflowparam data with a filter. .NOTES File Name : Invoke-NSGetNsappflowparam Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsappflowparam/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNsappflowparam: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsappflowparam objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsappflowparam -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsappflowparam objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsappflowparam -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsappflowparam objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsappflowparam -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsappflowparam configuration for property ''" } else { Write-Verbose "Retrieving nsappflowparam configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsappflowparam -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsappflowparam: Ended" } } function Invoke-NSChangeNsaptlicense { <# .SYNOPSIS Change System/Global level configuration. config Object. .DESCRIPTION Configuration for aptlicense resource. .PARAMETER Id License ID. .PARAMETER Sessionid Session ID. .PARAMETER Bindtype Bind type. .PARAMETER Countavailable The user can allocate one or more licenses. Ensure the value is less than (for partial allocation) or equal to the total number of available licenses. .PARAMETER Licensedir License Directory. .PARAMETER Useproxy Specifies whether to use the licenseproxyserver to reach the internet. Make sure to configure licenseproxyserver to use this option. Possible values = YES, NO .EXAMPLE PS C:\>Invoke-NSChangeNsaptlicense -id <string> -sessionid <string> -bindtype <string> -countavailable <string> An example how to change nsaptlicense config Object(s). .NOTES File Name : Invoke-NSChangeNsaptlicense Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsaptlicense/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Id, [Parameter(Mandatory)] [string]$Sessionid, [Parameter(Mandatory)] [string]$Bindtype, [Parameter(Mandatory)] [string]$Countavailable, [string]$Licensedir, [ValidateSet('YES', 'NO')] [string]$Useproxy ) begin { Write-Verbose "Invoke-NSChangeNsaptlicense: Starting" } process { try { $payload = @{ id = $id sessionid = $sessionid bindtype = $bindtype countavailable = $countavailable } if ( $PSBoundParameters.ContainsKey('licensedir') ) { $payload.Add('licensedir', $licensedir) } if ( $PSBoundParameters.ContainsKey('useproxy') ) { $payload.Add('useproxy', $useproxy) } if ( $PSCmdlet.ShouldProcess("nsaptlicense", "Change System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsaptlicense -Action update -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSChangeNsaptlicense: Finished" } } function Invoke-NSGetNsaptlicense { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for aptlicense resource. .PARAMETER Serialno Hardware Serial Number/License Activation Code(LAC). .PARAMETER Useproxy Specifies whether to use the licenseproxyserver to reach the internet. Make sure to configure licenseproxyserver to use this option. Possible values = YES, NO .PARAMETER GetAll Retrieve all nsaptlicense object(s). .PARAMETER Count If specified, the count of the nsaptlicense object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsaptlicense Get data. .EXAMPLE PS C:\>Invoke-NSGetNsaptlicense -GetAll Get all nsaptlicense data. .EXAMPLE PS C:\>Invoke-NSGetNsaptlicense -Count Get the number of nsaptlicense objects. .EXAMPLE PS C:\>Invoke-NSGetNsaptlicense -name <string> Get nsaptlicense object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsaptlicense -Filter @{ 'name'='<value>' } Get nsaptlicense data with a filter. .NOTES File Name : Invoke-NSGetNsaptlicense Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsaptlicense/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByArgument')] [string]$Serialno, [Parameter(ParameterSetName = 'GetByArgument')] [ValidateSet('YES', 'NO')] [string]$Useproxy, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNsaptlicense: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsaptlicense objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsaptlicense -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsaptlicense objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsaptlicense -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsaptlicense objects by arguments" $arguments = @{ } if ( $PSBoundParameters.ContainsKey('serialno') ) { $arguments.Add('serialno', $serialno) } if ( $PSBoundParameters.ContainsKey('useproxy') ) { $arguments.Add('useproxy', $useproxy) } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsaptlicense -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsaptlicense configuration for property ''" } else { Write-Verbose "Retrieving nsaptlicense configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsaptlicense -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsaptlicense: Ended" } } function Invoke-NSAddNsassignment { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Configuration for assignment resource. .PARAMETER Name Name for the assignment. Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) hash (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Can be changed after the assignment is added. .PARAMETER Variable Left hand side of the assigment, of the form $variable-name (for a singleton variabled) or $variable-name[key-expression], where key-expression is an expression that evaluates to a text string and provides the key to select a map entry. .PARAMETER Set Right hand side of the assignment. The expression is evaluated and assigned to the left hand variable. .PARAMETER Add Right hand side of the assignment. The expression is evaluated and added to the left hand variable. .PARAMETER Sub Right hand side of the assignment. The expression is evaluated and subtracted from the left hand variable. .PARAMETER Append Right hand side of the assignment. The expression is evaluated and appended to the left hand variable. .PARAMETER Clear Clear the variable value. Deallocates a text value, and for a map, the text key. .PARAMETER Comment Comment. Can be used to preserve information about this rewrite action. .PARAMETER PassThru Return details about the created nsassignment item. .EXAMPLE PS C:\>Invoke-NSAddNsassignment -name <string> -variable <string> An example how to add nsassignment config Object(s). .NOTES File Name : Invoke-NSAddNsassignment Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsassignment/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Name, [Parameter(Mandatory)] [string]$Variable, [string]$Set, [string]$Add, [string]$Sub, [string]$Append, [boolean]$Clear, [string]$Comment, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNsassignment: Starting" } process { try { $payload = @{ name = $name variable = $variable } if ( $PSBoundParameters.ContainsKey('set') ) { $payload.Add('set', $set) } if ( $PSBoundParameters.ContainsKey('Add') ) { $payload.Add('Add', $Add) } if ( $PSBoundParameters.ContainsKey('sub') ) { $payload.Add('sub', $sub) } if ( $PSBoundParameters.ContainsKey('append') ) { $payload.Add('append', $append) } if ( $PSBoundParameters.ContainsKey('clear') ) { $payload.Add('clear', $clear) } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSCmdlet.ShouldProcess("nsassignment", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsassignment -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNsassignment -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNsassignment: Finished" } } function Invoke-NSUpdateNsassignment { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for assignment resource. .PARAMETER Name Name for the assignment. Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) hash (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Can be changed after the assignment is added. .PARAMETER Variable Left hand side of the assigment, of the form $variable-name (for a singleton variabled) or $variable-name[key-expression], where key-expression is an expression that evaluates to a text string and provides the key to select a map entry. .PARAMETER Set Right hand side of the assignment. The expression is evaluated and assigned to the left hand variable. .PARAMETER Add Right hand side of the assignment. The expression is evaluated and added to the left hand variable. .PARAMETER Sub Right hand side of the assignment. The expression is evaluated and subtracted from the left hand variable. .PARAMETER Append Right hand side of the assignment. The expression is evaluated and appended to the left hand variable. .PARAMETER Clear Clear the variable value. Deallocates a text value, and for a map, the text key. .PARAMETER Comment Comment. Can be used to preserve information about this rewrite action. .PARAMETER PassThru Return details about the created nsassignment item. .EXAMPLE PS C:\>Invoke-NSUpdateNsassignment -name <string> An example how to update nsassignment config Object(s). .NOTES File Name : Invoke-NSUpdateNsassignment Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsassignment/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Name, [string]$Variable, [string]$Set, [string]$Add, [string]$Sub, [string]$Append, [boolean]$Clear, [string]$Comment, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateNsassignment: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('variable') ) { $payload.Add('variable', $variable) } if ( $PSBoundParameters.ContainsKey('set') ) { $payload.Add('set', $set) } if ( $PSBoundParameters.ContainsKey('Add') ) { $payload.Add('Add', $Add) } if ( $PSBoundParameters.ContainsKey('sub') ) { $payload.Add('sub', $sub) } if ( $PSBoundParameters.ContainsKey('append') ) { $payload.Add('append', $append) } if ( $PSBoundParameters.ContainsKey('clear') ) { $payload.Add('clear', $clear) } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSCmdlet.ShouldProcess("nsassignment", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nsassignment -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNsassignment -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNsassignment: Finished" } } function Invoke-NSUnsetNsassignment { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for assignment resource. .PARAMETER Name Name for the assignment. Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) hash (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Can be changed after the assignment is added. .PARAMETER Comment Comment. Can be used to preserve information about this rewrite action. .EXAMPLE PS C:\>Invoke-NSUnsetNsassignment -name <string> An example how to unset nsassignment config Object(s). .NOTES File Name : Invoke-NSUnsetNsassignment Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsassignment Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [string]$Name, [Boolean]$comment ) begin { Write-Verbose "Invoke-NSUnsetNsassignment: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSCmdlet.ShouldProcess("$name", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nsassignment -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNsassignment: Finished" } } function Invoke-NSDeleteNsassignment { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Configuration for assignment resource. .PARAMETER Name Name for the assignment. Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) hash (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Can be changed after the assignment is added. .EXAMPLE PS C:\>Invoke-NSDeleteNsassignment -Name <string> An example how to delete nsassignment config Object(s). .NOTES File Name : Invoke-NSDeleteNsassignment Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsassignment/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Name ) begin { Write-Verbose "Invoke-NSDeleteNsassignment: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nsassignment -NitroPath nitro/v1/config -Resource $name -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNsassignment: Finished" } } function Invoke-NSRenameNsassignment { <# .SYNOPSIS Rename System/Global level configuration. config Object. .DESCRIPTION Configuration for assignment resource. .PARAMETER Name Name for the assignment. Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) hash (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Can be changed after the assignment is added. .PARAMETER Newname New name for the assignment. Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) hash (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Can be changed after the rewrite policy is added. .PARAMETER PassThru Return details about the created nsassignment item. .EXAMPLE PS C:\>Invoke-NSRenameNsassignment -name <string> -newname <string> An example how to rename nsassignment config Object(s). .NOTES File Name : Invoke-NSRenameNsassignment Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsassignment/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Name, [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Newname, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSRenameNsassignment: Starting" } process { try { $payload = @{ name = $name newname = $newname } if ( $PSCmdlet.ShouldProcess("nsassignment", "Rename System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsassignment -Action rename -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNsassignment -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSRenameNsassignment: Finished" } } function Invoke-NSGetNsassignment { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for assignment resource. .PARAMETER Name Name for the assignment. Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) hash (#), space ( ), at (@), equals (=), colon (:), and underscore characters. Can be changed after the assignment is added. .PARAMETER GetAll Retrieve all nsassignment object(s). .PARAMETER Count If specified, the count of the nsassignment object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsassignment Get data. .EXAMPLE PS C:\>Invoke-NSGetNsassignment -GetAll Get all nsassignment data. .EXAMPLE PS C:\>Invoke-NSGetNsassignment -Count Get the number of nsassignment objects. .EXAMPLE PS C:\>Invoke-NSGetNsassignment -name <string> Get nsassignment object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsassignment -Filter @{ 'name'='<value>' } Get nsassignment data with a filter. .NOTES File Name : Invoke-NSGetNsassignment Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsassignment/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [string]$Name, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNsassignment: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsassignment objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsassignment -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsassignment objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsassignment -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsassignment objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsassignment -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsassignment configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsassignment -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nsassignment configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsassignment -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsassignment: Ended" } } function Invoke-NSUpdateNscapacity { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for capacity resource. .PARAMETER Bandwidth System bandwidth limit. .PARAMETER Platform appliance platform type. Possible values = VS10, VE10, VP10, VS25, VE25, VP25, VS50, VE50, VP50, VS200, VE200, VP200, VS1000, VE1000, VP1000, VS3000, VE3000, VP3000, VS5000, VE5000, VP5000, VS8000, VE8000, VP8000, VS10000, VE10000, VP10000, VS15000, VE15000, VP15000, VS25000, VE25000, VP25000, VS40000, VE40000, VP40000, VS100000, VE100000, VP100000, CP1000 .PARAMETER Vcpu licensed using vcpu pool. .PARAMETER Edition Product edition. Possible values = Standard, Enterprise, Platinum .PARAMETER Unit Bandwidth unit. Possible values = Gbps, Mbps .EXAMPLE PS C:\>Invoke-NSUpdateNscapacity An example how to update nscapacity config Object(s). .NOTES File Name : Invoke-NSUpdateNscapacity Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nscapacity/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [double]$Bandwidth, [ValidateSet('VS10', 'VE10', 'VP10', 'VS25', 'VE25', 'VP25', 'VS50', 'VE50', 'VP50', 'VS200', 'VE200', 'VP200', 'VS1000', 'VE1000', 'VP1000', 'VS3000', 'VE3000', 'VP3000', 'VS5000', 'VE5000', 'VP5000', 'VS8000', 'VE8000', 'VP8000', 'VS10000', 'VE10000', 'VP10000', 'VS15000', 'VE15000', 'VP15000', 'VS25000', 'VE25000', 'VP25000', 'VS40000', 'VE40000', 'VP40000', 'VS100000', 'VE100000', 'VP100000', 'CP1000')] [string]$Platform, [boolean]$Vcpu, [ValidateSet('Standard', 'Enterprise', 'Platinum')] [string]$Edition, [ValidateSet('Gbps', 'Mbps')] [string]$Unit ) begin { Write-Verbose "Invoke-NSUpdateNscapacity: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('bandwidth') ) { $payload.Add('bandwidth', $bandwidth) } if ( $PSBoundParameters.ContainsKey('platform') ) { $payload.Add('platform', $platform) } if ( $PSBoundParameters.ContainsKey('vcpu') ) { $payload.Add('vcpu', $vcpu) } if ( $PSBoundParameters.ContainsKey('edition') ) { $payload.Add('edition', $edition) } if ( $PSBoundParameters.ContainsKey('unit') ) { $payload.Add('unit', $unit) } if ( $PSCmdlet.ShouldProcess("nscapacity", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nscapacity -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNscapacity: Finished" } } function Invoke-NSUnsetNscapacity { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for capacity resource. .PARAMETER Bandwidth System bandwidth limit. .PARAMETER Platform appliance platform type. Possible values = VS10, VE10, VP10, VS25, VE25, VP25, VS50, VE50, VP50, VS200, VE200, VP200, VS1000, VE1000, VP1000, VS3000, VE3000, VP3000, VS5000, VE5000, VP5000, VS8000, VE8000, VP8000, VS10000, VE10000, VP10000, VS15000, VE15000, VP15000, VS25000, VE25000, VP25000, VS40000, VE40000, VP40000, VS100000, VE100000, VP100000, CP1000 .PARAMETER Vcpu licensed using vcpu pool. .EXAMPLE PS C:\>Invoke-NSUnsetNscapacity An example how to unset nscapacity config Object(s). .NOTES File Name : Invoke-NSUnsetNscapacity Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nscapacity Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Boolean]$bandwidth, [Boolean]$platform, [Boolean]$vcpu ) begin { Write-Verbose "Invoke-NSUnsetNscapacity: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('bandwidth') ) { $payload.Add('bandwidth', $bandwidth) } if ( $PSBoundParameters.ContainsKey('platform') ) { $payload.Add('platform', $platform) } if ( $PSBoundParameters.ContainsKey('vcpu') ) { $payload.Add('vcpu', $vcpu) } if ( $PSCmdlet.ShouldProcess("nscapacity", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nscapacity -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNscapacity: Finished" } } function Invoke-NSGetNscapacity { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for capacity resource. .PARAMETER Nodeid Unique number that identifies the cluster node. Maximum value = 31 .PARAMETER GetAll Retrieve all nscapacity object(s). .PARAMETER Count If specified, the count of the nscapacity object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNscapacity Get data. .EXAMPLE PS C:\>Invoke-NSGetNscapacity -GetAll Get all nscapacity data. .EXAMPLE PS C:\>Invoke-NSGetNscapacity -name <string> Get nscapacity object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNscapacity -Filter @{ 'name'='<value>' } Get nscapacity data with a filter. .NOTES File Name : Invoke-NSGetNscapacity Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nscapacity/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByArgument')] [double]$Nodeid, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNscapacity: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nscapacity objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nscapacity -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nscapacity objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nscapacity -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nscapacity objects by arguments" $arguments = @{ } if ( $PSBoundParameters.ContainsKey('nodeid') ) { $arguments.Add('nodeid', $nodeid) } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nscapacity -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nscapacity configuration for property ''" } else { Write-Verbose "Retrieving nscapacity configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nscapacity -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNscapacity: Ended" } } function Invoke-NSAddNscentralmanagementserver { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Configuration for centralmanagementserver resource. .PARAMETER Type Type of the central management server. Must be either CLOUD or ONPREM depending on whether the server is on the cloud or on premise. Possible values = CLOUD, ONPREM .PARAMETER Username Username for access to central management server. Must begin with a letter, number, or the underscore character (_), and must contain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters. .PARAMETER Password Password for access to central management server. Required for any user account. .PARAMETER Activationcode Activation code is used to register to ADM service. .PARAMETER Ipaddress Ip Address of central management server. .PARAMETER Servername Fully qualified domain name of the central management server or service-url to locate ADM service. .PARAMETER Validatecert validate the server certificate for secure SSL connections. Possible values = YES, NO .PARAMETER Deviceprofilename Device profile is created on ADM and contains the user name and password of the instance(s). .PARAMETER Adcusername ADC username used to create device profile on ADM. .PARAMETER Adcpassword ADC password used to create device profile on ADM. .PARAMETER PassThru Return details about the created nscentralmanagementserver item. .EXAMPLE PS C:\>Invoke-NSAddNscentralmanagementserver -type <string> An example how to add nscentralmanagementserver config Object(s). .NOTES File Name : Invoke-NSAddNscentralmanagementserver Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nscentralmanagementserver/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateSet('CLOUD', 'ONPREM')] [string]$Type, [ValidateLength(1, 127)] [string]$Username, [ValidateLength(1, 127)] [string]$Password, [ValidateLength(1, 127)] [string]$Activationcode, [ValidateScript({ $_.Length -gt 1 })] [string]$Ipaddress, [string]$Servername, [ValidateSet('YES', 'NO')] [string]$Validatecert = 'YES', [ValidateLength(1, 255)] [string]$Deviceprofilename, [ValidateLength(1, 127)] [string]$Adcusername, [ValidateLength(1, 127)] [string]$Adcpassword, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNscentralmanagementserver: Starting" } process { try { $payload = @{ type = $type } if ( $PSBoundParameters.ContainsKey('username') ) { $payload.Add('username', $username) } if ( $PSBoundParameters.ContainsKey('password') ) { $payload.Add('password', $password) } if ( $PSBoundParameters.ContainsKey('activationcode') ) { $payload.Add('activationcode', $activationcode) } if ( $PSBoundParameters.ContainsKey('ipaddress') ) { $payload.Add('ipaddress', $ipaddress) } if ( $PSBoundParameters.ContainsKey('servername') ) { $payload.Add('servername', $servername) } if ( $PSBoundParameters.ContainsKey('validatecert') ) { $payload.Add('validatecert', $validatecert) } if ( $PSBoundParameters.ContainsKey('deviceprofilename') ) { $payload.Add('deviceprofilename', $deviceprofilename) } if ( $PSBoundParameters.ContainsKey('adcusername') ) { $payload.Add('adcusername', $adcusername) } if ( $PSBoundParameters.ContainsKey('adcpassword') ) { $payload.Add('adcpassword', $adcpassword) } if ( $PSCmdlet.ShouldProcess("nscentralmanagementserver", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nscentralmanagementserver -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNscentralmanagementserver -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNscentralmanagementserver: Finished" } } function Invoke-NSDeleteNscentralmanagementserver { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Configuration for centralmanagementserver resource. .PARAMETER Type Type of the central management server. Must be either CLOUD or ONPREM depending on whether the server is on the cloud or on premise. Possible values = CLOUD, ONPREM .EXAMPLE PS C:\>Invoke-NSDeleteNscentralmanagementserver -Type <string> An example how to delete nscentralmanagementserver config Object(s). .NOTES File Name : Invoke-NSDeleteNscentralmanagementserver Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nscentralmanagementserver/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Type ) begin { Write-Verbose "Invoke-NSDeleteNscentralmanagementserver: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$type", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nscentralmanagementserver -NitroPath nitro/v1/config -Resource $type -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNscentralmanagementserver: Finished" } } function Invoke-NSGetNscentralmanagementserver { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for centralmanagementserver resource. .PARAMETER Type Type of the central management server. Must be either CLOUD or ONPREM depending on whether the server is on the cloud or on premise. Possible values = CLOUD, ONPREM .PARAMETER GetAll Retrieve all nscentralmanagementserver object(s). .PARAMETER Count If specified, the count of the nscentralmanagementserver object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNscentralmanagementserver Get data. .EXAMPLE PS C:\>Invoke-NSGetNscentralmanagementserver -GetAll Get all nscentralmanagementserver data. .EXAMPLE PS C:\>Invoke-NSGetNscentralmanagementserver -Count Get the number of nscentralmanagementserver objects. .EXAMPLE PS C:\>Invoke-NSGetNscentralmanagementserver -name <string> Get nscentralmanagementserver object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNscentralmanagementserver -Filter @{ 'name'='<value>' } Get nscentralmanagementserver data with a filter. .NOTES File Name : Invoke-NSGetNscentralmanagementserver Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nscentralmanagementserver/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateSet('CLOUD', 'ONPREM')] [string]$Type, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNscentralmanagementserver: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nscentralmanagementserver objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nscentralmanagementserver -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nscentralmanagementserver objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nscentralmanagementserver -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nscentralmanagementserver objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nscentralmanagementserver -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nscentralmanagementserver configuration for property 'type'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nscentralmanagementserver -NitroPath nitro/v1/config -Resource $type -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nscentralmanagementserver configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nscentralmanagementserver -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNscentralmanagementserver: Ended" } } function Invoke-NSClearNsconfig { <# .SYNOPSIS Clear System/Global level configuration. config Object. .DESCRIPTION Configuration for system config resource. .PARAMETER Force Configurations will be cleared without prompting for confirmation. .PARAMETER Level Types of configurations to be cleared. * basic: Clears all configurations except the following: - NSIP, default route (gateway), static routes, MIPs, and SNIPs - Network settings (DG, VLAN, RHI and DNS settings) - Cluster settings - HA node definitions - Feature and mode settings - nsroot password * extended: Clears the same configurations as the 'basic' option. In addition, it clears the feature and mode settings. * full: Clears all configurations except NSIP, default route, and interface settings. Note: When you clear the configurations through the cluster IP address, by specifying the level as 'full', the cluster is deleted and all cluster nodes become standalone appliances. The 'basic' and 'extended' levels are propagated to the cluster nodes. Possible values = basic, extended, full .PARAMETER Rbaconfig RBA configurations and TACACS policies bound to system global will not be cleared if RBA is set to NO.This option is applicable only for BASIC level of clear configuration.Default is YES, which will clear rba configurations. Possible values = YES, NO .EXAMPLE PS C:\>Invoke-NSClearNsconfig -level <string> An example how to clear nsconfig config Object(s). .NOTES File Name : Invoke-NSClearNsconfig Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsconfig/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [boolean]$Force, [Parameter(Mandatory)] [ValidateSet('basic', 'extended', 'full')] [string]$Level, [ValidateSet('YES', 'NO')] [string]$Rbaconfig ) begin { Write-Verbose "Invoke-NSClearNsconfig: Starting" } process { try { $payload = @{ level = $level } if ( $PSBoundParameters.ContainsKey('force') ) { $payload.Add('force', $force) } if ( $PSBoundParameters.ContainsKey('rbaconfig') ) { $payload.Add('rbaconfig', $rbaconfig) } if ( $PSCmdlet.ShouldProcess($Name, "Clear System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsconfig -Action clear -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSClearNsconfig: Finished" } } function Invoke-NSUpdateNsconfig { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for system config resource. .PARAMETER Ipaddress IP address of the Citrix ADC. Commonly referred to as NSIP address. This parameter is mandatory to bring up the appliance. .PARAMETER Netmask Netmask corresponding to the IP address. This parameter is mandatory to bring up the appliance. .PARAMETER Nsvlan VLAN (NSVLAN) for the subnet on which the IP address resides. Maximum value = 4094 .PARAMETER Ifnum Interfaces of the appliances that must be bound to the NSVLAN. .PARAMETER Tagged Specifies that the interfaces will be added as 802.1q tagged interfaces. Packets sent on these interface on this VLAN will have an additional 4-byte 802.1q tag which identifies the VLAN. To use 802.1q tagging, the switch connected to the appliance's interfaces must also be configured for tagging. Possible values = YES, NO .PARAMETER Httpport The HTTP ports on the Web server. This allows the system to perform connection off-load for any client request that has a destination port matching one of these configured ports. .PARAMETER Maxconn The maximum number of connections that will be made from the system to the web server(s) attached to it. The value entered here is applied globally to all attached servers. Maximum value = 4294967294 .PARAMETER Maxreq The maximum number of requests that the system can pass on a particular connection between the system and a server attached to it. Setting this value to 0 allows an unlimited number of requests to be passed. Maximum value = 65535 .PARAMETER Cip The option to control (enable or disable) the insertion of the actual client IP address into the HTTP header request passed from the client to one, some, or all servers attached to the system. The passed address can then be accessed through a minor modification to the server. l If cipHeader is specified, it will be used as the client IP header. l If it is not specified, then the value that has been set by the set ns config CLI command will be used as the client IP header. Possible values = ENABLED, DISABLED .PARAMETER Cipheader The text that will be used as the client IP header. .PARAMETER Cookieversion The version of the cookie inserted by system. Possible values = 0, 1 .PARAMETER Securecookie enable/disable secure flag for persistence cookie. Possible values = ENABLED, DISABLED .PARAMETER Pmtumin The minimum Path MTU. Maximum value = 1500 .PARAMETER Pmtutimeout The timeout value in minutes. Maximum value = 1440 .PARAMETER Ftpportrange Port range configured for FTP services. .PARAMETER Crportrange Port range for cache redirection services. .PARAMETER Timezone Name of the timezone. .PARAMETER Grantquotamaxclient The percentage of shared quota to be granted at a time for maxClient. Maximum value = 100 .PARAMETER Exclusivequotamaxclient The percentage of maxClient to be given to PEs. Maximum value = 100 .PARAMETER Grantquotaspillover The percentage of shared quota to be granted at a time for spillover. Maximum value = 100 .PARAMETER Exclusivequotaspillover The percentage of max limit to be given to PEs. Maximum value = 100 .EXAMPLE PS C:\>Invoke-NSUpdateNsconfig An example how to update nsconfig config Object(s). .NOTES File Name : Invoke-NSUpdateNsconfig Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsconfig/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateScript({ $_.Length -gt 1 })] [string]$Ipaddress, [string]$Netmask, [double]$Nsvlan, [ValidateScript({ $_.Length -gt 1 })] [string[]]$Ifnum, [ValidateSet('YES', 'NO')] [string]$Tagged, [int[]]$Httpport, [double]$Maxconn, [double]$Maxreq, [ValidateSet('ENABLED', 'DISABLED')] [string]$Cip, [ValidateScript({ $_.Length -gt 1 })] [string]$Cipheader, [ValidateSet('0', '1')] [string]$Cookieversion, [ValidateSet('ENABLED', 'DISABLED')] [string]$Securecookie, [double]$Pmtumin, [double]$Pmtutimeout, [ValidateLength(1024, 64000)] [string]$Ftpportrange, [ValidateLength(1, 65535)] [string]$Crportrange, [ValidateLength(1, 64)] [string]$Timezone, [double]$Grantquotamaxclient, [double]$Exclusivequotamaxclient, [double]$Grantquotaspillover, [double]$Exclusivequotaspillover ) begin { Write-Verbose "Invoke-NSUpdateNsconfig: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('ipaddress') ) { $payload.Add('ipaddress', $ipaddress) } if ( $PSBoundParameters.ContainsKey('netmask') ) { $payload.Add('netmask', $netmask) } if ( $PSBoundParameters.ContainsKey('nsvlan') ) { $payload.Add('nsvlan', $nsvlan) } if ( $PSBoundParameters.ContainsKey('ifnum') ) { $payload.Add('ifnum', $ifnum) } if ( $PSBoundParameters.ContainsKey('tagged') ) { $payload.Add('tagged', $tagged) } if ( $PSBoundParameters.ContainsKey('httpport') ) { $payload.Add('httpport', $httpport) } if ( $PSBoundParameters.ContainsKey('maxconn') ) { $payload.Add('maxconn', $maxconn) } if ( $PSBoundParameters.ContainsKey('maxreq') ) { $payload.Add('maxreq', $maxreq) } if ( $PSBoundParameters.ContainsKey('cip') ) { $payload.Add('cip', $cip) } if ( $PSBoundParameters.ContainsKey('cipheader') ) { $payload.Add('cipheader', $cipheader) } if ( $PSBoundParameters.ContainsKey('cookieversion') ) { $payload.Add('cookieversion', $cookieversion) } if ( $PSBoundParameters.ContainsKey('securecookie') ) { $payload.Add('securecookie', $securecookie) } if ( $PSBoundParameters.ContainsKey('pmtumin') ) { $payload.Add('pmtumin', $pmtumin) } if ( $PSBoundParameters.ContainsKey('pmtutimeout') ) { $payload.Add('pmtutimeout', $pmtutimeout) } if ( $PSBoundParameters.ContainsKey('ftpportrange') ) { $payload.Add('ftpportrange', $ftpportrange) } if ( $PSBoundParameters.ContainsKey('crportrange') ) { $payload.Add('crportrange', $crportrange) } if ( $PSBoundParameters.ContainsKey('timezone') ) { $payload.Add('timezone', $timezone) } if ( $PSBoundParameters.ContainsKey('grantquotamaxclient') ) { $payload.Add('grantquotamaxclient', $grantquotamaxclient) } if ( $PSBoundParameters.ContainsKey('exclusivequotamaxclient') ) { $payload.Add('exclusivequotamaxclient', $exclusivequotamaxclient) } if ( $PSBoundParameters.ContainsKey('grantquotaspillover') ) { $payload.Add('grantquotaspillover', $grantquotaspillover) } if ( $PSBoundParameters.ContainsKey('exclusivequotaspillover') ) { $payload.Add('exclusivequotaspillover', $exclusivequotaspillover) } if ( $PSCmdlet.ShouldProcess("nsconfig", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nsconfig -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNsconfig: Finished" } } function Invoke-NSUnsetNsconfig { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for system config resource. .PARAMETER Nsvlan VLAN (NSVLAN) for the subnet on which the IP address resides. Maximum value = 4094 .PARAMETER Ftpportrange Port range configured for FTP services. .PARAMETER Crportrange Port range for cache redirection services. .PARAMETER Timezone Name of the timezone. .PARAMETER Ipaddress IP address of the Citrix ADC. Commonly referred to as NSIP address. This parameter is mandatory to bring up the appliance. .PARAMETER Netmask Netmask corresponding to the IP address. This parameter is mandatory to bring up the appliance. .PARAMETER Ifnum Interfaces of the appliances that must be bound to the NSVLAN. .PARAMETER Tagged Specifies that the interfaces will be added as 802.1q tagged interfaces. Packets sent on these interface on this VLAN will have an additional 4-byte 802.1q tag which identifies the VLAN. To use 802.1q tagging, the switch connected to the appliance's interfaces must also be configured for tagging. Possible values = YES, NO .PARAMETER Httpport The HTTP ports on the Web server. This allows the system to perform connection off-load for any client request that has a destination port matching one of these configured ports. .PARAMETER Maxconn The maximum number of connections that will be made from the system to the web server(s) attached to it. The value entered here is applied globally to all attached servers. Maximum value = 4294967294 .PARAMETER Maxreq The maximum number of requests that the system can pass on a particular connection between the system and a server attached to it. Setting this value to 0 allows an unlimited number of requests to be passed. Maximum value = 65535 .PARAMETER Cip The option to control (enable or disable) the insertion of the actual client IP address into the HTTP header request passed from the client to one, some, or all servers attached to the system. The passed address can then be accessed through a minor modification to the server. l If cipHeader is specified, it will be used as the client IP header. l If it is not specified, then the value that has been set by the set ns config CLI command will be used as the client IP header. Possible values = ENABLED, DISABLED .PARAMETER Cipheader The text that will be used as the client IP header. .PARAMETER Cookieversion The version of the cookie inserted by system. Possible values = 0, 1 .PARAMETER Securecookie enable/disable secure flag for persistence cookie. Possible values = ENABLED, DISABLED .PARAMETER Pmtumin The minimum Path MTU. Maximum value = 1500 .PARAMETER Pmtutimeout The timeout value in minutes. Maximum value = 1440 .PARAMETER Grantquotamaxclient The percentage of shared quota to be granted at a time for maxClient. Maximum value = 100 .PARAMETER Exclusivequotamaxclient The percentage of maxClient to be given to PEs. Maximum value = 100 .PARAMETER Grantquotaspillover The percentage of shared quota to be granted at a time for spillover. Maximum value = 100 .PARAMETER Exclusivequotaspillover The percentage of max limit to be given to PEs. Maximum value = 100 .EXAMPLE PS C:\>Invoke-NSUnsetNsconfig An example how to unset nsconfig config Object(s). .NOTES File Name : Invoke-NSUnsetNsconfig Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsconfig Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Boolean]$nsvlan, [Boolean]$ftpportrange, [Boolean]$crportrange, [Boolean]$timezone, [Boolean]$ipaddress, [Boolean]$netmask, [Boolean]$ifnum, [Boolean]$tagged, [Boolean]$httpport, [Boolean]$maxconn, [Boolean]$maxreq, [Boolean]$cip, [Boolean]$cipheader, [Boolean]$cookieversion, [Boolean]$securecookie, [Boolean]$pmtumin, [Boolean]$pmtutimeout, [Boolean]$grantquotamaxclient, [Boolean]$exclusivequotamaxclient, [Boolean]$grantquotaspillover, [Boolean]$exclusivequotaspillover ) begin { Write-Verbose "Invoke-NSUnsetNsconfig: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('nsvlan') ) { $payload.Add('nsvlan', $nsvlan) } if ( $PSBoundParameters.ContainsKey('ftpportrange') ) { $payload.Add('ftpportrange', $ftpportrange) } if ( $PSBoundParameters.ContainsKey('crportrange') ) { $payload.Add('crportrange', $crportrange) } if ( $PSBoundParameters.ContainsKey('timezone') ) { $payload.Add('timezone', $timezone) } if ( $PSBoundParameters.ContainsKey('ipaddress') ) { $payload.Add('ipaddress', $ipaddress) } if ( $PSBoundParameters.ContainsKey('netmask') ) { $payload.Add('netmask', $netmask) } if ( $PSBoundParameters.ContainsKey('ifnum') ) { $payload.Add('ifnum', $ifnum) } if ( $PSBoundParameters.ContainsKey('tagged') ) { $payload.Add('tagged', $tagged) } if ( $PSBoundParameters.ContainsKey('httpport') ) { $payload.Add('httpport', $httpport) } if ( $PSBoundParameters.ContainsKey('maxconn') ) { $payload.Add('maxconn', $maxconn) } if ( $PSBoundParameters.ContainsKey('maxreq') ) { $payload.Add('maxreq', $maxreq) } if ( $PSBoundParameters.ContainsKey('cip') ) { $payload.Add('cip', $cip) } if ( $PSBoundParameters.ContainsKey('cipheader') ) { $payload.Add('cipheader', $cipheader) } if ( $PSBoundParameters.ContainsKey('cookieversion') ) { $payload.Add('cookieversion', $cookieversion) } if ( $PSBoundParameters.ContainsKey('securecookie') ) { $payload.Add('securecookie', $securecookie) } if ( $PSBoundParameters.ContainsKey('pmtumin') ) { $payload.Add('pmtumin', $pmtumin) } if ( $PSBoundParameters.ContainsKey('pmtutimeout') ) { $payload.Add('pmtutimeout', $pmtutimeout) } if ( $PSBoundParameters.ContainsKey('grantquotamaxclient') ) { $payload.Add('grantquotamaxclient', $grantquotamaxclient) } if ( $PSBoundParameters.ContainsKey('exclusivequotamaxclient') ) { $payload.Add('exclusivequotamaxclient', $exclusivequotamaxclient) } if ( $PSBoundParameters.ContainsKey('grantquotaspillover') ) { $payload.Add('grantquotaspillover', $grantquotaspillover) } if ( $PSBoundParameters.ContainsKey('exclusivequotaspillover') ) { $payload.Add('exclusivequotaspillover', $exclusivequotaspillover) } if ( $PSCmdlet.ShouldProcess("nsconfig", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nsconfig -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNsconfig: Finished" } } function Invoke-NSSaveNsconfig { <# .SYNOPSIS Save System/Global level configuration. config Object. .DESCRIPTION Configuration for system config resource. .PARAMETER All Use this option to do saveconfig for all partitions. .EXAMPLE PS C:\>Invoke-NSSaveNsconfig An example how to save nsconfig config Object(s). .NOTES File Name : Invoke-NSSaveNsconfig Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsconfig/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [boolean]$All ) begin { Write-Verbose "Invoke-NSSaveNsconfig: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('all') ) { $payload.Add('all', $all) } if ( $PSCmdlet.ShouldProcess($Name, "Save System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsconfig -Action save -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSSaveNsconfig: Finished" } } function Invoke-NSDiffNsconfig { <# .SYNOPSIS Diff System/Global level configuration. config Object. .DESCRIPTION Configuration for system config resource. .PARAMETER Config1 Location of the configurations. .PARAMETER Config2 Location of the configurations. .PARAMETER Outtype Format to display the difference in configurations. Possible values = cli, xml .PARAMETER Template File that contains the commands to be compared. .PARAMETER Ignoredevicespecific Suppress device specific differences. .EXAMPLE PS C:\>Invoke-NSDiffNsconfig An example how to diff nsconfig config Object(s). .NOTES File Name : Invoke-NSDiffNsconfig Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsconfig/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [string]$Config1, [string]$Config2, [ValidateSet('cli', 'xml')] [string]$Outtype, [boolean]$Template, [boolean]$Ignoredevicespecific ) begin { Write-Verbose "Invoke-NSDiffNsconfig: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('config1') ) { $payload.Add('config1', $config1) } if ( $PSBoundParameters.ContainsKey('config2') ) { $payload.Add('config2', $config2) } if ( $PSBoundParameters.ContainsKey('outtype') ) { $payload.Add('outtype', $outtype) } if ( $PSBoundParameters.ContainsKey('template') ) { $payload.Add('template', $template) } if ( $PSBoundParameters.ContainsKey('ignoredevicespecific') ) { $payload.Add('ignoredevicespecific', $ignoredevicespecific) } if ( $PSCmdlet.ShouldProcess($Name, "Diff System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsconfig -Action diff -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDiffNsconfig: Finished" } } function Invoke-NSGetNsconfig { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for system config resource. .PARAMETER GetAll Retrieve all nsconfig object(s). .PARAMETER Count If specified, the count of the nsconfig object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsconfig Get data. .EXAMPLE PS C:\>Invoke-NSGetNsconfig -GetAll Get all nsconfig data. .EXAMPLE PS C:\>Invoke-NSGetNsconfig -name <string> Get nsconfig object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsconfig -Filter @{ 'name'='<value>' } Get nsconfig data with a filter. .NOTES File Name : Invoke-NSGetNsconfig Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsconfig/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNsconfig: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsconfig objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsconfig -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsconfig objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsconfig -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsconfig objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsconfig -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsconfig configuration for property ''" } else { Write-Verbose "Retrieving nsconfig configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsconfig -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsconfig: Ended" } } function Invoke-NSGetNsconnectiontable { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for TCP/IP connection table resource. .PARAMETER Filterexpression The maximum length of filter expression is 255 and it can be of following format: <expression> [<relop> <expression>] <relop> = ( && | || ) <expression> =: CONNECTION.<qualifier>.<qualifier-method>.(<qualifier-value>) <qualifier> = SRCIP <qualifier-method> = [ EQ | NE ] <qualifier-value> = A valid IPv4 address example = CONNECTION.SRCIP.EQ(127.0.0.1) <qualifier> = DSTIP <qualifier-method> = [ EQ | NE ] <qualifier-value> = A valid IPv4 address. example = CONNECTION.DSTIP.EQ(127.0.0.1) <qualifier> = IP <qualifier-method> = [ EQ | NE ] <qualifier-value> = A valid IPv4 address. example = CONNECTION.IP.EQ(127.0.0.1) <qualifier> = SRCIPv6 <qualifier-method> = [ EQ | NE ] <qualifier-value> = A valid IPv6 address. example = CONNECTION.SRCIPv6.EQ(2001:db8:0:0:1::1) <qualifier> = DSTIPv6 <qualifier-method> = [ EQ | NE ] <qualifier-value> = A valid IPv6 address. example = CONNECTION.DSTIPv6.EQ(2001:db8:0:0:1::1) <qualifier> = IPv6 <qualifier-method> = [ EQ | NE ] <qualifier-value> = A valid IPv6 address. example = CONNECTION.IPv6.EQ(2001:db8:0:0:1::1) <qualifier> = SRCPORT <qualifier-method> = [ EQ | NE | GT | GE | LT | LE | BETWEEN ] <qualifier-value> = A valid port number. example = CONNECTION.SRCPORT.EQ(80) <qualifier> = DSTPORT <qualifier-method> = [ EQ | NE | GT | GE | LT | LE | BETWEEN ] <qualifier-value> = A valid port number. example = CONNECTION.DSTPORT.EQ(80) <qualifier> = PORT <qualifier-method> = [ EQ | NE | GT | GE | LT | LE | BETWEEN ] <qualifier-value> = A valid port number. example = CONNECTION.PORT.EQ(80) <qualifier> = SVCNAME <qualifier-method> = [ EQ | NE | CONTAINS | STARTSWITH | ENDSWITH ] <qualifier-value> = service name. example = CONNECTION.SVCNAME.EQ("name") <qualifier> = LB_VSERVER.NAME <qualifier-method> = [ EQ | NE | CONTAINS | STARTSWITH | ENDSWITH ] <qualifier-value> = LB vserver name. example = CONNECTION.LB_VSERVER.NAME.EQ("name") <qualifier> = CS_VSERVER.NAME <qualifier-method> = [ EQ | NE | CONTAINS | STARTSWITH | ENDSWITH ] <qualifier-value> = CS vserver name. example = CONNECTION.CS_VSERVER.NAME.EQ("name") <qualifier> = INTF <qualifier-method> = [ EQ | NE ] <qualifier-value> = A valid interface id in the form of x/y (n/x/y in case of cluster interface). examle = CONNECTION.INTF.EQ("0/1/1") <qualifier> = VLANID <qualifier-method> = [ EQ | NE | GT | GE | LT | LE | BETWEEN ] <qualifier-value> = A valid VLAN ID. example = CONNECTION.VLANID.EQ(0) <qualifier> = CONNID <qualifier-method> = [ EQ | NE | GT | GE | LT | LE | BETWEEN ] <qualifier-value> = A valid PCB dev number. example = CONNECTION.CONNID.EQ(0) <qualifier> = PPEID <qualifier-method> = [ EQ | NE | GT | GE | LT | LE | BETWEEN ] <qualifier-value> = A valid core ID. example = CONNECTION.PPEID.EQ(0) <qualifier> = IDLETIME <qualifier-method> = [ EQ | NE | GT | GE | LT | LE | BETWEEN ] <qualifier-value> = A positive integer indicating the idletime. example = CONNECTION.IDLETIME.LT(100) <qualifier> = TCPSTATE <qualifier-method> = [ EQ | NE ] <qualifier-value> = ( CLOSE_WAIT | CLOSED | CLOSING | ESTABLISHED | FIN_WAIT_1 | FIN_WAIT_2 | LAST_ACK | LISTEN | SYN_RECEIVED | SYN_SENT | TIME_WAIT | NOT_APPLICABLE) example = CONNECTION.TCPSTATE.EQ(LISTEN) <qualifier> = SERVICE_TYPE <qualifier-method> = [ EQ | NE ] <qualifier-value> = ( SVC_HTTP | FTP | TCP | UDP | SSL | SSL_BRIDGE | SSL_TCP | NNTP | RPCSVR | RPCSVRS | RPCCLNT | SVC_DNS | ADNS | SNMP | RTSP | DHCPRA | NAT | ANY | MONITOR | MONITOR_UDP | MONITOR_PING | SIP_UDP | SVC_MYSQL | SVC_MSSQL | SERVICE_UNKNOWN ) example = CONNECTION.SERVICE_TYPE.EQ(ANY) <qualifier> = TRAFFIC_DOMAIN_ID <qualifier-method> = [ EQ | NE | GT | GE | LT | LE | BETWEEN ] <qualifier-value> = A valid traffic domain ID. example = CONNECTION.TRAFFIC_DOMAIN_ID.EQ(0) common usecases: Filtering out loopback connections and view present connections through netscaler show connectiontable "CONNECTION.IP.NE(127.0.0.1) && CONNECTION.TCPSTATE.EQ(ESTABLISHED)" -detail full show connections from a particular sourceip and targeted to port 80 show connectiontable "CONNECTION.SRCIP.EQ(10.102.1.91) && CONNECTION.DSTPORT.EQ(80)" show connection particular to a service and its linked client connections show connectiontable CONNECTION.SVCNAME.EQ("S1") -detail link show connections for a particular servicetype(e.g.http) show connectiontable CONNECTION.SERVICE_TYPE.EQ(TCP) viewing connections that have been idle for a long time show connectiontable CONNECTION.IDLETIME.GT(100) show connections particular to a service and idle for a long time show connectiontable "CONNECTION.SVCNAME.EQ(\\"S1\\") && CONNECTION.IDLETIME.GT(100)" show connections for a particular interface show connectiontable CONNECTION.INTF.EQ("1/1") show connections for a particular interface and vlan show connectiontable "CONNECTION.INTF.EQ(\\"1/1\\") && CONNECTION.VLANID.EQ(1)" . .PARAMETER Link Display link information if available. .PARAMETER Filtername Display name instead of IP for local entities. .PARAMETER Detail Specify display options for the connection table. * LINK - Displays the linked PCB (Protocol Control Block). * NAME - Displays along with the service name. * CONNFAILOVER - Displays PCB with connection failover. * FULL - Displays all available details. Possible values = LINK, NAME, CONNFAILOVER, FULL, NNM, FULL+ .PARAMETER Listen Display listening services only. .PARAMETER Nodeid Unique number that identifies the cluster node. Maximum value = 31 .PARAMETER GetAll Retrieve all nsconnectiontable object(s). .PARAMETER Count If specified, the count of the nsconnectiontable object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsconnectiontable Get data. .EXAMPLE PS C:\>Invoke-NSGetNsconnectiontable -GetAll Get all nsconnectiontable data. .EXAMPLE PS C:\>Invoke-NSGetNsconnectiontable -Count Get the number of nsconnectiontable objects. .EXAMPLE PS C:\>Invoke-NSGetNsconnectiontable -name <string> Get nsconnectiontable object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsconnectiontable -Filter @{ 'name'='<value>' } Get nsconnectiontable data with a filter. .NOTES File Name : Invoke-NSGetNsconnectiontable Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsconnectiontable/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByArgument')] [string]$Filterexpression, [Parameter(ParameterSetName = 'GetByArgument')] [boolean]$Link, [Parameter(ParameterSetName = 'GetByArgument')] [boolean]$Filtername, [Parameter(ParameterSetName = 'GetByArgument')] [ValidateSet('LINK', 'NAME', 'CONNFAILOVER', 'FULL', 'NNM', 'FULL+')] [string[]]$Detail, [Parameter(ParameterSetName = 'GetByArgument')] [boolean]$Listen, [Parameter(ParameterSetName = 'GetByArgument')] [double]$Nodeid, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNsconnectiontable: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsconnectiontable objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsconnectiontable -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsconnectiontable objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsconnectiontable -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsconnectiontable objects by arguments" $arguments = @{ } if ( $PSBoundParameters.ContainsKey('filterexpression') ) { $arguments.Add('filterexpression', $filterexpression) } if ( $PSBoundParameters.ContainsKey('link') ) { $arguments.Add('link', $link) } if ( $PSBoundParameters.ContainsKey('filtername') ) { $arguments.Add('filtername', $filtername) } if ( $PSBoundParameters.ContainsKey('detail') ) { $arguments.Add('detail', $detail) } if ( $PSBoundParameters.ContainsKey('listen') ) { $arguments.Add('listen', $listen) } if ( $PSBoundParameters.ContainsKey('nodeid') ) { $arguments.Add('nodeid', $nodeid) } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsconnectiontable -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsconnectiontable configuration for property ''" } else { Write-Verbose "Retrieving nsconnectiontable configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsconnectiontable -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsconnectiontable: Ended" } } function Invoke-NSUpdateNsconsoleloginprompt { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for console prompt resource. .PARAMETER Promptstring Console login prompt string. .EXAMPLE PS C:\>Invoke-NSUpdateNsconsoleloginprompt An example how to update nsconsoleloginprompt config Object(s). .NOTES File Name : Invoke-NSUpdateNsconsoleloginprompt Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsconsoleloginprompt/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [string]$Promptstring ) begin { Write-Verbose "Invoke-NSUpdateNsconsoleloginprompt: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('promptstring') ) { $payload.Add('promptstring', $promptstring) } if ( $PSCmdlet.ShouldProcess("nsconsoleloginprompt", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nsconsoleloginprompt -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNsconsoleloginprompt: Finished" } } function Invoke-NSUnsetNsconsoleloginprompt { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for console prompt resource. .PARAMETER Promptstring Console login prompt string. .EXAMPLE PS C:\>Invoke-NSUnsetNsconsoleloginprompt An example how to unset nsconsoleloginprompt config Object(s). .NOTES File Name : Invoke-NSUnsetNsconsoleloginprompt Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsconsoleloginprompt Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Boolean]$promptstring ) begin { Write-Verbose "Invoke-NSUnsetNsconsoleloginprompt: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('promptstring') ) { $payload.Add('promptstring', $promptstring) } if ( $PSCmdlet.ShouldProcess("nsconsoleloginprompt", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nsconsoleloginprompt -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNsconsoleloginprompt: Finished" } } function Invoke-NSGetNsconsoleloginprompt { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for console prompt resource. .PARAMETER GetAll Retrieve all nsconsoleloginprompt object(s). .PARAMETER Count If specified, the count of the nsconsoleloginprompt object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsconsoleloginprompt Get data. .EXAMPLE PS C:\>Invoke-NSGetNsconsoleloginprompt -GetAll Get all nsconsoleloginprompt data. .EXAMPLE PS C:\>Invoke-NSGetNsconsoleloginprompt -name <string> Get nsconsoleloginprompt object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsconsoleloginprompt -Filter @{ 'name'='<value>' } Get nsconsoleloginprompt data with a filter. .NOTES File Name : Invoke-NSGetNsconsoleloginprompt Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsconsoleloginprompt/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNsconsoleloginprompt: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsconsoleloginprompt objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsconsoleloginprompt -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsconsoleloginprompt objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsconsoleloginprompt -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsconsoleloginprompt objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsconsoleloginprompt -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsconsoleloginprompt configuration for property ''" } else { Write-Verbose "Retrieving nsconsoleloginprompt configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsconsoleloginprompt -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsconsoleloginprompt: Ended" } } function Invoke-NSUpdateNscqaparam { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for cqaparam resource. .PARAMETER Harqretxdelay HARQ retransmission delay (in ms). Maximum value = 64000 .PARAMETER Net1label Name of the network label. .PARAMETER Minrttnet1 MIN RTT (in ms) for the first network. Maximum value = 6400 .PARAMETER Lr1coeflist coefficients values for Label1. .PARAMETER Lr1probthresh Probability threshold values for LR model to differentiate between NET1 and reset(NET2 and NET3). Maximum value = 1 .PARAMETER Net1cclscale Three congestion level scores limits corresponding to None, Low, Medium. .PARAMETER Net1csqscale Three signal quality level scores limits corresponding to Excellent, Good, Fair. .PARAMETER Net1logcoef Connection quality ranking Log coefficients of network 1. .PARAMETER Net2label Name of the network label 2. .PARAMETER Minrttnet2 MIN RTT (in ms) for the second network. Maximum value = 6400 .PARAMETER Lr2coeflist coefficients values for Label 2. .PARAMETER Lr2probthresh Probability threshold values for LR model to differentiate between NET2 and NET3. Maximum value = 1 .PARAMETER Net2cclscale Three congestion level scores limits corresponding to None, Low, Medium. .PARAMETER Net2csqscale Three signal quality level scores limits corresponding to Excellent, Good, Fair. .PARAMETER Net2logcoef Connnection quality ranking Log coefficients of network 2. .PARAMETER Net3label Name of the network label 3. .PARAMETER Minrttnet3 MIN RTT (in ms) for the third network. Maximum value = 6400 .PARAMETER Net3cclscale Three congestion level scores limits corresponding to None, Low, Medium. .PARAMETER Net3csqscale Three signal quality level scores limits corresponding to Excellent, Good, Fair. .PARAMETER Net3logcoef Connection quality ranking Log coefficients of network 3. .EXAMPLE PS C:\>Invoke-NSUpdateNscqaparam An example how to update nscqaparam config Object(s). .NOTES File Name : Invoke-NSUpdateNscqaparam Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nscqaparam/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [double]$Harqretxdelay, [string]$Net1label, [double]$Minrttnet1, [string]$Lr1coeflist, [double]$Lr1probthresh, [string]$Net1cclscale, [string]$Net1csqscale, [string]$Net1logcoef, [string]$Net2label, [double]$Minrttnet2, [string]$Lr2coeflist, [double]$Lr2probthresh, [string]$Net2cclscale, [string]$Net2csqscale, [string]$Net2logcoef, [string]$Net3label, [double]$Minrttnet3, [string]$Net3cclscale, [string]$Net3csqscale, [string]$Net3logcoef ) begin { Write-Verbose "Invoke-NSUpdateNscqaparam: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('harqretxdelay') ) { $payload.Add('harqretxdelay', $harqretxdelay) } if ( $PSBoundParameters.ContainsKey('net1label') ) { $payload.Add('net1label', $net1label) } if ( $PSBoundParameters.ContainsKey('minrttnet1') ) { $payload.Add('minrttnet1', $minrttnet1) } if ( $PSBoundParameters.ContainsKey('lr1coeflist') ) { $payload.Add('lr1coeflist', $lr1coeflist) } if ( $PSBoundParameters.ContainsKey('lr1probthresh') ) { $payload.Add('lr1probthresh', $lr1probthresh) } if ( $PSBoundParameters.ContainsKey('net1cclscale') ) { $payload.Add('net1cclscale', $net1cclscale) } if ( $PSBoundParameters.ContainsKey('net1csqscale') ) { $payload.Add('net1csqscale', $net1csqscale) } if ( $PSBoundParameters.ContainsKey('net1logcoef') ) { $payload.Add('net1logcoef', $net1logcoef) } if ( $PSBoundParameters.ContainsKey('net2label') ) { $payload.Add('net2label', $net2label) } if ( $PSBoundParameters.ContainsKey('minrttnet2') ) { $payload.Add('minrttnet2', $minrttnet2) } if ( $PSBoundParameters.ContainsKey('lr2coeflist') ) { $payload.Add('lr2coeflist', $lr2coeflist) } if ( $PSBoundParameters.ContainsKey('lr2probthresh') ) { $payload.Add('lr2probthresh', $lr2probthresh) } if ( $PSBoundParameters.ContainsKey('net2cclscale') ) { $payload.Add('net2cclscale', $net2cclscale) } if ( $PSBoundParameters.ContainsKey('net2csqscale') ) { $payload.Add('net2csqscale', $net2csqscale) } if ( $PSBoundParameters.ContainsKey('net2logcoef') ) { $payload.Add('net2logcoef', $net2logcoef) } if ( $PSBoundParameters.ContainsKey('net3label') ) { $payload.Add('net3label', $net3label) } if ( $PSBoundParameters.ContainsKey('minrttnet3') ) { $payload.Add('minrttnet3', $minrttnet3) } if ( $PSBoundParameters.ContainsKey('net3cclscale') ) { $payload.Add('net3cclscale', $net3cclscale) } if ( $PSBoundParameters.ContainsKey('net3csqscale') ) { $payload.Add('net3csqscale', $net3csqscale) } if ( $PSBoundParameters.ContainsKey('net3logcoef') ) { $payload.Add('net3logcoef', $net3logcoef) } if ( $PSCmdlet.ShouldProcess("nscqaparam", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nscqaparam -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNscqaparam: Finished" } } function Invoke-NSUnsetNscqaparam { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for cqaparam resource. .PARAMETER Harqretxdelay HARQ retransmission delay (in ms). Maximum value = 64000 .PARAMETER Net1label Name of the network label. .PARAMETER Minrttnet1 MIN RTT (in ms) for the first network. Maximum value = 6400 .PARAMETER Lr1coeflist coefficients values for Label1. .PARAMETER Lr1probthresh Probability threshold values for LR model to differentiate between NET1 and reset(NET2 and NET3). Maximum value = 1 .PARAMETER Net1cclscale Three congestion level scores limits corresponding to None, Low, Medium. .PARAMETER Net1csqscale Three signal quality level scores limits corresponding to Excellent, Good, Fair. .PARAMETER Net1logcoef Connection quality ranking Log coefficients of network 1. .PARAMETER Net2label Name of the network label 2. .PARAMETER Minrttnet2 MIN RTT (in ms) for the second network. Maximum value = 6400 .PARAMETER Net2cclscale Three congestion level scores limits corresponding to None, Low, Medium. .PARAMETER Net2csqscale Three signal quality level scores limits corresponding to Excellent, Good, Fair. .PARAMETER Net2logcoef Connnection quality ranking Log coefficients of network 2. .PARAMETER Net3label Name of the network label 3. .PARAMETER Minrttnet3 MIN RTT (in ms) for the third network. Maximum value = 6400 .PARAMETER Net3cclscale Three congestion level scores limits corresponding to None, Low, Medium. .PARAMETER Net3csqscale Three signal quality level scores limits corresponding to Excellent, Good, Fair. .PARAMETER Net3logcoef Connection quality ranking Log coefficients of network 3. .EXAMPLE PS C:\>Invoke-NSUnsetNscqaparam An example how to unset nscqaparam config Object(s). .NOTES File Name : Invoke-NSUnsetNscqaparam Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nscqaparam Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Boolean]$harqretxdelay, [Boolean]$net1label, [Boolean]$minrttnet1, [Boolean]$lr1coeflist, [Boolean]$lr1probthresh, [Boolean]$net1cclscale, [Boolean]$net1csqscale, [Boolean]$net1logcoef, [Boolean]$net2label, [Boolean]$minrttnet2, [Boolean]$net2cclscale, [Boolean]$net2csqscale, [Boolean]$net2logcoef, [Boolean]$net3label, [Boolean]$minrttnet3, [Boolean]$net3cclscale, [Boolean]$net3csqscale, [Boolean]$net3logcoef ) begin { Write-Verbose "Invoke-NSUnsetNscqaparam: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('harqretxdelay') ) { $payload.Add('harqretxdelay', $harqretxdelay) } if ( $PSBoundParameters.ContainsKey('net1label') ) { $payload.Add('net1label', $net1label) } if ( $PSBoundParameters.ContainsKey('minrttnet1') ) { $payload.Add('minrttnet1', $minrttnet1) } if ( $PSBoundParameters.ContainsKey('lr1coeflist') ) { $payload.Add('lr1coeflist', $lr1coeflist) } if ( $PSBoundParameters.ContainsKey('lr1probthresh') ) { $payload.Add('lr1probthresh', $lr1probthresh) } if ( $PSBoundParameters.ContainsKey('net1cclscale') ) { $payload.Add('net1cclscale', $net1cclscale) } if ( $PSBoundParameters.ContainsKey('net1csqscale') ) { $payload.Add('net1csqscale', $net1csqscale) } if ( $PSBoundParameters.ContainsKey('net1logcoef') ) { $payload.Add('net1logcoef', $net1logcoef) } if ( $PSBoundParameters.ContainsKey('net2label') ) { $payload.Add('net2label', $net2label) } if ( $PSBoundParameters.ContainsKey('minrttnet2') ) { $payload.Add('minrttnet2', $minrttnet2) } if ( $PSBoundParameters.ContainsKey('net2cclscale') ) { $payload.Add('net2cclscale', $net2cclscale) } if ( $PSBoundParameters.ContainsKey('net2csqscale') ) { $payload.Add('net2csqscale', $net2csqscale) } if ( $PSBoundParameters.ContainsKey('net2logcoef') ) { $payload.Add('net2logcoef', $net2logcoef) } if ( $PSBoundParameters.ContainsKey('net3label') ) { $payload.Add('net3label', $net3label) } if ( $PSBoundParameters.ContainsKey('minrttnet3') ) { $payload.Add('minrttnet3', $minrttnet3) } if ( $PSBoundParameters.ContainsKey('net3cclscale') ) { $payload.Add('net3cclscale', $net3cclscale) } if ( $PSBoundParameters.ContainsKey('net3csqscale') ) { $payload.Add('net3csqscale', $net3csqscale) } if ( $PSBoundParameters.ContainsKey('net3logcoef') ) { $payload.Add('net3logcoef', $net3logcoef) } if ( $PSCmdlet.ShouldProcess("nscqaparam", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nscqaparam -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNscqaparam: Finished" } } function Invoke-NSGetNscqaparam { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for cqaparam resource. .PARAMETER GetAll Retrieve all nscqaparam object(s). .PARAMETER Count If specified, the count of the nscqaparam object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNscqaparam Get data. .EXAMPLE PS C:\>Invoke-NSGetNscqaparam -GetAll Get all nscqaparam data. .EXAMPLE PS C:\>Invoke-NSGetNscqaparam -name <string> Get nscqaparam object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNscqaparam -Filter @{ 'name'='<value>' } Get nscqaparam data with a filter. .NOTES File Name : Invoke-NSGetNscqaparam Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nscqaparam/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNscqaparam: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nscqaparam objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nscqaparam -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nscqaparam objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nscqaparam -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nscqaparam objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nscqaparam -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nscqaparam configuration for property ''" } else { Write-Verbose "Retrieving nscqaparam configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nscqaparam -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNscqaparam: Ended" } } function Invoke-NSReleaseNsdhcpip { <# .SYNOPSIS Release System/Global level configuration. config Object. .DESCRIPTION Configuration for dhcp IP resource. .EXAMPLE PS C:\>Invoke-NSReleaseNsdhcpip An example how to release nsdhcpip config Object(s). .NOTES File Name : Invoke-NSReleaseNsdhcpip Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsdhcpip/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession) ) begin { Write-Verbose "Invoke-NSReleaseNsdhcpip: Starting" } process { try { $payload = @{ } if ( $PSCmdlet.ShouldProcess($Name, "Release System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsdhcpip -Action release -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSReleaseNsdhcpip: Finished" } } function Invoke-NSUpdateNsdhcpparams { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for DHCP parameters resource. .PARAMETER Dhcpclient Enables DHCP client to acquire IP address from the DHCP server in the next boot. When set to OFF, disables the DHCP client in the next boot. Possible values = ON, OFF .PARAMETER Saveroute DHCP acquired routes are saved on the Citrix ADC. Possible values = ON, OFF .EXAMPLE PS C:\>Invoke-NSUpdateNsdhcpparams An example how to update nsdhcpparams config Object(s). .NOTES File Name : Invoke-NSUpdateNsdhcpparams Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsdhcpparams/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateSet('ON', 'OFF')] [string]$Dhcpclient, [ValidateSet('ON', 'OFF')] [string]$Saveroute ) begin { Write-Verbose "Invoke-NSUpdateNsdhcpparams: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('dhcpclient') ) { $payload.Add('dhcpclient', $dhcpclient) } if ( $PSBoundParameters.ContainsKey('saveroute') ) { $payload.Add('saveroute', $saveroute) } if ( $PSCmdlet.ShouldProcess("nsdhcpparams", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nsdhcpparams -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNsdhcpparams: Finished" } } function Invoke-NSUnsetNsdhcpparams { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for DHCP parameters resource. .PARAMETER Dhcpclient Enables DHCP client to acquire IP address from the DHCP server in the next boot. When set to OFF, disables the DHCP client in the next boot. Possible values = ON, OFF .PARAMETER Saveroute DHCP acquired routes are saved on the Citrix ADC. Possible values = ON, OFF .EXAMPLE PS C:\>Invoke-NSUnsetNsdhcpparams An example how to unset nsdhcpparams config Object(s). .NOTES File Name : Invoke-NSUnsetNsdhcpparams Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsdhcpparams Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Boolean]$dhcpclient, [Boolean]$saveroute ) begin { Write-Verbose "Invoke-NSUnsetNsdhcpparams: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('dhcpclient') ) { $payload.Add('dhcpclient', $dhcpclient) } if ( $PSBoundParameters.ContainsKey('saveroute') ) { $payload.Add('saveroute', $saveroute) } if ( $PSCmdlet.ShouldProcess("nsdhcpparams", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nsdhcpparams -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNsdhcpparams: Finished" } } function Invoke-NSGetNsdhcpparams { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for DHCP parameters resource. .PARAMETER GetAll Retrieve all nsdhcpparams object(s). .PARAMETER Count If specified, the count of the nsdhcpparams object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsdhcpparams Get data. .EXAMPLE PS C:\>Invoke-NSGetNsdhcpparams -GetAll Get all nsdhcpparams data. .EXAMPLE PS C:\>Invoke-NSGetNsdhcpparams -name <string> Get nsdhcpparams object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsdhcpparams -Filter @{ 'name'='<value>' } Get nsdhcpparams data with a filter. .NOTES File Name : Invoke-NSGetNsdhcpparams Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsdhcpparams/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNsdhcpparams: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsdhcpparams objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsdhcpparams -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsdhcpparams objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsdhcpparams -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsdhcpparams objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsdhcpparams -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsdhcpparams configuration for property ''" } else { Write-Verbose "Retrieving nsdhcpparams configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsdhcpparams -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsdhcpparams: Ended" } } function Invoke-NSUpdateNsdiameter { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for Diameter Parameters resource. .PARAMETER Identity DiameterIdentity to be used by NS. DiameterIdentity is used to identify a Diameter node uniquely. Before setting up diameter configuration, Citrix ADC (as a Diameter node) MUST be assigned a unique DiameterIdentity. example => set ns diameter -identity netscaler.com Now whenever Citrix ADC needs to use identity in diameter messages. It will use 'netscaler.com' as Origin-Host AVP as defined in RFC3588 . .PARAMETER Realm Diameter Realm to be used by NS. example => set ns diameter -realm com Now whenever Citrix ADC system needs to use realm in diameter messages. It will use 'com' as Origin-Realm AVP as defined in RFC3588 . .PARAMETER Serverclosepropagation when a Server connection goes down, whether to close the corresponding client connection if there were requests pending on the server. Possible values = YES, NO .PARAMETER Ownernode ID of the cluster node for which the diameter id is set, can be configured only through CLIP. Maximum value = 31 .PARAMETER PassThru Return details about the created nsdiameter item. .EXAMPLE PS C:\>Invoke-NSUpdateNsdiameter An example how to update nsdiameter config Object(s). .NOTES File Name : Invoke-NSUpdateNsdiameter Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsdiameter/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateScript({ $_.Length -gt 1 })] [string]$Identity, [ValidateScript({ $_.Length -gt 1 })] [string]$Realm, [ValidateSet('YES', 'NO')] [string]$Serverclosepropagation, [double]$Ownernode, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateNsdiameter: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('identity') ) { $payload.Add('identity', $identity) } if ( $PSBoundParameters.ContainsKey('realm') ) { $payload.Add('realm', $realm) } if ( $PSBoundParameters.ContainsKey('serverclosepropagation') ) { $payload.Add('serverclosepropagation', $serverclosepropagation) } if ( $PSBoundParameters.ContainsKey('ownernode') ) { $payload.Add('ownernode', $ownernode) } if ( $PSCmdlet.ShouldProcess("nsdiameter", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nsdiameter -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNsdiameter -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNsdiameter: Finished" } } function Invoke-NSUnsetNsdiameter { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for Diameter Parameters resource. .PARAMETER Serverclosepropagation when a Server connection goes down, whether to close the corresponding client connection if there were requests pending on the server. Possible values = YES, NO .PARAMETER Ownernode ID of the cluster node for which the diameter id is set, can be configured only through CLIP. Maximum value = 31 .EXAMPLE PS C:\>Invoke-NSUnsetNsdiameter An example how to unset nsdiameter config Object(s). .NOTES File Name : Invoke-NSUnsetNsdiameter Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsdiameter Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Boolean]$serverclosepropagation, [Boolean]$ownernode ) begin { Write-Verbose "Invoke-NSUnsetNsdiameter: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('serverclosepropagation') ) { $payload.Add('serverclosepropagation', $serverclosepropagation) } if ( $PSBoundParameters.ContainsKey('ownernode') ) { $payload.Add('ownernode', $ownernode) } if ( $PSCmdlet.ShouldProcess("nsdiameter", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nsdiameter -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNsdiameter: Finished" } } function Invoke-NSGetNsdiameter { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for Diameter Parameters resource. .PARAMETER Ownernode ID of the cluster node for which the diameter id is set, can be configured only through CLIP. Maximum value = 31 .PARAMETER GetAll Retrieve all nsdiameter object(s). .PARAMETER Count If specified, the count of the nsdiameter object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsdiameter Get data. .EXAMPLE PS C:\>Invoke-NSGetNsdiameter -GetAll Get all nsdiameter data. .EXAMPLE PS C:\>Invoke-NSGetNsdiameter -Count Get the number of nsdiameter objects. .EXAMPLE PS C:\>Invoke-NSGetNsdiameter -name <string> Get nsdiameter object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsdiameter -Filter @{ 'name'='<value>' } Get nsdiameter data with a filter. .NOTES File Name : Invoke-NSGetNsdiameter Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsdiameter/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [double]$Ownernode, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNsdiameter: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsdiameter objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsdiameter -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsdiameter objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsdiameter -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsdiameter objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsdiameter -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsdiameter configuration for property 'ownernode'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsdiameter -NitroPath nitro/v1/config -Resource $ownernode -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nsdiameter configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsdiameter -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsdiameter: Ended" } } function Invoke-NSAddNsencryptionkey { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Configuration for encryption key resource. .PARAMETER Name Key name. This follows the same syntax rules as other expression entity names: It must begin with an alpha character (A-Z or a-z) or an underscore (_). The rest of the characters must be alpha, numeric (0-9) or underscores. It cannot be re or xp (reserved for regular and XPath expressions). It cannot be an expression reserved word (e.g. SYS or HTTP). It cannot be used for an existing expression object (HTTP callout, patset, dataset, stringmap, or named expression). .PARAMETER Method Cipher method to be used to encrypt and decrypt content. NONE - no encryption or decryption is performed The output of ENCRYPT() and DECRYPT() is the same as the input. RC4 - the RC4 stream cipher with a 128 bit (16 byte) key; RC4 is now considered insecure and should only be used if required by existing applciations. DES[-<mode>] - the Data Encryption Standard (DES) block cipher with a 64-bit (8 byte) key, with 56 data bits and 8 parity bits. DES is considered less secure than DES3 or AES so it should only be used if required by an existing applicastion. The optional mode is described below; DES without a mode is equivalent to DES-CBC. DES3[-<mode>] - the Triple Data Encryption Standard (DES) block cipher with a 192-bit (24 byte) key. The optional mode is described below; DES3 without a mode is equivalent to DES3-CBC. AES<keysize>[-<mode>] - the Advanced Encryption Standard block cipher, available with 128 bit (16 byte), 192 bit (24 byte), and 256 bit (32 byte) keys. The optional mode is described below; AES<keysize> without a mode is equivalent to AES<keysize>-CBC. For a block cipher, the <mode> specifies how multiple blocks of plaintext are encrypted and how the Initialization Vector (IV) is used. Choices are CBC (Cipher Block Chaining) - Each block of plaintext is XORed with the previous ciphertext block, or IV for the first block, before being encrypted. Padding is required if the plaintext is not a multiple of the cipher block size. CFB (Cipher Feedback) - The previous ciphertext block, or the IV for the first block, is encrypted and the output is XORed with the current plaintext block to create the current ciphertext block. The 128-bit version of CFB is provided. Padding is not required. OFB (Output Feedback) - A keystream is generated by applying the cipher successfully to the IV and XORing the keystream blocks with the plaintext. Padding is not required. ECB (Electronic Codebook) - Each block of plaintext is independently encrypted. An IV is not used. Padding is required. This mode is considered less secure than the other modes because the same plaintext always produces the same encrypted text and should only be used if required by an existing application. Possible values = NONE, RC4, DES3, AES128, AES192, AES256, DES, DES-CBC, DES-CFB, DES-OFB, DES-ECB, DES3-CBC, DES3-CFB, DES3-OFB, DES3-ECB, AES128-CBC, AES128-CFB, AES128-OFB, AES128-ECB, AES192-CBC, AES192-CFB, AES192-OFB, AES192-ECB, AES256-CBC, AES256-CFB, AES256-OFB, AES256-ECB .PARAMETER Keyvalue The hex-encoded key value. The length is determined by the cipher method: RC4 - 16 bytes DES - 8 bytes (all modes) DES3 - 24 bytes (all modes) AES128 - 16 bytes (all modes) AES192 - 24 bytes (all modes) AES256 - 32 bytes (all modes) Note that the keyValue will be encrypted when it it is saved. There is a special key value AUTO which generates a new random key for the specified method. This kind of key is intended for use cases where the NetScaler both encrypts and decrypts the same data, such an HTTP header. .PARAMETER Padding Enables or disables the padding of plaintext to meet the block size requirements of block ciphers: ON - For encryption, PKCS5/7 padding is used, which appends n bytes of value n on the end of the plaintext to bring it to the cipher block lnegth. If the plaintext length is alraady a multiple of the block length, an additional block with bytes of value block_length will be added. For decryption, ISO 10126 padding is accepted, which expects the last byte of the block to be the number of added pad bytes. Note that this accepts PKCS5/7 padding, as well as ANSI_X923 padding. Padding ON is the default for the ECB and CBD modes. OFF - No padding. An Undef error will occur with the ECB or CBC modes if the plaintext length is not a multitple of the cipher block size. This can be used with the CFB and OFB modes, and with the ECB and CBC modes if the plaintext will always be an integral number of blocks, or if custom padding is implemented using a policy extension function. Padding OFf is the default for CFB and OFB modes. Possible values = OFF, ON .PARAMETER InitalizationVector The initalization voector (IV) for a block cipher, one block of data used to initialize the encryption. The best practice is to not specify an IV, in which case a new random IV will be generated for each encryption. The format must be iv_data or keyid_iv_data to include the generated IV in the encrypted data. The IV should only be specified if it cannot be included in the encrypted data. The IV length is the cipher block size: RC4 - not used (error if IV is specified) DES - 8 bytes (all modes) DES3 - 8 bytes (all modes) AES128 - 16 bytes (all modes) AES192 - 16 bytes (all modes) AES256 - 16 bytes (all modes). .PARAMETER Comment Comments associated with this encryption key. .PARAMETER PassThru Return details about the created nsencryptionkey item. .EXAMPLE PS C:\>Invoke-NSAddNsencryptionkey -name <string> -method <string> An example how to add nsencryptionkey config Object(s). .NOTES File Name : Invoke-NSAddNsencryptionkey Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsencryptionkey/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [Parameter(Mandatory)] [ValidateSet('NONE', 'RC4', 'DES3', 'AES128', 'AES192', 'AES256', 'DES', 'DES-CBC', 'DES-CFB', 'DES-OFB', 'DES-ECB', 'DES3-CBC', 'DES3-CFB', 'DES3-OFB', 'DES3-ECB', 'AES128-CBC', 'AES128-CFB', 'AES128-OFB', 'AES128-ECB', 'AES192-CBC', 'AES192-CFB', 'AES192-OFB', 'AES192-ECB', 'AES256-CBC', 'AES256-CFB', 'AES256-OFB', 'AES256-ECB')] [string]$Method, [string]$Keyvalue, [ValidateSet('OFF', 'ON')] [string]$Padding = 'DEFAULT', [string]$InitalizationVector, [string]$Comment, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNsencryptionkey: Starting" } process { try { $payload = @{ name = $name method = $method } if ( $PSBoundParameters.ContainsKey('keyvalue') ) { $payload.Add('keyvalue', $keyvalue) } if ( $PSBoundParameters.ContainsKey('padding') ) { $payload.Add('padding', $padding) } if ( $PSBoundParameters.ContainsKey('InitalizationVector') ) { $payload.Add('iv', $InitalizationVector) } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSCmdlet.ShouldProcess("nsencryptionkey", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsencryptionkey -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNsencryptionkey -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNsencryptionkey: Finished" } } function Invoke-NSUpdateNsencryptionkey { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for encryption key resource. .PARAMETER Name Key name. This follows the same syntax rules as other expression entity names: It must begin with an alpha character (A-Z or a-z) or an underscore (_). The rest of the characters must be alpha, numeric (0-9) or underscores. It cannot be re or xp (reserved for regular and XPath expressions). It cannot be an expression reserved word (e.g. SYS or HTTP). It cannot be used for an existing expression object (HTTP callout, patset, dataset, stringmap, or named expression). .PARAMETER Method Cipher method to be used to encrypt and decrypt content. NONE - no encryption or decryption is performed The output of ENCRYPT() and DECRYPT() is the same as the input. RC4 - the RC4 stream cipher with a 128 bit (16 byte) key; RC4 is now considered insecure and should only be used if required by existing applciations. DES[-<mode>] - the Data Encryption Standard (DES) block cipher with a 64-bit (8 byte) key, with 56 data bits and 8 parity bits. DES is considered less secure than DES3 or AES so it should only be used if required by an existing applicastion. The optional mode is described below; DES without a mode is equivalent to DES-CBC. DES3[-<mode>] - the Triple Data Encryption Standard (DES) block cipher with a 192-bit (24 byte) key. The optional mode is described below; DES3 without a mode is equivalent to DES3-CBC. AES<keysize>[-<mode>] - the Advanced Encryption Standard block cipher, available with 128 bit (16 byte), 192 bit (24 byte), and 256 bit (32 byte) keys. The optional mode is described below; AES<keysize> without a mode is equivalent to AES<keysize>-CBC. For a block cipher, the <mode> specifies how multiple blocks of plaintext are encrypted and how the Initialization Vector (IV) is used. Choices are CBC (Cipher Block Chaining) - Each block of plaintext is XORed with the previous ciphertext block, or IV for the first block, before being encrypted. Padding is required if the plaintext is not a multiple of the cipher block size. CFB (Cipher Feedback) - The previous ciphertext block, or the IV for the first block, is encrypted and the output is XORed with the current plaintext block to create the current ciphertext block. The 128-bit version of CFB is provided. Padding is not required. OFB (Output Feedback) - A keystream is generated by applying the cipher successfully to the IV and XORing the keystream blocks with the plaintext. Padding is not required. ECB (Electronic Codebook) - Each block of plaintext is independently encrypted. An IV is not used. Padding is required. This mode is considered less secure than the other modes because the same plaintext always produces the same encrypted text and should only be used if required by an existing application. Possible values = NONE, RC4, DES3, AES128, AES192, AES256, DES, DES-CBC, DES-CFB, DES-OFB, DES-ECB, DES3-CBC, DES3-CFB, DES3-OFB, DES3-ECB, AES128-CBC, AES128-CFB, AES128-OFB, AES128-ECB, AES192-CBC, AES192-CFB, AES192-OFB, AES192-ECB, AES256-CBC, AES256-CFB, AES256-OFB, AES256-ECB .PARAMETER Keyvalue The hex-encoded key value. The length is determined by the cipher method: RC4 - 16 bytes DES - 8 bytes (all modes) DES3 - 24 bytes (all modes) AES128 - 16 bytes (all modes) AES192 - 24 bytes (all modes) AES256 - 32 bytes (all modes) Note that the keyValue will be encrypted when it it is saved. There is a special key value AUTO which generates a new random key for the specified method. This kind of key is intended for use cases where the NetScaler both encrypts and decrypts the same data, such an HTTP header. .PARAMETER Padding Enables or disables the padding of plaintext to meet the block size requirements of block ciphers: ON - For encryption, PKCS5/7 padding is used, which appends n bytes of value n on the end of the plaintext to bring it to the cipher block lnegth. If the plaintext length is alraady a multiple of the block length, an additional block with bytes of value block_length will be added. For decryption, ISO 10126 padding is accepted, which expects the last byte of the block to be the number of added pad bytes. Note that this accepts PKCS5/7 padding, as well as ANSI_X923 padding. Padding ON is the default for the ECB and CBD modes. OFF - No padding. An Undef error will occur with the ECB or CBC modes if the plaintext length is not a multitple of the cipher block size. This can be used with the CFB and OFB modes, and with the ECB and CBC modes if the plaintext will always be an integral number of blocks, or if custom padding is implemented using a policy extension function. Padding OFf is the default for CFB and OFB modes. Possible values = OFF, ON .PARAMETER InitalizationVector The initalization voector (IV) for a block cipher, one block of data used to initialize the encryption. The best practice is to not specify an IV, in which case a new random IV will be generated for each encryption. The format must be iv_data or keyid_iv_data to include the generated IV in the encrypted data. The IV should only be specified if it cannot be included in the encrypted data. The IV length is the cipher block size: RC4 - not used (error if IV is specified) DES - 8 bytes (all modes) DES3 - 8 bytes (all modes) AES128 - 16 bytes (all modes) AES192 - 16 bytes (all modes) AES256 - 16 bytes (all modes). .PARAMETER Comment Comments associated with this encryption key. .PARAMETER PassThru Return details about the created nsencryptionkey item. .EXAMPLE PS C:\>Invoke-NSUpdateNsencryptionkey -name <string> An example how to update nsencryptionkey config Object(s). .NOTES File Name : Invoke-NSUpdateNsencryptionkey Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsencryptionkey/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [ValidateSet('NONE', 'RC4', 'DES3', 'AES128', 'AES192', 'AES256', 'DES', 'DES-CBC', 'DES-CFB', 'DES-OFB', 'DES-ECB', 'DES3-CBC', 'DES3-CFB', 'DES3-OFB', 'DES3-ECB', 'AES128-CBC', 'AES128-CFB', 'AES128-OFB', 'AES128-ECB', 'AES192-CBC', 'AES192-CFB', 'AES192-OFB', 'AES192-ECB', 'AES256-CBC', 'AES256-CFB', 'AES256-OFB', 'AES256-ECB')] [string]$Method, [string]$Keyvalue, [ValidateSet('OFF', 'ON')] [string]$Padding, [string]$InitalizationVector, [string]$Comment, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateNsencryptionkey: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('method') ) { $payload.Add('method', $method) } if ( $PSBoundParameters.ContainsKey('keyvalue') ) { $payload.Add('keyvalue', $keyvalue) } if ( $PSBoundParameters.ContainsKey('padding') ) { $payload.Add('padding', $padding) } if ( $PSBoundParameters.ContainsKey('InitalizationVector') ) { $payload.Add('iv', $InitalizationVector) } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSCmdlet.ShouldProcess("nsencryptionkey", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nsencryptionkey -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNsencryptionkey -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNsencryptionkey: Finished" } } function Invoke-NSUnsetNsencryptionkey { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for encryption key resource. .PARAMETER Name Key name. This follows the same syntax rules as other expression entity names: It must begin with an alpha character (A-Z or a-z) or an underscore (_). The rest of the characters must be alpha, numeric (0-9) or underscores. It cannot be re or xp (reserved for regular and XPath expressions). It cannot be an expression reserved word (e.g. SYS or HTTP). It cannot be used for an existing expression object (HTTP callout, patset, dataset, stringmap, or named expression). .PARAMETER Padding Enables or disables the padding of plaintext to meet the block size requirements of block ciphers: ON - For encryption, PKCS5/7 padding is used, which appends n bytes of value n on the end of the plaintext to bring it to the cipher block lnegth. If the plaintext length is alraady a multiple of the block length, an additional block with bytes of value block_length will be added. For decryption, ISO 10126 padding is accepted, which expects the last byte of the block to be the number of added pad bytes. Note that this accepts PKCS5/7 padding, as well as ANSI_X923 padding. Padding ON is the default for the ECB and CBD modes. OFF - No padding. An Undef error will occur with the ECB or CBC modes if the plaintext length is not a multitple of the cipher block size. This can be used with the CFB and OFB modes, and with the ECB and CBC modes if the plaintext will always be an integral number of blocks, or if custom padding is implemented using a policy extension function. Padding OFf is the default for CFB and OFB modes. Possible values = OFF, ON .PARAMETER InitalizationVector The initalization voector (IV) for a block cipher, one block of data used to initialize the encryption. The best practice is to not specify an IV, in which case a new random IV will be generated for each encryption. The format must be iv_data or keyid_iv_data to include the generated IV in the encrypted data. The IV should only be specified if it cannot be included in the encrypted data. The IV length is the cipher block size: RC4 - not used (error if IV is specified) DES - 8 bytes (all modes) DES3 - 8 bytes (all modes) AES128 - 16 bytes (all modes) AES192 - 16 bytes (all modes) AES256 - 16 bytes (all modes). .PARAMETER Comment Comments associated with this encryption key. .EXAMPLE PS C:\>Invoke-NSUnsetNsencryptionkey -name <string> An example how to unset nsencryptionkey config Object(s). .NOTES File Name : Invoke-NSUnsetNsencryptionkey Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsencryptionkey Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [Boolean]$padding, [Boolean]$InitalizationVector, [Boolean]$comment ) begin { Write-Verbose "Invoke-NSUnsetNsencryptionkey: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('padding') ) { $payload.Add('padding', $padding) } if ( $PSBoundParameters.ContainsKey('InitalizationVector') ) { $payload.Add('iv', $InitalizationVector) } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSCmdlet.ShouldProcess("$name", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nsencryptionkey -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNsencryptionkey: Finished" } } function Invoke-NSDeleteNsencryptionkey { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Configuration for encryption key resource. .PARAMETER Name Key name. This follows the same syntax rules as other expression entity names: It must begin with an alpha character (A-Z or a-z) or an underscore (_). The rest of the characters must be alpha, numeric (0-9) or underscores. It cannot be re or xp (reserved for regular and XPath expressions). It cannot be an expression reserved word (e.g. SYS or HTTP). It cannot be used for an existing expression object (HTTP callout, patset, dataset, stringmap, or named expression). .EXAMPLE PS C:\>Invoke-NSDeleteNsencryptionkey -Name <string> An example how to delete nsencryptionkey config Object(s). .NOTES File Name : Invoke-NSDeleteNsencryptionkey Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsencryptionkey/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Name ) begin { Write-Verbose "Invoke-NSDeleteNsencryptionkey: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nsencryptionkey -NitroPath nitro/v1/config -Resource $name -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNsencryptionkey: Finished" } } function Invoke-NSGetNsencryptionkey { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for encryption key resource. .PARAMETER Name Key name. This follows the same syntax rules as other expression entity names: It must begin with an alpha character (A-Z or a-z) or an underscore (_). The rest of the characters must be alpha, numeric (0-9) or underscores. It cannot be re or xp (reserved for regular and XPath expressions). It cannot be an expression reserved word (e.g. SYS or HTTP). It cannot be used for an existing expression object (HTTP callout, patset, dataset, stringmap, or named expression). .PARAMETER GetAll Retrieve all nsencryptionkey object(s). .PARAMETER Count If specified, the count of the nsencryptionkey object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsencryptionkey Get data. .EXAMPLE PS C:\>Invoke-NSGetNsencryptionkey -GetAll Get all nsencryptionkey data. .EXAMPLE PS C:\>Invoke-NSGetNsencryptionkey -Count Get the number of nsencryptionkey objects. .EXAMPLE PS C:\>Invoke-NSGetNsencryptionkey -name <string> Get nsencryptionkey object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsencryptionkey -Filter @{ 'name'='<value>' } Get nsencryptionkey data with a filter. .NOTES File Name : Invoke-NSGetNsencryptionkey Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsencryptionkey/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNsencryptionkey: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsencryptionkey objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsencryptionkey -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsencryptionkey objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsencryptionkey -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsencryptionkey objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsencryptionkey -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsencryptionkey configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsencryptionkey -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nsencryptionkey configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsencryptionkey -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsencryptionkey: Ended" } } function Invoke-NSUpdateNsencryptionparams { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for default encryption parameters resource. .PARAMETER Method Cipher method (and key length) to be used to encrypt and decrypt content. The default value is AES256. Possible values = NONE, RC4, DES3, AES128, AES192, AES256, DES, DES-CBC, DES-CFB, DES-OFB, DES-ECB, DES3-CBC, DES3-CFB, DES3-OFB, DES3-ECB, AES128-CBC, AES128-CFB, AES128-OFB, AES128-ECB, AES192-CBC, AES192-CFB, AES192-OFB, AES192-ECB, AES256-CBC, AES256-CFB, AES256-OFB, AES256-ECB .PARAMETER Keyvalue The base64-encoded key generation number, method, and key value. Note: * Do not include this argument if you are changing the encryption method. * To generate a new key value for the current encryption method, specify an empty string \(""\) as the value of this parameter. The parameter is passed implicitly, with its automatically generated value, to the Citrix ADC packet engines even when it is not included in the command. Passing the parameter to the packet engines enables the appliance to save the key value to the configuration file and to propagate the key value to the secondary appliance in a high availability setup. .EXAMPLE PS C:\>Invoke-NSUpdateNsencryptionparams -method <string> An example how to update nsencryptionparams config Object(s). .NOTES File Name : Invoke-NSUpdateNsencryptionparams Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsencryptionparams/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateSet('NONE', 'RC4', 'DES3', 'AES128', 'AES192', 'AES256', 'DES', 'DES-CBC', 'DES-CFB', 'DES-OFB', 'DES-ECB', 'DES3-CBC', 'DES3-CFB', 'DES3-OFB', 'DES3-ECB', 'AES128-CBC', 'AES128-CFB', 'AES128-OFB', 'AES128-ECB', 'AES192-CBC', 'AES192-CFB', 'AES192-OFB', 'AES192-ECB', 'AES256-CBC', 'AES256-CFB', 'AES256-OFB', 'AES256-ECB')] [string]$Method, [string]$Keyvalue ) begin { Write-Verbose "Invoke-NSUpdateNsencryptionparams: Starting" } process { try { $payload = @{ method = $method } if ( $PSBoundParameters.ContainsKey('keyvalue') ) { $payload.Add('keyvalue', $keyvalue) } if ( $PSCmdlet.ShouldProcess("nsencryptionparams", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nsencryptionparams -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNsencryptionparams: Finished" } } function Invoke-NSGetNsencryptionparams { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for default encryption parameters resource. .PARAMETER GetAll Retrieve all nsencryptionparams object(s). .PARAMETER Count If specified, the count of the nsencryptionparams object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsencryptionparams Get data. .EXAMPLE PS C:\>Invoke-NSGetNsencryptionparams -GetAll Get all nsencryptionparams data. .EXAMPLE PS C:\>Invoke-NSGetNsencryptionparams -name <string> Get nsencryptionparams object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsencryptionparams -Filter @{ 'name'='<value>' } Get nsencryptionparams data with a filter. .NOTES File Name : Invoke-NSGetNsencryptionparams Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsencryptionparams/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNsencryptionparams: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsencryptionparams objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsencryptionparams -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsencryptionparams objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsencryptionparams -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsencryptionparams objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsencryptionparams -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsencryptionparams configuration for property ''" } else { Write-Verbose "Retrieving nsencryptionparams configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsencryptionparams -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsencryptionparams: Ended" } } function Invoke-NSGetNsevents { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for events resource. .PARAMETER Eventno Event number starting from which events must be shown. .PARAMETER GetAll Retrieve all nsevents object(s). .PARAMETER Count If specified, the count of the nsevents object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsevents Get data. .EXAMPLE PS C:\>Invoke-NSGetNsevents -GetAll Get all nsevents data. .EXAMPLE PS C:\>Invoke-NSGetNsevents -Count Get the number of nsevents objects. .EXAMPLE PS C:\>Invoke-NSGetNsevents -name <string> Get nsevents object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsevents -Filter @{ 'name'='<value>' } Get nsevents data with a filter. .NOTES File Name : Invoke-NSGetNsevents Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsevents/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByArgument')] [double]$Eventno, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNsevents: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsevents objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsevents -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsevents objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsevents -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsevents objects by arguments" $arguments = @{ } if ( $PSBoundParameters.ContainsKey('eventno') ) { $arguments.Add('eventno', $eventno) } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsevents -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsevents configuration for property ''" } else { Write-Verbose "Retrieving nsevents configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsevents -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsevents: Ended" } } function Invoke-NSImportNsextension { <# .SYNOPSIS Import System/Global level configuration. config Object. .DESCRIPTION Configuration for Extension resource. .PARAMETER Src Local path to and name of, or URL (protocol, host, path, and file name) for, the file in which to store the imported extension. NOTE: The import fails if the object to be imported is on an HTTPS server that requires client certificate authentication for access. .PARAMETER Name Name to assign to the extension object on the Citrix ADC. .PARAMETER Comment Any comments to preserve information about the extension object. .PARAMETER Overwrite Overwrites the existing file. .EXAMPLE PS C:\>Invoke-NSImportNsextension -src <string> -name <string> An example how to import nsextension config Object(s). .NOTES File Name : Invoke-NSImportNsextension Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsextension/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateLength(1, 2047)] [string]$Src, [Parameter(Mandatory)] [ValidateLength(1, 31)] [string]$Name, [string]$Comment, [boolean]$Overwrite ) begin { Write-Verbose "Invoke-NSImportNsextension: Starting" } process { try { $payload = @{ src = $src name = $name } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSBoundParameters.ContainsKey('overwrite') ) { $payload.Add('overwrite', $overwrite) } if ( $PSCmdlet.ShouldProcess($Name, "Import System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsextension -Action import -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSImportNsextension: Finished" } } function Invoke-NSDeleteNsextension { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Configuration for Extension resource. .PARAMETER Name Name to assign to the extension object on the Citrix ADC. .EXAMPLE PS C:\>Invoke-NSDeleteNsextension -Name <string> An example how to delete nsextension config Object(s). .NOTES File Name : Invoke-NSDeleteNsextension Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsextension/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Name ) begin { Write-Verbose "Invoke-NSDeleteNsextension: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nsextension -NitroPath nitro/v1/config -Resource $name -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNsextension: Finished" } } function Invoke-NSAddNsextension { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Configuration for Extension resource. .PARAMETER Name Name to assign to the extension object on the Citrix ADC. .PARAMETER Comment Any comments to preserve information about the extension object. .PARAMETER PassThru Return details about the created nsextension item. .EXAMPLE PS C:\>Invoke-NSAddNsextension -name <string> An example how to add nsextension config Object(s). .NOTES File Name : Invoke-NSAddNsextension Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsextension/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateLength(1, 31)] [string]$Name, [string]$Comment, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNsextension: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSCmdlet.ShouldProcess("nsextension", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsextension -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNsextension -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNsextension: Finished" } } function Invoke-NSChangeNsextension { <# .SYNOPSIS Change System/Global level configuration. config Object. .DESCRIPTION Configuration for Extension resource. .PARAMETER Name Name to assign to the extension object on the Citrix ADC. .PARAMETER PassThru Return details about the created nsextension item. .EXAMPLE PS C:\>Invoke-NSChangeNsextension -name <string> An example how to change nsextension config Object(s). .NOTES File Name : Invoke-NSChangeNsextension Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsextension/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateLength(1, 31)] [string]$Name, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSChangeNsextension: Starting" } process { try { $payload = @{ name = $name } if ( $PSCmdlet.ShouldProcess("nsextension", "Change System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsextension -Action update -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNsextension -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSChangeNsextension: Finished" } } function Invoke-NSUpdateNsextension { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for Extension resource. .PARAMETER Name Name to assign to the extension object on the Citrix ADC. .PARAMETER Trace Enables tracing to the NS log file of extension execution: off - turns off tracing (equivalent to unset ns extension <extension-name> -trace) calls - traces extension function calls with arguments and function returns with the first return value lines - traces the above plus line numbers for executed extension lines all - traces the above plus local variables changed by executed extension lines Note that the DEBUG log level must be enabled to see extension tracing. This can be done by set audit syslogParams -loglevel ALL or -loglevel DEBUG. Possible values = off, calls, lines, all .PARAMETER Tracefunctions Comma-separated list of extension functions to trace. By default, all extension functions are traced. .PARAMETER Tracevariables Comma-separated list of variables (in traced extension functions) to trace. By default, all variables are traced. .PARAMETER Comment Any comments to preserve information about the extension object. .PARAMETER PassThru Return details about the created nsextension item. .EXAMPLE PS C:\>Invoke-NSUpdateNsextension -name <string> An example how to update nsextension config Object(s). .NOTES File Name : Invoke-NSUpdateNsextension Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsextension/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateLength(1, 31)] [string]$Name, [ValidateSet('off', 'calls', 'lines', 'all')] [string]$Trace, [string]$Tracefunctions, [string]$Tracevariables, [string]$Comment, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateNsextension: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('trace') ) { $payload.Add('trace', $trace) } if ( $PSBoundParameters.ContainsKey('tracefunctions') ) { $payload.Add('tracefunctions', $tracefunctions) } if ( $PSBoundParameters.ContainsKey('tracevariables') ) { $payload.Add('tracevariables', $tracevariables) } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSCmdlet.ShouldProcess("nsextension", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nsextension -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNsextension -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNsextension: Finished" } } function Invoke-NSUnsetNsextension { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for Extension resource. .PARAMETER Name Name to assign to the extension object on the Citrix ADC. .PARAMETER Trace Enables tracing to the NS log file of extension execution: off - turns off tracing (equivalent to unset ns extension <extension-name> -trace) calls - traces extension function calls with arguments and function returns with the first return value lines - traces the above plus line numbers for executed extension lines all - traces the above plus local variables changed by executed extension lines Note that the DEBUG log level must be enabled to see extension tracing. This can be done by set audit syslogParams -loglevel ALL or -loglevel DEBUG. Possible values = off, calls, lines, all .PARAMETER Tracefunctions Comma-separated list of extension functions to trace. By default, all extension functions are traced. .PARAMETER Tracevariables Comma-separated list of variables (in traced extension functions) to trace. By default, all variables are traced. .PARAMETER Comment Any comments to preserve information about the extension object. .EXAMPLE PS C:\>Invoke-NSUnsetNsextension -name <string> An example how to unset nsextension config Object(s). .NOTES File Name : Invoke-NSUnsetNsextension Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsextension Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateLength(1, 31)] [string]$Name, [Boolean]$trace, [Boolean]$tracefunctions, [Boolean]$tracevariables, [Boolean]$comment ) begin { Write-Verbose "Invoke-NSUnsetNsextension: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('trace') ) { $payload.Add('trace', $trace) } if ( $PSBoundParameters.ContainsKey('tracefunctions') ) { $payload.Add('tracefunctions', $tracefunctions) } if ( $PSBoundParameters.ContainsKey('tracevariables') ) { $payload.Add('tracevariables', $tracevariables) } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSCmdlet.ShouldProcess("$name", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nsextension -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNsextension: Finished" } } function Invoke-NSGetNsextension { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for Extension resource. .PARAMETER Name Name to assign to the extension object on the Citrix ADC. .PARAMETER GetAll Retrieve all nsextension object(s). .PARAMETER Count If specified, the count of the nsextension object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsextension Get data. .EXAMPLE PS C:\>Invoke-NSGetNsextension -GetAll Get all nsextension data. .EXAMPLE PS C:\>Invoke-NSGetNsextension -Count Get the number of nsextension objects. .EXAMPLE PS C:\>Invoke-NSGetNsextension -name <string> Get nsextension object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsextension -Filter @{ 'name'='<value>' } Get nsextension data with a filter. .NOTES File Name : Invoke-NSGetNsextension Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsextension/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateLength(1, 31)] [string]$Name, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNsextension: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsextension objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsextension -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsextension objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsextension -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsextension objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsextension -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsextension configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsextension -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nsextension configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsextension -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsextension: Ended" } } function Invoke-NSGetNsextensionBinding { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Binding object which returns the resources bound to nsextension. .PARAMETER Name Name of the extension object. .PARAMETER GetAll Retrieve all nsextension_binding object(s). .PARAMETER Count If specified, the count of the nsextension_binding object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsextensionBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetNsextensionBinding -GetAll Get all nsextension_binding data. .EXAMPLE PS C:\>Invoke-NSGetNsextensionBinding -name <string> Get nsextension_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsextensionBinding -Filter @{ 'name'='<value>' } Get nsextension_binding data with a filter. .NOTES File Name : Invoke-NSGetNsextensionBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsextension_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateLength(1, 31)] [string]$Name, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNsextensionBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all nsextension_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsextension_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsextension_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsextension_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsextension_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsextension_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsextension_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsextension_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nsextension_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsextension_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsextensionBinding: Ended" } } function Invoke-NSGetNsextensionExtensionfunctionBinding { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Binding object showing the extensionfunction that can be bound to nsextension. .PARAMETER Name Name of the extension object. .PARAMETER GetAll Retrieve all nsextension_extensionfunction_binding object(s). .PARAMETER Count If specified, the count of the nsextension_extensionfunction_binding object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsextensionExtensionfunctionBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetNsextensionExtensionfunctionBinding -GetAll Get all nsextension_extensionfunction_binding data. .EXAMPLE PS C:\>Invoke-NSGetNsextensionExtensionfunctionBinding -Count Get the number of nsextension_extensionfunction_binding objects. .EXAMPLE PS C:\>Invoke-NSGetNsextensionExtensionfunctionBinding -name <string> Get nsextension_extensionfunction_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsextensionExtensionfunctionBinding -Filter @{ 'name'='<value>' } Get nsextension_extensionfunction_binding data with a filter. .NOTES File Name : Invoke-NSGetNsextensionExtensionfunctionBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsextension_extensionfunction_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateLength(1, 31)] [string]$Name, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNsextensionExtensionfunctionBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all nsextension_extensionfunction_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsextension_extensionfunction_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsextension_extensionfunction_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsextension_extensionfunction_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsextension_extensionfunction_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsextension_extensionfunction_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsextension_extensionfunction_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsextension_extensionfunction_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nsextension_extensionfunction_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsextension_extensionfunction_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsextensionExtensionfunctionBinding: Ended" } } function Invoke-NSEnableNsfeature { <# .SYNOPSIS Enable System/Global level configuration. config Object. .DESCRIPTION Configuration for feature resource. .PARAMETER Feature Feature to be enabled. Multiple features can be specified by providing a blank space between each feature. .EXAMPLE PS C:\>Invoke-NSEnableNsfeature An example how to enable nsfeature config Object(s). .NOTES File Name : Invoke-NSEnableNsfeature Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsfeature/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [string[]]$Feature ) begin { Write-Verbose "Invoke-NSEnableNsfeature: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('feature') ) { $payload.Add('feature', $feature) } if ( $PSCmdlet.ShouldProcess($Name, "Enable System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsfeature -Action enable -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSEnableNsfeature: Finished" } } function Invoke-NSDisableNsfeature { <# .SYNOPSIS Disable System/Global level configuration. config Object. .DESCRIPTION Configuration for feature resource. .PARAMETER Feature Feature to be enabled. Multiple features can be specified by providing a blank space between each feature. .EXAMPLE PS C:\>Invoke-NSDisableNsfeature An example how to disable nsfeature config Object(s). .NOTES File Name : Invoke-NSDisableNsfeature Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsfeature/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [string[]]$Feature ) begin { Write-Verbose "Invoke-NSDisableNsfeature: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('feature') ) { $payload.Add('feature', $feature) } if ( $PSCmdlet.ShouldProcess($Name, "Disable System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsfeature -Action disable -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDisableNsfeature: Finished" } } function Invoke-NSGetNsfeature { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for feature resource. .PARAMETER GetAll Retrieve all nsfeature object(s). .PARAMETER Count If specified, the count of the nsfeature object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsfeature Get data. .EXAMPLE PS C:\>Invoke-NSGetNsfeature -GetAll Get all nsfeature data. .EXAMPLE PS C:\>Invoke-NSGetNsfeature -name <string> Get nsfeature object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsfeature -Filter @{ 'name'='<value>' } Get nsfeature data with a filter. .NOTES File Name : Invoke-NSGetNsfeature Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsfeature/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNsfeature: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsfeature objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsfeature -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsfeature objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsfeature -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsfeature objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsfeature -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsfeature configuration for property ''" } else { Write-Verbose "Retrieving nsfeature configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsfeature -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsfeature: Ended" } } function Invoke-NSGetNshardware { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for hardware resource. .PARAMETER GetAll Retrieve all nshardware object(s). .PARAMETER Count If specified, the count of the nshardware object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNshardware Get data. .EXAMPLE PS C:\>Invoke-NSGetNshardware -GetAll Get all nshardware data. .EXAMPLE PS C:\>Invoke-NSGetNshardware -name <string> Get nshardware object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNshardware -Filter @{ 'name'='<value>' } Get nshardware data with a filter. .NOTES File Name : Invoke-NSGetNshardware Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nshardware/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNshardware: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nshardware objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nshardware -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nshardware objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nshardware -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nshardware objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nshardware -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nshardware configuration for property ''" } else { Write-Verbose "Retrieving nshardware configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nshardware -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNshardware: Ended" } } function Invoke-NSAddNshmackey { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Configuration for HMAC key resource. .PARAMETER Name Key name. This follows the same syntax rules as other expression entity names: It must begin with an alpha character (A-Z or a-z) or an underscore (_). The rest of the characters must be alpha, numeric (0-9) or underscores. It cannot be re or xp (reserved for regular and XPath expressions). It cannot be an expression reserved word (e.g. SYS or HTTP). It cannot be used for an existing expression object (HTTP callout, patset, dataset, stringmap, or named expression). .PARAMETER Digest Digest (hash) function to be used in the HMAC computation. Possible values = MD2, MD4, MD5, SHA1, SHA224, SHA256, SHA384, SHA512 .PARAMETER Keyvalue The hex-encoded key to be used in the HMAC computation. The key can be any length (up to a Citrix ADC-imposed maximum of 255 bytes). If the length is less than the digest block size, it will be zero padded up to the block size. If it is greater than the block size, it will be hashed using the digest function to the block size. The block size for each digest is: MD2 - 16 bytes MD4 - 16 bytes MD5 - 16 bytes SHA1 - 20 bytes SHA224 - 28 bytes SHA256 - 32 bytes SHA384 - 48 bytes SHA512 - 64 bytes Note that the key will be encrypted when it it is saved There is a special key value AUTO which generates a new random key for the specified digest. This kind of key is intended for use cases where the NetScaler both generates and verifies an HMAC on the same data. .PARAMETER Comment Comments associated with this encryption key. .PARAMETER PassThru Return details about the created nshmackey item. .EXAMPLE PS C:\>Invoke-NSAddNshmackey -name <string> -digest <string> An example how to add nshmackey config Object(s). .NOTES File Name : Invoke-NSAddNshmackey Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nshmackey/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [Parameter(Mandatory)] [ValidateSet('MD2', 'MD4', 'MD5', 'SHA1', 'SHA224', 'SHA256', 'SHA384', 'SHA512')] [string]$Digest, [string]$Keyvalue, [string]$Comment, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNshmackey: Starting" } process { try { $payload = @{ name = $name digest = $digest } if ( $PSBoundParameters.ContainsKey('keyvalue') ) { $payload.Add('keyvalue', $keyvalue) } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSCmdlet.ShouldProcess("nshmackey", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nshmackey -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNshmackey -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNshmackey: Finished" } } function Invoke-NSUpdateNshmackey { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for HMAC key resource. .PARAMETER Name Key name. This follows the same syntax rules as other expression entity names: It must begin with an alpha character (A-Z or a-z) or an underscore (_). The rest of the characters must be alpha, numeric (0-9) or underscores. It cannot be re or xp (reserved for regular and XPath expressions). It cannot be an expression reserved word (e.g. SYS or HTTP). It cannot be used for an existing expression object (HTTP callout, patset, dataset, stringmap, or named expression). .PARAMETER Digest Digest (hash) function to be used in the HMAC computation. Possible values = MD2, MD4, MD5, SHA1, SHA224, SHA256, SHA384, SHA512 .PARAMETER Keyvalue The hex-encoded key to be used in the HMAC computation. The key can be any length (up to a Citrix ADC-imposed maximum of 255 bytes). If the length is less than the digest block size, it will be zero padded up to the block size. If it is greater than the block size, it will be hashed using the digest function to the block size. The block size for each digest is: MD2 - 16 bytes MD4 - 16 bytes MD5 - 16 bytes SHA1 - 20 bytes SHA224 - 28 bytes SHA256 - 32 bytes SHA384 - 48 bytes SHA512 - 64 bytes Note that the key will be encrypted when it it is saved There is a special key value AUTO which generates a new random key for the specified digest. This kind of key is intended for use cases where the NetScaler both generates and verifies an HMAC on the same data. .PARAMETER Comment Comments associated with this encryption key. .PARAMETER PassThru Return details about the created nshmackey item. .EXAMPLE PS C:\>Invoke-NSUpdateNshmackey -name <string> An example how to update nshmackey config Object(s). .NOTES File Name : Invoke-NSUpdateNshmackey Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nshmackey/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [ValidateSet('MD2', 'MD4', 'MD5', 'SHA1', 'SHA224', 'SHA256', 'SHA384', 'SHA512')] [string]$Digest, [string]$Keyvalue, [string]$Comment, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateNshmackey: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('digest') ) { $payload.Add('digest', $digest) } if ( $PSBoundParameters.ContainsKey('keyvalue') ) { $payload.Add('keyvalue', $keyvalue) } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSCmdlet.ShouldProcess("nshmackey", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nshmackey -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNshmackey -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNshmackey: Finished" } } function Invoke-NSUnsetNshmackey { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for HMAC key resource. .PARAMETER Name Key name. This follows the same syntax rules as other expression entity names: It must begin with an alpha character (A-Z or a-z) or an underscore (_). The rest of the characters must be alpha, numeric (0-9) or underscores. It cannot be re or xp (reserved for regular and XPath expressions). It cannot be an expression reserved word (e.g. SYS or HTTP). It cannot be used for an existing expression object (HTTP callout, patset, dataset, stringmap, or named expression). .PARAMETER Comment Comments associated with this encryption key. .EXAMPLE PS C:\>Invoke-NSUnsetNshmackey -name <string> An example how to unset nshmackey config Object(s). .NOTES File Name : Invoke-NSUnsetNshmackey Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nshmackey Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [Boolean]$comment ) begin { Write-Verbose "Invoke-NSUnsetNshmackey: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSCmdlet.ShouldProcess("$name", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nshmackey -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNshmackey: Finished" } } function Invoke-NSDeleteNshmackey { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Configuration for HMAC key resource. .PARAMETER Name Key name. This follows the same syntax rules as other expression entity names: It must begin with an alpha character (A-Z or a-z) or an underscore (_). The rest of the characters must be alpha, numeric (0-9) or underscores. It cannot be re or xp (reserved for regular and XPath expressions). It cannot be an expression reserved word (e.g. SYS or HTTP). It cannot be used for an existing expression object (HTTP callout, patset, dataset, stringmap, or named expression). .EXAMPLE PS C:\>Invoke-NSDeleteNshmackey -Name <string> An example how to delete nshmackey config Object(s). .NOTES File Name : Invoke-NSDeleteNshmackey Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nshmackey/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Name ) begin { Write-Verbose "Invoke-NSDeleteNshmackey: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nshmackey -NitroPath nitro/v1/config -Resource $name -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNshmackey: Finished" } } function Invoke-NSGetNshmackey { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for HMAC key resource. .PARAMETER Name Key name. This follows the same syntax rules as other expression entity names: It must begin with an alpha character (A-Z or a-z) or an underscore (_). The rest of the characters must be alpha, numeric (0-9) or underscores. It cannot be re or xp (reserved for regular and XPath expressions). It cannot be an expression reserved word (e.g. SYS or HTTP). It cannot be used for an existing expression object (HTTP callout, patset, dataset, stringmap, or named expression). .PARAMETER GetAll Retrieve all nshmackey object(s). .PARAMETER Count If specified, the count of the nshmackey object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNshmackey Get data. .EXAMPLE PS C:\>Invoke-NSGetNshmackey -GetAll Get all nshmackey data. .EXAMPLE PS C:\>Invoke-NSGetNshmackey -Count Get the number of nshmackey objects. .EXAMPLE PS C:\>Invoke-NSGetNshmackey -name <string> Get nshmackey object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNshmackey -Filter @{ 'name'='<value>' } Get nshmackey data with a filter. .NOTES File Name : Invoke-NSGetNshmackey Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nshmackey/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNshmackey: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nshmackey objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nshmackey -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nshmackey objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nshmackey -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nshmackey objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nshmackey -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nshmackey configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nshmackey -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nshmackey configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nshmackey -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNshmackey: Ended" } } function Invoke-NSUpdateNshostname { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for host name resource. .PARAMETER Hostname Host name for the Citrix ADC. .PARAMETER Ownernode ID of the cluster node for which you are setting the hostname. Can be configured only through the cluster IP address. Maximum value = 31 .EXAMPLE PS C:\>Invoke-NSUpdateNshostname -hostname <string> An example how to update nshostname config Object(s). .NOTES File Name : Invoke-NSUpdateNshostname Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nshostname/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateLength(1, 255)] [string]$Hostname, [double]$Ownernode ) begin { Write-Verbose "Invoke-NSUpdateNshostname: Starting" } process { try { $payload = @{ hostname = $hostname } if ( $PSBoundParameters.ContainsKey('ownernode') ) { $payload.Add('ownernode', $ownernode) } if ( $PSCmdlet.ShouldProcess("nshostname", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nshostname -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNshostname: Finished" } } function Invoke-NSGetNshostname { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for host name resource. .PARAMETER GetAll Retrieve all nshostname object(s). .PARAMETER Count If specified, the count of the nshostname object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNshostname Get data. .EXAMPLE PS C:\>Invoke-NSGetNshostname -GetAll Get all nshostname data. .EXAMPLE PS C:\>Invoke-NSGetNshostname -Count Get the number of nshostname objects. .EXAMPLE PS C:\>Invoke-NSGetNshostname -name <string> Get nshostname object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNshostname -Filter @{ 'name'='<value>' } Get nshostname data with a filter. .NOTES File Name : Invoke-NSGetNshostname Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nshostname/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNshostname: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nshostname objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nshostname -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nshostname objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nshostname -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nshostname objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nshostname -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nshostname configuration for property ''" } else { Write-Verbose "Retrieving nshostname configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nshostname -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNshostname: Ended" } } function Invoke-NSUpdateNshttpparam { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for HTTP parameter resource. .PARAMETER Dropinvalreqs Drop invalid HTTP requests or responses. Possible values = ON, OFF .PARAMETER Markhttp09inval Mark HTTP/0.9 requests as invalid. Possible values = ON, OFF .PARAMETER Markconnreqinval Mark CONNECT requests as invalid. Possible values = ON, OFF .PARAMETER Insnssrvrhdr Enable or disable Citrix ADC server header insertion for Citrix ADC generated HTTP responses. Possible values = ON, OFF .PARAMETER Nssrvrhdr The server header value to be inserted. If no explicit header is specified then NSBUILD.RELEASE is used as default server header. .PARAMETER Logerrresp Server header value to be inserted. Possible values = ON, OFF .PARAMETER Conmultiplex Reuse server connections for requests from more than one client connections. Possible values = ENABLED, DISABLED .PARAMETER Maxreusepool Maximum limit on the number of connections, from the Citrix ADC to a particular server that are kept in the reuse pool. This setting is helpful for optimal memory utilization and for reducing the idle connections to the server just after the peak time. Maximum value = 360000 .PARAMETER Http2serverside Enable/Disable HTTP/2 on server side. Possible values = ON, OFF .PARAMETER Ignoreconnectcodingscheme Ignore Coding scheme in CONNECT request. Possible values = ENABLED, DISABLED .EXAMPLE PS C:\>Invoke-NSUpdateNshttpparam An example how to update nshttpparam config Object(s). .NOTES File Name : Invoke-NSUpdateNshttpparam Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nshttpparam/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateSet('ON', 'OFF')] [string]$Dropinvalreqs, [ValidateSet('ON', 'OFF')] [string]$Markhttp09inval, [ValidateSet('ON', 'OFF')] [string]$Markconnreqinval, [ValidateSet('ON', 'OFF')] [string]$Insnssrvrhdr, [ValidateScript({ $_.Length -gt 1 })] [string]$Nssrvrhdr, [ValidateSet('ON', 'OFF')] [string]$Logerrresp, [ValidateSet('ENABLED', 'DISABLED')] [string]$Conmultiplex, [double]$Maxreusepool, [ValidateSet('ON', 'OFF')] [string]$Http2serverside, [ValidateSet('ENABLED', 'DISABLED')] [string]$Ignoreconnectcodingscheme ) begin { Write-Verbose "Invoke-NSUpdateNshttpparam: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('dropinvalreqs') ) { $payload.Add('dropinvalreqs', $dropinvalreqs) } if ( $PSBoundParameters.ContainsKey('markhttp09inval') ) { $payload.Add('markhttp09inval', $markhttp09inval) } if ( $PSBoundParameters.ContainsKey('markconnreqinval') ) { $payload.Add('markconnreqinval', $markconnreqinval) } if ( $PSBoundParameters.ContainsKey('insnssrvrhdr') ) { $payload.Add('insnssrvrhdr', $insnssrvrhdr) } if ( $PSBoundParameters.ContainsKey('nssrvrhdr') ) { $payload.Add('nssrvrhdr', $nssrvrhdr) } if ( $PSBoundParameters.ContainsKey('logerrresp') ) { $payload.Add('logerrresp', $logerrresp) } if ( $PSBoundParameters.ContainsKey('conmultiplex') ) { $payload.Add('conmultiplex', $conmultiplex) } if ( $PSBoundParameters.ContainsKey('maxreusepool') ) { $payload.Add('maxreusepool', $maxreusepool) } if ( $PSBoundParameters.ContainsKey('http2serverside') ) { $payload.Add('http2serverside', $http2serverside) } if ( $PSBoundParameters.ContainsKey('ignoreconnectcodingscheme') ) { $payload.Add('ignoreconnectcodingscheme', $ignoreconnectcodingscheme) } if ( $PSCmdlet.ShouldProcess("nshttpparam", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nshttpparam -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNshttpparam: Finished" } } function Invoke-NSUnsetNshttpparam { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for HTTP parameter resource. .PARAMETER Dropinvalreqs Drop invalid HTTP requests or responses. Possible values = ON, OFF .PARAMETER Markhttp09inval Mark HTTP/0.9 requests as invalid. Possible values = ON, OFF .PARAMETER Markconnreqinval Mark CONNECT requests as invalid. Possible values = ON, OFF .PARAMETER Insnssrvrhdr Enable or disable Citrix ADC server header insertion for Citrix ADC generated HTTP responses. Possible values = ON, OFF .PARAMETER Nssrvrhdr The server header value to be inserted. If no explicit header is specified then NSBUILD.RELEASE is used as default server header. .PARAMETER Logerrresp Server header value to be inserted. Possible values = ON, OFF .PARAMETER Conmultiplex Reuse server connections for requests from more than one client connections. Possible values = ENABLED, DISABLED .PARAMETER Maxreusepool Maximum limit on the number of connections, from the Citrix ADC to a particular server that are kept in the reuse pool. This setting is helpful for optimal memory utilization and for reducing the idle connections to the server just after the peak time. Maximum value = 360000 .PARAMETER Http2serverside Enable/Disable HTTP/2 on server side. Possible values = ON, OFF .PARAMETER Ignoreconnectcodingscheme Ignore Coding scheme in CONNECT request. Possible values = ENABLED, DISABLED .EXAMPLE PS C:\>Invoke-NSUnsetNshttpparam An example how to unset nshttpparam config Object(s). .NOTES File Name : Invoke-NSUnsetNshttpparam Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nshttpparam Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Boolean]$dropinvalreqs, [Boolean]$markhttp09inval, [Boolean]$markconnreqinval, [Boolean]$insnssrvrhdr, [Boolean]$nssrvrhdr, [Boolean]$logerrresp, [Boolean]$conmultiplex, [Boolean]$maxreusepool, [Boolean]$http2serverside, [Boolean]$ignoreconnectcodingscheme ) begin { Write-Verbose "Invoke-NSUnsetNshttpparam: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('dropinvalreqs') ) { $payload.Add('dropinvalreqs', $dropinvalreqs) } if ( $PSBoundParameters.ContainsKey('markhttp09inval') ) { $payload.Add('markhttp09inval', $markhttp09inval) } if ( $PSBoundParameters.ContainsKey('markconnreqinval') ) { $payload.Add('markconnreqinval', $markconnreqinval) } if ( $PSBoundParameters.ContainsKey('insnssrvrhdr') ) { $payload.Add('insnssrvrhdr', $insnssrvrhdr) } if ( $PSBoundParameters.ContainsKey('nssrvrhdr') ) { $payload.Add('nssrvrhdr', $nssrvrhdr) } if ( $PSBoundParameters.ContainsKey('logerrresp') ) { $payload.Add('logerrresp', $logerrresp) } if ( $PSBoundParameters.ContainsKey('conmultiplex') ) { $payload.Add('conmultiplex', $conmultiplex) } if ( $PSBoundParameters.ContainsKey('maxreusepool') ) { $payload.Add('maxreusepool', $maxreusepool) } if ( $PSBoundParameters.ContainsKey('http2serverside') ) { $payload.Add('http2serverside', $http2serverside) } if ( $PSBoundParameters.ContainsKey('ignoreconnectcodingscheme') ) { $payload.Add('ignoreconnectcodingscheme', $ignoreconnectcodingscheme) } if ( $PSCmdlet.ShouldProcess("nshttpparam", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nshttpparam -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNshttpparam: Finished" } } function Invoke-NSGetNshttpparam { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for HTTP parameter resource. .PARAMETER GetAll Retrieve all nshttpparam object(s). .PARAMETER Count If specified, the count of the nshttpparam object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNshttpparam Get data. .EXAMPLE PS C:\>Invoke-NSGetNshttpparam -GetAll Get all nshttpparam data. .EXAMPLE PS C:\>Invoke-NSGetNshttpparam -name <string> Get nshttpparam object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNshttpparam -Filter @{ 'name'='<value>' } Get nshttpparam data with a filter. .NOTES File Name : Invoke-NSGetNshttpparam Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nshttpparam/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNshttpparam: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nshttpparam objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nshttpparam -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nshttpparam objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nshttpparam -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nshttpparam objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nshttpparam -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nshttpparam configuration for property ''" } else { Write-Verbose "Retrieving nshttpparam configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nshttpparam -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNshttpparam: Ended" } } function Invoke-NSAddNshttpprofile { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Configuration for HTTP profile resource. .PARAMETER Name Name for an HTTP profile. Must begin with a letter, number, or the underscore \(_\) character. Other characters allowed, after the first character, are the hyphen \(-\), period \(.\), hash \(\#\), space \( \), at \(@\), colon \(:\), and equal \(=\) characters. The name of a HTTP profile cannot be changed after it is created. CLI Users: If the name includes one or more spaces, enclose the name in double or single quotation marks \(for example, "my http profile" or 'my http profile'\). .PARAMETER Dropinvalreqs Drop invalid HTTP requests or responses. Possible values = ENABLED, DISABLED .PARAMETER Markhttp09inval Mark HTTP/0.9 requests as invalid. Possible values = ENABLED, DISABLED .PARAMETER Markconnreqinval Mark CONNECT requests as invalid. Possible values = ENABLED, DISABLED .PARAMETER Marktracereqinval Mark TRACE requests as invalid. Possible values = ENABLED, DISABLED .PARAMETER Markrfc7230noncompliantinval Mark RFC7230 non-compliant transaction as invalid. Possible values = ENABLED, DISABLED .PARAMETER Markhttpheaderextrawserror Mark Http header with extra white space as invalid. Possible values = ENABLED, DISABLED .PARAMETER Cmponpush Start data compression on receiving a TCP packet with PUSH flag set. Possible values = ENABLED, DISABLED .PARAMETER Conmultiplex Reuse server connections for requests from more than one client connections. Possible values = ENABLED, DISABLED .PARAMETER Maxreusepool Maximum limit on the number of connections, from the Citrix ADC to a particular server that are kept in the reuse pool. This setting is helpful for optimal memory utilization and for reducing the idle connections to the server just after the peak time. Zero implies no limit on reuse pool size. If non-zero value is given, it has to be greater than or equal to the number of running Packet Engines. Maximum value = 360000 .PARAMETER Dropextracrlf Drop any extra 'CR' and 'LF' characters present after the header. Possible values = ENABLED, DISABLED .PARAMETER Incomphdrdelay Maximum time to wait, in milliseconds, between incomplete header packets. If the header packets take longer to arrive at Citrix ADC, the connection is silently dropped. Maximum value = 360000 .PARAMETER Websocket HTTP connection to be upgraded to a web socket connection. Once upgraded, Citrix ADC does not process Layer 7 traffic on this connection. Possible values = ENABLED, DISABLED .PARAMETER Rtsptunnel Allow RTSP tunnel in HTTP. Once application/x-rtsp-tunnelled is seen in Accept or Content-Type header, Citrix ADC does not process Layer 7 traffic on this connection. Possible values = ENABLED, DISABLED .PARAMETER Reqtimeout Time, in seconds, within which the HTTP request must complete. If the request does not complete within this time, the specified request timeout action is executed. Zero disables the timeout. Maximum value = 86400 .PARAMETER Adpttimeout Adapts the configured request timeout based on flow conditions. The timeout is increased or decreased internally and applied on the flow. Possible values = ENABLED, DISABLED .PARAMETER Reqtimeoutaction Action to take when the HTTP request does not complete within the specified request timeout duration. You can configure the following actions: * RESET - Send RST (reset) to client when timeout occurs. * DROP - Drop silently when timeout occurs. * Custom responder action - Name of the responder action to trigger when timeout occurs, used to send custom message. .PARAMETER Dropextradata Drop any extra data when server sends more data than the specified content-length. Possible values = ENABLED, DISABLED .PARAMETER Weblog Enable or disable web logging. Possible values = ENABLED, DISABLED .PARAMETER Clientiphdrexpr Name of the header that contains the real client IP address. .PARAMETER Maxreq Maximum number of requests allowed on a single connection. Zero implies no limit on the number of requests. Maximum value = 65534 .PARAMETER Persistentetag Generate the persistent Citrix ADC specific ETag for the HTTP response with ETag header. Possible values = ENABLED, DISABLED .PARAMETER Http2 Choose whether to enable support for HTTP/2. Possible values = ENABLED, DISABLED .PARAMETER Http2direct Choose whether to enable support for Direct HTTP/2. Possible values = ENABLED, DISABLED .PARAMETER Http2strictcipher Choose whether to enable strict HTTP/2 cipher selection. Possible values = ENABLED, DISABLED .PARAMETER Http2altsvcframe Choose whether to enable support for sending HTTP/2 ALTSVC frames. When enabled, the ADC sends HTTP/2 ALTSVC frames to HTTP/2 clients, instead of the Alt-Svc response header field. Not applicable to servers. Possible values = ENABLED, DISABLED .PARAMETER Altsvc Choose whether to enable support for Alternative Services. Possible values = ENABLED, DISABLED .PARAMETER Altsvcvalue Configure a custom Alternative Services header value that should be inserted in the response to advertise a HTTP/SSL/HTTP_QUIC vserver. .PARAMETER Reusepooltimeout Idle timeout (in seconds) for server connections in re-use pool. Connections in the re-use pool are flushed, if they remain idle for the configured timeout. Maximum value = 31536000 .PARAMETER Maxheaderlen Number of bytes to be queued to look for complete header before returning error. If complete header is not obtained after queuing these many bytes, request will be marked as invalid and no L7 processing will be done for that TCP connection. Maximum value = 122880 .PARAMETER Maxheaderfieldlen Number of bytes allowed for header field for HTTP header. If number of bytes exceeds beyond configured value, then request will be marked invalid. Maximum value = 122880 .PARAMETER Minreusepool Minimum limit on the number of connections, from the Citrix ADC to a particular server that are kept in the reuse pool. This setting is helpful for optimal memory utilization and for reducing the idle connections to the server just after the peak time. Zero implies no limit on reuse pool size. Maximum value = 360000 .PARAMETER Http2maxheaderlistsize Maximum size of header list that the Citrix ADC is prepared to accept, in bytes. NOTE: The actual plain text header size that the Citrix ADC accepts is limited by maxHeaderLen. Please change maxHeaderLen parameter as well when modifying http2MaxHeaderListSize. Maximum value = 131071 .PARAMETER Http2maxframesize Maximum size of the frame payload that the Citrix ADC is willing to receive, in bytes. Maximum value = 32768 .PARAMETER Http2maxconcurrentstreams Maximum number of concurrent streams that is allowed per connection. Maximum value = 1000 .PARAMETER Http2initialconnwindowsize Initial window size for connection level flow control, in bytes. Maximum value = 67108864 .PARAMETER Http2initialwindowsize Initial window size for stream level flow control, in bytes. Maximum value = 20971520 .PARAMETER Http2headertablesize Maximum size of the header compression table used to decode header blocks, in bytes. Maximum value = 131072 .PARAMETER Http2minseverconn Minimum number of HTTP2 connections established to backend server, on receiving HTTP requests from client before multiplexing the streams into the available HTTP/2 connections. Maximum value = 360000 .PARAMETER Http2maxpingframespermin Maximum number of ping frames allowed in HTTP2 connection per minute. Maximum value = 360000 .PARAMETER Http2maxsettingsframespermin Maximum number of settings frames allowed in HTTP2 connection per minute. Maximum value = 360000 .PARAMETER Http2maxresetframespermin Maximum number of reset frames allowed in HTTP/2 connection per minute. Maximum value = 360000 .PARAMETER Http2maxemptyframespermin Maximum number of empty frames allowed in HTTP2 connection per minute. Maximum value = 360000 .PARAMETER Grpcholdlimit Maximum size in bytes allowed to buffer gRPC packets till trailer is received. Maximum value = 33554432 .PARAMETER Grpcholdtimeout Maximum time in milliseconds allowed to buffer gRPC packets till trailer is received. The value should be in multiples of 100. Maximum value = 180000 .PARAMETER Grpclengthdelimitation Set to DISABLED for gRPC without a length delimitation. Possible values = ENABLED, DISABLED .PARAMETER Apdexcltresptimethreshold This option sets the satisfactory threshold (T) for client response time in milliseconds to be used for APDEX calculations. This means a transaction responding in less than this threshold is considered satisfactory. Transaction responding between T and 4*T is considered tolerable. Any transaction responding in more than 4*T time is considered frustrating. Citrix ADC maintains stats for such tolerable and frustrating transcations. And client response time related apdex counters are only updated on a vserver which receives clients traffic. Maximum value = 3600000 .PARAMETER Http3 Choose whether to enable support for HTTP/3. Possible values = ENABLED, DISABLED .PARAMETER Http3maxheaderfieldsectionsize Maximum size of the HTTP/3 header field section, in bytes. Maximum value = 131072 .PARAMETER Http3maxheadertablesize Maximum size of the HTTP/3 QPACK dynamic header table, in bytes. Maximum value = 131072 .PARAMETER Http3maxheaderblockedstreams Maximum number of HTTP/3 streams that can be blocked while HTTP/3 headers are being decoded. Maximum value = 500 .PARAMETER Http3webtransport Choose whether to enable support for WebTransport over HTTP/3. Possible values = ENABLED, DISABLED .PARAMETER Httppipelinebuffsize Application pipeline request buffering size, in bytes. Maximum value = 20971520 .PARAMETER Allowonlywordcharactersandhyphen When enabled allows only the word characters [A-Za-z0-9_] and hyphen [-] in the request/response header names and the connection will be reset for the other characters. When disabled allows any visible (printing) characters (%21-%7E) except delimiters (double quotes and "(),/:;<=>?@[]{}"). Possible values = ENABLED, DISABLED .PARAMETER Passprotocolupgrade Pass protocol upgrade request to the server. Possible values = ENABLED, DISABLED .PARAMETER PassThru Return details about the created nshttpprofile item. .EXAMPLE PS C:\>Invoke-NSAddNshttpprofile -name <string> An example how to add nshttpprofile config Object(s). .NOTES File Name : Invoke-NSAddNshttpprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nshttpprofile/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateLength(1, 127)] [string]$Name, [ValidateSet('ENABLED', 'DISABLED')] [string]$Dropinvalreqs = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Markhttp09inval = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Markconnreqinval = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Marktracereqinval = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Markrfc7230noncompliantinval = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Markhttpheaderextrawserror = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Cmponpush = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Conmultiplex = 'ENABLED', [double]$Maxreusepool = '0', [ValidateSet('ENABLED', 'DISABLED')] [string]$Dropextracrlf = 'ENABLED', [double]$Incomphdrdelay = '7000', [ValidateSet('ENABLED', 'DISABLED')] [string]$Websocket = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Rtsptunnel = 'DISABLED', [double]$Reqtimeout = '0', [ValidateSet('ENABLED', 'DISABLED')] [string]$Adpttimeout = 'DISABLED', [string]$Reqtimeoutaction, [ValidateSet('ENABLED', 'DISABLED')] [string]$Dropextradata = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Weblog = 'ENABLED', [string]$Clientiphdrexpr, [double]$Maxreq = '0', [ValidateSet('ENABLED', 'DISABLED')] [string]$Persistentetag = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Http2 = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Http2direct = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Http2strictcipher = 'ENABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Http2altsvcframe = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Altsvc = 'DISABLED', [string]$Altsvcvalue, [double]$Reusepooltimeout = '0', [double]$Maxheaderlen = '24820', [double]$Maxheaderfieldlen = '24820', [double]$Minreusepool = '0', [double]$Http2maxheaderlistsize = '24576', [double]$Http2maxframesize = '16384', [double]$Http2maxconcurrentstreams = '100', [double]$Http2initialconnwindowsize = '65535', [double]$Http2initialwindowsize = '65535', [double]$Http2headertablesize = '4096', [double]$Http2minseverconn = '20', [double]$Http2maxpingframespermin = '60', [double]$Http2maxsettingsframespermin = '15', [double]$Http2maxresetframespermin = '90', [double]$Http2maxemptyframespermin = '60', [double]$Grpcholdlimit = '131072', [double]$Grpcholdtimeout = '1000', [ValidateSet('ENABLED', 'DISABLED')] [string]$Grpclengthdelimitation = 'ENABLED', [double]$Apdexcltresptimethreshold = '500', [ValidateSet('ENABLED', 'DISABLED')] [string]$Http3 = 'DISABLED', [double]$Http3maxheaderfieldsectionsize = '24576', [double]$Http3maxheadertablesize = '4096', [double]$Http3maxheaderblockedstreams = '100', [ValidateSet('ENABLED', 'DISABLED')] [string]$Http3webtransport = 'DISABLED', [double]$Httppipelinebuffsize = '131072', [ValidateSet('ENABLED', 'DISABLED')] [string]$Allowonlywordcharactersandhyphen = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Passprotocolupgrade = 'ENABLED', [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNshttpprofile: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('dropinvalreqs') ) { $payload.Add('dropinvalreqs', $dropinvalreqs) } if ( $PSBoundParameters.ContainsKey('markhttp09inval') ) { $payload.Add('markhttp09inval', $markhttp09inval) } if ( $PSBoundParameters.ContainsKey('markconnreqinval') ) { $payload.Add('markconnreqinval', $markconnreqinval) } if ( $PSBoundParameters.ContainsKey('marktracereqinval') ) { $payload.Add('marktracereqinval', $marktracereqinval) } if ( $PSBoundParameters.ContainsKey('markrfc7230noncompliantinval') ) { $payload.Add('markrfc7230noncompliantinval', $markrfc7230noncompliantinval) } if ( $PSBoundParameters.ContainsKey('markhttpheaderextrawserror') ) { $payload.Add('markhttpheaderextrawserror', $markhttpheaderextrawserror) } if ( $PSBoundParameters.ContainsKey('cmponpush') ) { $payload.Add('cmponpush', $cmponpush) } if ( $PSBoundParameters.ContainsKey('conmultiplex') ) { $payload.Add('conmultiplex', $conmultiplex) } if ( $PSBoundParameters.ContainsKey('maxreusepool') ) { $payload.Add('maxreusepool', $maxreusepool) } if ( $PSBoundParameters.ContainsKey('dropextracrlf') ) { $payload.Add('dropextracrlf', $dropextracrlf) } if ( $PSBoundParameters.ContainsKey('incomphdrdelay') ) { $payload.Add('incomphdrdelay', $incomphdrdelay) } if ( $PSBoundParameters.ContainsKey('websocket') ) { $payload.Add('websocket', $websocket) } if ( $PSBoundParameters.ContainsKey('rtsptunnel') ) { $payload.Add('rtsptunnel', $rtsptunnel) } if ( $PSBoundParameters.ContainsKey('reqtimeout') ) { $payload.Add('reqtimeout', $reqtimeout) } if ( $PSBoundParameters.ContainsKey('adpttimeout') ) { $payload.Add('adpttimeout', $adpttimeout) } if ( $PSBoundParameters.ContainsKey('reqtimeoutaction') ) { $payload.Add('reqtimeoutaction', $reqtimeoutaction) } if ( $PSBoundParameters.ContainsKey('dropextradata') ) { $payload.Add('dropextradata', $dropextradata) } if ( $PSBoundParameters.ContainsKey('weblog') ) { $payload.Add('weblog', $weblog) } if ( $PSBoundParameters.ContainsKey('clientiphdrexpr') ) { $payload.Add('clientiphdrexpr', $clientiphdrexpr) } if ( $PSBoundParameters.ContainsKey('maxreq') ) { $payload.Add('maxreq', $maxreq) } if ( $PSBoundParameters.ContainsKey('persistentetag') ) { $payload.Add('persistentetag', $persistentetag) } if ( $PSBoundParameters.ContainsKey('http2') ) { $payload.Add('http2', $http2) } if ( $PSBoundParameters.ContainsKey('http2direct') ) { $payload.Add('http2direct', $http2direct) } if ( $PSBoundParameters.ContainsKey('http2strictcipher') ) { $payload.Add('http2strictcipher', $http2strictcipher) } if ( $PSBoundParameters.ContainsKey('http2altsvcframe') ) { $payload.Add('http2altsvcframe', $http2altsvcframe) } if ( $PSBoundParameters.ContainsKey('altsvc') ) { $payload.Add('altsvc', $altsvc) } if ( $PSBoundParameters.ContainsKey('altsvcvalue') ) { $payload.Add('altsvcvalue', $altsvcvalue) } if ( $PSBoundParameters.ContainsKey('reusepooltimeout') ) { $payload.Add('reusepooltimeout', $reusepooltimeout) } if ( $PSBoundParameters.ContainsKey('maxheaderlen') ) { $payload.Add('maxheaderlen', $maxheaderlen) } if ( $PSBoundParameters.ContainsKey('maxheaderfieldlen') ) { $payload.Add('maxheaderfieldlen', $maxheaderfieldlen) } if ( $PSBoundParameters.ContainsKey('minreusepool') ) { $payload.Add('minreusepool', $minreusepool) } if ( $PSBoundParameters.ContainsKey('http2maxheaderlistsize') ) { $payload.Add('http2maxheaderlistsize', $http2maxheaderlistsize) } if ( $PSBoundParameters.ContainsKey('http2maxframesize') ) { $payload.Add('http2maxframesize', $http2maxframesize) } if ( $PSBoundParameters.ContainsKey('http2maxconcurrentstreams') ) { $payload.Add('http2maxconcurrentstreams', $http2maxconcurrentstreams) } if ( $PSBoundParameters.ContainsKey('http2initialconnwindowsize') ) { $payload.Add('http2initialconnwindowsize', $http2initialconnwindowsize) } if ( $PSBoundParameters.ContainsKey('http2initialwindowsize') ) { $payload.Add('http2initialwindowsize', $http2initialwindowsize) } if ( $PSBoundParameters.ContainsKey('http2headertablesize') ) { $payload.Add('http2headertablesize', $http2headertablesize) } if ( $PSBoundParameters.ContainsKey('http2minseverconn') ) { $payload.Add('http2minseverconn', $http2minseverconn) } if ( $PSBoundParameters.ContainsKey('http2maxpingframespermin') ) { $payload.Add('http2maxpingframespermin', $http2maxpingframespermin) } if ( $PSBoundParameters.ContainsKey('http2maxsettingsframespermin') ) { $payload.Add('http2maxsettingsframespermin', $http2maxsettingsframespermin) } if ( $PSBoundParameters.ContainsKey('http2maxresetframespermin') ) { $payload.Add('http2maxresetframespermin', $http2maxresetframespermin) } if ( $PSBoundParameters.ContainsKey('http2maxemptyframespermin') ) { $payload.Add('http2maxemptyframespermin', $http2maxemptyframespermin) } if ( $PSBoundParameters.ContainsKey('grpcholdlimit') ) { $payload.Add('grpcholdlimit', $grpcholdlimit) } if ( $PSBoundParameters.ContainsKey('grpcholdtimeout') ) { $payload.Add('grpcholdtimeout', $grpcholdtimeout) } if ( $PSBoundParameters.ContainsKey('grpclengthdelimitation') ) { $payload.Add('grpclengthdelimitation', $grpclengthdelimitation) } if ( $PSBoundParameters.ContainsKey('apdexcltresptimethreshold') ) { $payload.Add('apdexcltresptimethreshold', $apdexcltresptimethreshold) } if ( $PSBoundParameters.ContainsKey('http3') ) { $payload.Add('http3', $http3) } if ( $PSBoundParameters.ContainsKey('http3maxheaderfieldsectionsize') ) { $payload.Add('http3maxheaderfieldsectionsize', $http3maxheaderfieldsectionsize) } if ( $PSBoundParameters.ContainsKey('http3maxheadertablesize') ) { $payload.Add('http3maxheadertablesize', $http3maxheadertablesize) } if ( $PSBoundParameters.ContainsKey('http3maxheaderblockedstreams') ) { $payload.Add('http3maxheaderblockedstreams', $http3maxheaderblockedstreams) } if ( $PSBoundParameters.ContainsKey('http3webtransport') ) { $payload.Add('http3webtransport', $http3webtransport) } if ( $PSBoundParameters.ContainsKey('httppipelinebuffsize') ) { $payload.Add('httppipelinebuffsize', $httppipelinebuffsize) } if ( $PSBoundParameters.ContainsKey('allowonlywordcharactersandhyphen') ) { $payload.Add('allowonlywordcharactersandhyphen', $allowonlywordcharactersandhyphen) } if ( $PSBoundParameters.ContainsKey('passprotocolupgrade') ) { $payload.Add('passprotocolupgrade', $passprotocolupgrade) } if ( $PSCmdlet.ShouldProcess("nshttpprofile", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nshttpprofile -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNshttpprofile -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNshttpprofile: Finished" } } function Invoke-NSDeleteNshttpprofile { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Configuration for HTTP profile resource. .PARAMETER Name Name for an HTTP profile. Must begin with a letter, number, or the underscore \(_\) character. Other characters allowed, after the first character, are the hyphen \(-\), period \(.\), hash \(\#\), space \( \), at \(@\), colon \(:\), and equal \(=\) characters. The name of a HTTP profile cannot be changed after it is created. CLI Users: If the name includes one or more spaces, enclose the name in double or single quotation marks \(for example, "my http profile" or 'my http profile'\). .EXAMPLE PS C:\>Invoke-NSDeleteNshttpprofile -Name <string> An example how to delete nshttpprofile config Object(s). .NOTES File Name : Invoke-NSDeleteNshttpprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nshttpprofile/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Name ) begin { Write-Verbose "Invoke-NSDeleteNshttpprofile: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nshttpprofile -NitroPath nitro/v1/config -Resource $name -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNshttpprofile: Finished" } } function Invoke-NSUpdateNshttpprofile { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for HTTP profile resource. .PARAMETER Name Name for an HTTP profile. Must begin with a letter, number, or the underscore \(_\) character. Other characters allowed, after the first character, are the hyphen \(-\), period \(.\), hash \(\#\), space \( \), at \(@\), colon \(:\), and equal \(=\) characters. The name of a HTTP profile cannot be changed after it is created. CLI Users: If the name includes one or more spaces, enclose the name in double or single quotation marks \(for example, "my http profile" or 'my http profile'\). .PARAMETER Dropinvalreqs Drop invalid HTTP requests or responses. Possible values = ENABLED, DISABLED .PARAMETER Markhttp09inval Mark HTTP/0.9 requests as invalid. Possible values = ENABLED, DISABLED .PARAMETER Markconnreqinval Mark CONNECT requests as invalid. Possible values = ENABLED, DISABLED .PARAMETER Marktracereqinval Mark TRACE requests as invalid. Possible values = ENABLED, DISABLED .PARAMETER Markrfc7230noncompliantinval Mark RFC7230 non-compliant transaction as invalid. Possible values = ENABLED, DISABLED .PARAMETER Markhttpheaderextrawserror Mark Http header with extra white space as invalid. Possible values = ENABLED, DISABLED .PARAMETER Cmponpush Start data compression on receiving a TCP packet with PUSH flag set. Possible values = ENABLED, DISABLED .PARAMETER Conmultiplex Reuse server connections for requests from more than one client connections. Possible values = ENABLED, DISABLED .PARAMETER Maxreusepool Maximum limit on the number of connections, from the Citrix ADC to a particular server that are kept in the reuse pool. This setting is helpful for optimal memory utilization and for reducing the idle connections to the server just after the peak time. Zero implies no limit on reuse pool size. If non-zero value is given, it has to be greater than or equal to the number of running Packet Engines. Maximum value = 360000 .PARAMETER Dropextracrlf Drop any extra 'CR' and 'LF' characters present after the header. Possible values = ENABLED, DISABLED .PARAMETER Incomphdrdelay Maximum time to wait, in milliseconds, between incomplete header packets. If the header packets take longer to arrive at Citrix ADC, the connection is silently dropped. Maximum value = 360000 .PARAMETER Websocket HTTP connection to be upgraded to a web socket connection. Once upgraded, Citrix ADC does not process Layer 7 traffic on this connection. Possible values = ENABLED, DISABLED .PARAMETER Rtsptunnel Allow RTSP tunnel in HTTP. Once application/x-rtsp-tunnelled is seen in Accept or Content-Type header, Citrix ADC does not process Layer 7 traffic on this connection. Possible values = ENABLED, DISABLED .PARAMETER Reqtimeout Time, in seconds, within which the HTTP request must complete. If the request does not complete within this time, the specified request timeout action is executed. Zero disables the timeout. Maximum value = 86400 .PARAMETER Adpttimeout Adapts the configured request timeout based on flow conditions. The timeout is increased or decreased internally and applied on the flow. Possible values = ENABLED, DISABLED .PARAMETER Reqtimeoutaction Action to take when the HTTP request does not complete within the specified request timeout duration. You can configure the following actions: * RESET - Send RST (reset) to client when timeout occurs. * DROP - Drop silently when timeout occurs. * Custom responder action - Name of the responder action to trigger when timeout occurs, used to send custom message. .PARAMETER Dropextradata Drop any extra data when server sends more data than the specified content-length. Possible values = ENABLED, DISABLED .PARAMETER Weblog Enable or disable web logging. Possible values = ENABLED, DISABLED .PARAMETER Clientiphdrexpr Name of the header that contains the real client IP address. .PARAMETER Maxreq Maximum number of requests allowed on a single connection. Zero implies no limit on the number of requests. Maximum value = 65534 .PARAMETER Persistentetag Generate the persistent Citrix ADC specific ETag for the HTTP response with ETag header. Possible values = ENABLED, DISABLED .PARAMETER Http2 Choose whether to enable support for HTTP/2. Possible values = ENABLED, DISABLED .PARAMETER Http2direct Choose whether to enable support for Direct HTTP/2. Possible values = ENABLED, DISABLED .PARAMETER Http2strictcipher Choose whether to enable strict HTTP/2 cipher selection. Possible values = ENABLED, DISABLED .PARAMETER Http2altsvcframe Choose whether to enable support for sending HTTP/2 ALTSVC frames. When enabled, the ADC sends HTTP/2 ALTSVC frames to HTTP/2 clients, instead of the Alt-Svc response header field. Not applicable to servers. Possible values = ENABLED, DISABLED .PARAMETER Altsvc Choose whether to enable support for Alternative Services. Possible values = ENABLED, DISABLED .PARAMETER Altsvcvalue Configure a custom Alternative Services header value that should be inserted in the response to advertise a HTTP/SSL/HTTP_QUIC vserver. .PARAMETER Http2maxheaderlistsize Maximum size of header list that the Citrix ADC is prepared to accept, in bytes. NOTE: The actual plain text header size that the Citrix ADC accepts is limited by maxHeaderLen. Please change maxHeaderLen parameter as well when modifying http2MaxHeaderListSize. Maximum value = 131071 .PARAMETER Http2maxframesize Maximum size of the frame payload that the Citrix ADC is willing to receive, in bytes. Maximum value = 32768 .PARAMETER Http2maxconcurrentstreams Maximum number of concurrent streams that is allowed per connection. Maximum value = 1000 .PARAMETER Http2initialconnwindowsize Initial window size for connection level flow control, in bytes. Maximum value = 67108864 .PARAMETER Http2initialwindowsize Initial window size for stream level flow control, in bytes. Maximum value = 20971520 .PARAMETER Http2headertablesize Maximum size of the header compression table used to decode header blocks, in bytes. Maximum value = 131072 .PARAMETER Http2minseverconn Minimum number of HTTP2 connections established to backend server, on receiving HTTP requests from client before multiplexing the streams into the available HTTP/2 connections. Maximum value = 360000 .PARAMETER Http2maxpingframespermin Maximum number of ping frames allowed in HTTP2 connection per minute. Maximum value = 360000 .PARAMETER Http2maxsettingsframespermin Maximum number of settings frames allowed in HTTP2 connection per minute. Maximum value = 360000 .PARAMETER Http2maxresetframespermin Maximum number of reset frames allowed in HTTP/2 connection per minute. Maximum value = 360000 .PARAMETER Http2maxemptyframespermin Maximum number of empty frames allowed in HTTP2 connection per minute. Maximum value = 360000 .PARAMETER Grpcholdlimit Maximum size in bytes allowed to buffer gRPC packets till trailer is received. Maximum value = 33554432 .PARAMETER Grpcholdtimeout Maximum time in milliseconds allowed to buffer gRPC packets till trailer is received. The value should be in multiples of 100. Maximum value = 180000 .PARAMETER Grpclengthdelimitation Set to DISABLED for gRPC without a length delimitation. Possible values = ENABLED, DISABLED .PARAMETER Reusepooltimeout Idle timeout (in seconds) for server connections in re-use pool. Connections in the re-use pool are flushed, if they remain idle for the configured timeout. Maximum value = 31536000 .PARAMETER Maxheaderlen Number of bytes to be queued to look for complete header before returning error. If complete header is not obtained after queuing these many bytes, request will be marked as invalid and no L7 processing will be done for that TCP connection. Maximum value = 122880 .PARAMETER Maxheaderfieldlen Number of bytes allowed for header field for HTTP header. If number of bytes exceeds beyond configured value, then request will be marked invalid. Maximum value = 122880 .PARAMETER Minreusepool Minimum limit on the number of connections, from the Citrix ADC to a particular server that are kept in the reuse pool. This setting is helpful for optimal memory utilization and for reducing the idle connections to the server just after the peak time. Zero implies no limit on reuse pool size. Maximum value = 360000 .PARAMETER Apdexcltresptimethreshold This option sets the satisfactory threshold (T) for client response time in milliseconds to be used for APDEX calculations. This means a transaction responding in less than this threshold is considered satisfactory. Transaction responding between T and 4*T is considered tolerable. Any transaction responding in more than 4*T time is considered frustrating. Citrix ADC maintains stats for such tolerable and frustrating transcations. And client response time related apdex counters are only updated on a vserver which receives clients traffic. Maximum value = 3600000 .PARAMETER Http3 Choose whether to enable support for HTTP/3. Possible values = ENABLED, DISABLED .PARAMETER Http3maxheaderfieldsectionsize Maximum size of the HTTP/3 header field section, in bytes. Maximum value = 131072 .PARAMETER Http3maxheadertablesize Maximum size of the HTTP/3 QPACK dynamic header table, in bytes. Maximum value = 131072 .PARAMETER Http3maxheaderblockedstreams Maximum number of HTTP/3 streams that can be blocked while HTTP/3 headers are being decoded. Maximum value = 500 .PARAMETER Http3webtransport Choose whether to enable support for WebTransport over HTTP/3. Possible values = ENABLED, DISABLED .PARAMETER Httppipelinebuffsize Application pipeline request buffering size, in bytes. Maximum value = 20971520 .PARAMETER Allowonlywordcharactersandhyphen When enabled allows only the word characters [A-Za-z0-9_] and hyphen [-] in the request/response header names and the connection will be reset for the other characters. When disabled allows any visible (printing) characters (%21-%7E) except delimiters (double quotes and "(),/:;<=>?@[]{}"). Possible values = ENABLED, DISABLED .PARAMETER Passprotocolupgrade Pass protocol upgrade request to the server. Possible values = ENABLED, DISABLED .PARAMETER PassThru Return details about the created nshttpprofile item. .EXAMPLE PS C:\>Invoke-NSUpdateNshttpprofile -name <string> An example how to update nshttpprofile config Object(s). .NOTES File Name : Invoke-NSUpdateNshttpprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nshttpprofile/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateLength(1, 127)] [string]$Name, [ValidateSet('ENABLED', 'DISABLED')] [string]$Dropinvalreqs, [ValidateSet('ENABLED', 'DISABLED')] [string]$Markhttp09inval, [ValidateSet('ENABLED', 'DISABLED')] [string]$Markconnreqinval, [ValidateSet('ENABLED', 'DISABLED')] [string]$Marktracereqinval, [ValidateSet('ENABLED', 'DISABLED')] [string]$Markrfc7230noncompliantinval, [ValidateSet('ENABLED', 'DISABLED')] [string]$Markhttpheaderextrawserror, [ValidateSet('ENABLED', 'DISABLED')] [string]$Cmponpush, [ValidateSet('ENABLED', 'DISABLED')] [string]$Conmultiplex, [double]$Maxreusepool, [ValidateSet('ENABLED', 'DISABLED')] [string]$Dropextracrlf, [double]$Incomphdrdelay, [ValidateSet('ENABLED', 'DISABLED')] [string]$Websocket, [ValidateSet('ENABLED', 'DISABLED')] [string]$Rtsptunnel, [double]$Reqtimeout, [ValidateSet('ENABLED', 'DISABLED')] [string]$Adpttimeout, [string]$Reqtimeoutaction, [ValidateSet('ENABLED', 'DISABLED')] [string]$Dropextradata, [ValidateSet('ENABLED', 'DISABLED')] [string]$Weblog, [string]$Clientiphdrexpr, [double]$Maxreq, [ValidateSet('ENABLED', 'DISABLED')] [string]$Persistentetag, [ValidateSet('ENABLED', 'DISABLED')] [string]$Http2, [ValidateSet('ENABLED', 'DISABLED')] [string]$Http2direct, [ValidateSet('ENABLED', 'DISABLED')] [string]$Http2strictcipher, [ValidateSet('ENABLED', 'DISABLED')] [string]$Http2altsvcframe, [ValidateSet('ENABLED', 'DISABLED')] [string]$Altsvc, [string]$Altsvcvalue, [double]$Http2maxheaderlistsize, [double]$Http2maxframesize, [double]$Http2maxconcurrentstreams, [double]$Http2initialconnwindowsize, [double]$Http2initialwindowsize, [double]$Http2headertablesize, [double]$Http2minseverconn, [double]$Http2maxpingframespermin, [double]$Http2maxsettingsframespermin, [double]$Http2maxresetframespermin, [double]$Http2maxemptyframespermin, [double]$Grpcholdlimit, [double]$Grpcholdtimeout, [ValidateSet('ENABLED', 'DISABLED')] [string]$Grpclengthdelimitation, [double]$Reusepooltimeout, [double]$Maxheaderlen, [double]$Maxheaderfieldlen, [double]$Minreusepool, [double]$Apdexcltresptimethreshold, [ValidateSet('ENABLED', 'DISABLED')] [string]$Http3, [double]$Http3maxheaderfieldsectionsize, [double]$Http3maxheadertablesize, [double]$Http3maxheaderblockedstreams, [ValidateSet('ENABLED', 'DISABLED')] [string]$Http3webtransport, [double]$Httppipelinebuffsize, [ValidateSet('ENABLED', 'DISABLED')] [string]$Allowonlywordcharactersandhyphen, [ValidateSet('ENABLED', 'DISABLED')] [string]$Passprotocolupgrade, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateNshttpprofile: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('dropinvalreqs') ) { $payload.Add('dropinvalreqs', $dropinvalreqs) } if ( $PSBoundParameters.ContainsKey('markhttp09inval') ) { $payload.Add('markhttp09inval', $markhttp09inval) } if ( $PSBoundParameters.ContainsKey('markconnreqinval') ) { $payload.Add('markconnreqinval', $markconnreqinval) } if ( $PSBoundParameters.ContainsKey('marktracereqinval') ) { $payload.Add('marktracereqinval', $marktracereqinval) } if ( $PSBoundParameters.ContainsKey('markrfc7230noncompliantinval') ) { $payload.Add('markrfc7230noncompliantinval', $markrfc7230noncompliantinval) } if ( $PSBoundParameters.ContainsKey('markhttpheaderextrawserror') ) { $payload.Add('markhttpheaderextrawserror', $markhttpheaderextrawserror) } if ( $PSBoundParameters.ContainsKey('cmponpush') ) { $payload.Add('cmponpush', $cmponpush) } if ( $PSBoundParameters.ContainsKey('conmultiplex') ) { $payload.Add('conmultiplex', $conmultiplex) } if ( $PSBoundParameters.ContainsKey('maxreusepool') ) { $payload.Add('maxreusepool', $maxreusepool) } if ( $PSBoundParameters.ContainsKey('dropextracrlf') ) { $payload.Add('dropextracrlf', $dropextracrlf) } if ( $PSBoundParameters.ContainsKey('incomphdrdelay') ) { $payload.Add('incomphdrdelay', $incomphdrdelay) } if ( $PSBoundParameters.ContainsKey('websocket') ) { $payload.Add('websocket', $websocket) } if ( $PSBoundParameters.ContainsKey('rtsptunnel') ) { $payload.Add('rtsptunnel', $rtsptunnel) } if ( $PSBoundParameters.ContainsKey('reqtimeout') ) { $payload.Add('reqtimeout', $reqtimeout) } if ( $PSBoundParameters.ContainsKey('adpttimeout') ) { $payload.Add('adpttimeout', $adpttimeout) } if ( $PSBoundParameters.ContainsKey('reqtimeoutaction') ) { $payload.Add('reqtimeoutaction', $reqtimeoutaction) } if ( $PSBoundParameters.ContainsKey('dropextradata') ) { $payload.Add('dropextradata', $dropextradata) } if ( $PSBoundParameters.ContainsKey('weblog') ) { $payload.Add('weblog', $weblog) } if ( $PSBoundParameters.ContainsKey('clientiphdrexpr') ) { $payload.Add('clientiphdrexpr', $clientiphdrexpr) } if ( $PSBoundParameters.ContainsKey('maxreq') ) { $payload.Add('maxreq', $maxreq) } if ( $PSBoundParameters.ContainsKey('persistentetag') ) { $payload.Add('persistentetag', $persistentetag) } if ( $PSBoundParameters.ContainsKey('http2') ) { $payload.Add('http2', $http2) } if ( $PSBoundParameters.ContainsKey('http2direct') ) { $payload.Add('http2direct', $http2direct) } if ( $PSBoundParameters.ContainsKey('http2strictcipher') ) { $payload.Add('http2strictcipher', $http2strictcipher) } if ( $PSBoundParameters.ContainsKey('http2altsvcframe') ) { $payload.Add('http2altsvcframe', $http2altsvcframe) } if ( $PSBoundParameters.ContainsKey('altsvc') ) { $payload.Add('altsvc', $altsvc) } if ( $PSBoundParameters.ContainsKey('altsvcvalue') ) { $payload.Add('altsvcvalue', $altsvcvalue) } if ( $PSBoundParameters.ContainsKey('http2maxheaderlistsize') ) { $payload.Add('http2maxheaderlistsize', $http2maxheaderlistsize) } if ( $PSBoundParameters.ContainsKey('http2maxframesize') ) { $payload.Add('http2maxframesize', $http2maxframesize) } if ( $PSBoundParameters.ContainsKey('http2maxconcurrentstreams') ) { $payload.Add('http2maxconcurrentstreams', $http2maxconcurrentstreams) } if ( $PSBoundParameters.ContainsKey('http2initialconnwindowsize') ) { $payload.Add('http2initialconnwindowsize', $http2initialconnwindowsize) } if ( $PSBoundParameters.ContainsKey('http2initialwindowsize') ) { $payload.Add('http2initialwindowsize', $http2initialwindowsize) } if ( $PSBoundParameters.ContainsKey('http2headertablesize') ) { $payload.Add('http2headertablesize', $http2headertablesize) } if ( $PSBoundParameters.ContainsKey('http2minseverconn') ) { $payload.Add('http2minseverconn', $http2minseverconn) } if ( $PSBoundParameters.ContainsKey('http2maxpingframespermin') ) { $payload.Add('http2maxpingframespermin', $http2maxpingframespermin) } if ( $PSBoundParameters.ContainsKey('http2maxsettingsframespermin') ) { $payload.Add('http2maxsettingsframespermin', $http2maxsettingsframespermin) } if ( $PSBoundParameters.ContainsKey('http2maxresetframespermin') ) { $payload.Add('http2maxresetframespermin', $http2maxresetframespermin) } if ( $PSBoundParameters.ContainsKey('http2maxemptyframespermin') ) { $payload.Add('http2maxemptyframespermin', $http2maxemptyframespermin) } if ( $PSBoundParameters.ContainsKey('grpcholdlimit') ) { $payload.Add('grpcholdlimit', $grpcholdlimit) } if ( $PSBoundParameters.ContainsKey('grpcholdtimeout') ) { $payload.Add('grpcholdtimeout', $grpcholdtimeout) } if ( $PSBoundParameters.ContainsKey('grpclengthdelimitation') ) { $payload.Add('grpclengthdelimitation', $grpclengthdelimitation) } if ( $PSBoundParameters.ContainsKey('reusepooltimeout') ) { $payload.Add('reusepooltimeout', $reusepooltimeout) } if ( $PSBoundParameters.ContainsKey('maxheaderlen') ) { $payload.Add('maxheaderlen', $maxheaderlen) } if ( $PSBoundParameters.ContainsKey('maxheaderfieldlen') ) { $payload.Add('maxheaderfieldlen', $maxheaderfieldlen) } if ( $PSBoundParameters.ContainsKey('minreusepool') ) { $payload.Add('minreusepool', $minreusepool) } if ( $PSBoundParameters.ContainsKey('apdexcltresptimethreshold') ) { $payload.Add('apdexcltresptimethreshold', $apdexcltresptimethreshold) } if ( $PSBoundParameters.ContainsKey('http3') ) { $payload.Add('http3', $http3) } if ( $PSBoundParameters.ContainsKey('http3maxheaderfieldsectionsize') ) { $payload.Add('http3maxheaderfieldsectionsize', $http3maxheaderfieldsectionsize) } if ( $PSBoundParameters.ContainsKey('http3maxheadertablesize') ) { $payload.Add('http3maxheadertablesize', $http3maxheadertablesize) } if ( $PSBoundParameters.ContainsKey('http3maxheaderblockedstreams') ) { $payload.Add('http3maxheaderblockedstreams', $http3maxheaderblockedstreams) } if ( $PSBoundParameters.ContainsKey('http3webtransport') ) { $payload.Add('http3webtransport', $http3webtransport) } if ( $PSBoundParameters.ContainsKey('httppipelinebuffsize') ) { $payload.Add('httppipelinebuffsize', $httppipelinebuffsize) } if ( $PSBoundParameters.ContainsKey('allowonlywordcharactersandhyphen') ) { $payload.Add('allowonlywordcharactersandhyphen', $allowonlywordcharactersandhyphen) } if ( $PSBoundParameters.ContainsKey('passprotocolupgrade') ) { $payload.Add('passprotocolupgrade', $passprotocolupgrade) } if ( $PSCmdlet.ShouldProcess("nshttpprofile", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nshttpprofile -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNshttpprofile -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNshttpprofile: Finished" } } function Invoke-NSUnsetNshttpprofile { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for HTTP profile resource. .PARAMETER Name Name for an HTTP profile. Must begin with a letter, number, or the underscore \(_\) character. Other characters allowed, after the first character, are the hyphen \(-\), period \(.\), hash \(\#\), space \( \), at \(@\), colon \(:\), and equal \(=\) characters. The name of a HTTP profile cannot be changed after it is created. CLI Users: If the name includes one or more spaces, enclose the name in double or single quotation marks \(for example, "my http profile" or 'my http profile'\). .PARAMETER Dropinvalreqs Drop invalid HTTP requests or responses. Possible values = ENABLED, DISABLED .PARAMETER Markhttp09inval Mark HTTP/0.9 requests as invalid. Possible values = ENABLED, DISABLED .PARAMETER Markconnreqinval Mark CONNECT requests as invalid. Possible values = ENABLED, DISABLED .PARAMETER Marktracereqinval Mark TRACE requests as invalid. Possible values = ENABLED, DISABLED .PARAMETER Markrfc7230noncompliantinval Mark RFC7230 non-compliant transaction as invalid. Possible values = ENABLED, DISABLED .PARAMETER Markhttpheaderextrawserror Mark Http header with extra white space as invalid. Possible values = ENABLED, DISABLED .PARAMETER Cmponpush Start data compression on receiving a TCP packet with PUSH flag set. Possible values = ENABLED, DISABLED .PARAMETER Conmultiplex Reuse server connections for requests from more than one client connections. Possible values = ENABLED, DISABLED .PARAMETER Maxreusepool Maximum limit on the number of connections, from the Citrix ADC to a particular server that are kept in the reuse pool. This setting is helpful for optimal memory utilization and for reducing the idle connections to the server just after the peak time. Zero implies no limit on reuse pool size. If non-zero value is given, it has to be greater than or equal to the number of running Packet Engines. Maximum value = 360000 .PARAMETER Dropextracrlf Drop any extra 'CR' and 'LF' characters present after the header. Possible values = ENABLED, DISABLED .PARAMETER Incomphdrdelay Maximum time to wait, in milliseconds, between incomplete header packets. If the header packets take longer to arrive at Citrix ADC, the connection is silently dropped. Maximum value = 360000 .PARAMETER Websocket HTTP connection to be upgraded to a web socket connection. Once upgraded, Citrix ADC does not process Layer 7 traffic on this connection. Possible values = ENABLED, DISABLED .PARAMETER Dropextradata Drop any extra data when server sends more data than the specified content-length. Possible values = ENABLED, DISABLED .PARAMETER Clientiphdrexpr Name of the header that contains the real client IP address. .PARAMETER Reqtimeout Time, in seconds, within which the HTTP request must complete. If the request does not complete within this time, the specified request timeout action is executed. Zero disables the timeout. Maximum value = 86400 .PARAMETER Adpttimeout Adapts the configured request timeout based on flow conditions. The timeout is increased or decreased internally and applied on the flow. Possible values = ENABLED, DISABLED .PARAMETER Reqtimeoutaction Action to take when the HTTP request does not complete within the specified request timeout duration. You can configure the following actions: * RESET - Send RST (reset) to client when timeout occurs. * DROP - Drop silently when timeout occurs. * Custom responder action - Name of the responder action to trigger when timeout occurs, used to send custom message. .PARAMETER Weblog Enable or disable web logging. Possible values = ENABLED, DISABLED .PARAMETER Maxreq Maximum number of requests allowed on a single connection. Zero implies no limit on the number of requests. Maximum value = 65534 .PARAMETER Persistentetag Generate the persistent Citrix ADC specific ETag for the HTTP response with ETag header. Possible values = ENABLED, DISABLED .PARAMETER Http2 Choose whether to enable support for HTTP/2. Possible values = ENABLED, DISABLED .PARAMETER Http2maxheaderlistsize Maximum size of header list that the Citrix ADC is prepared to accept, in bytes. NOTE: The actual plain text header size that the Citrix ADC accepts is limited by maxHeaderLen. Please change maxHeaderLen parameter as well when modifying http2MaxHeaderListSize. Maximum value = 131071 .PARAMETER Http2maxframesize Maximum size of the frame payload that the Citrix ADC is willing to receive, in bytes. Maximum value = 32768 .PARAMETER Http2maxconcurrentstreams Maximum number of concurrent streams that is allowed per connection. Maximum value = 1000 .PARAMETER Http2initialwindowsize Initial window size for stream level flow control, in bytes. Maximum value = 20971520 .PARAMETER Http2headertablesize Maximum size of the header compression table used to decode header blocks, in bytes. Maximum value = 131072 .PARAMETER Http2minseverconn Minimum number of HTTP2 connections established to backend server, on receiving HTTP requests from client before multiplexing the streams into the available HTTP/2 connections. Maximum value = 360000 .PARAMETER Http2maxpingframespermin Maximum number of ping frames allowed in HTTP2 connection per minute. Maximum value = 360000 .PARAMETER Http2maxsettingsframespermin Maximum number of settings frames allowed in HTTP2 connection per minute. Maximum value = 360000 .PARAMETER Http2maxresetframespermin Maximum number of reset frames allowed in HTTP/2 connection per minute. Maximum value = 360000 .PARAMETER Http2maxemptyframespermin Maximum number of empty frames allowed in HTTP2 connection per minute. Maximum value = 360000 .PARAMETER Http2altsvcframe Choose whether to enable support for sending HTTP/2 ALTSVC frames. When enabled, the ADC sends HTTP/2 ALTSVC frames to HTTP/2 clients, instead of the Alt-Svc response header field. Not applicable to servers. Possible values = ENABLED, DISABLED .PARAMETER Altsvcvalue Configure a custom Alternative Services header value that should be inserted in the response to advertise a HTTP/SSL/HTTP_QUIC vserver. .PARAMETER Reusepooltimeout Idle timeout (in seconds) for server connections in re-use pool. Connections in the re-use pool are flushed, if they remain idle for the configured timeout. Maximum value = 31536000 .PARAMETER Maxheaderlen Number of bytes to be queued to look for complete header before returning error. If complete header is not obtained after queuing these many bytes, request will be marked as invalid and no L7 processing will be done for that TCP connection. Maximum value = 122880 .PARAMETER Rtsptunnel Allow RTSP tunnel in HTTP. Once application/x-rtsp-tunnelled is seen in Accept or Content-Type header, Citrix ADC does not process Layer 7 traffic on this connection. Possible values = ENABLED, DISABLED .PARAMETER Minreusepool Minimum limit on the number of connections, from the Citrix ADC to a particular server that are kept in the reuse pool. This setting is helpful for optimal memory utilization and for reducing the idle connections to the server just after the peak time. Zero implies no limit on reuse pool size. Maximum value = 360000 .PARAMETER Apdexcltresptimethreshold This option sets the satisfactory threshold (T) for client response time in milliseconds to be used for APDEX calculations. This means a transaction responding in less than this threshold is considered satisfactory. Transaction responding between T and 4*T is considered tolerable. Any transaction responding in more than 4*T time is considered frustrating. Citrix ADC maintains stats for such tolerable and frustrating transcations. And client response time related apdex counters are only updated on a vserver which receives clients traffic. Maximum value = 3600000 .PARAMETER Http3 Choose whether to enable support for HTTP/3. Possible values = ENABLED, DISABLED .PARAMETER Http3maxheaderfieldsectionsize Maximum size of the HTTP/3 header field section, in bytes. Maximum value = 131072 .PARAMETER Http3maxheadertablesize Maximum size of the HTTP/3 QPACK dynamic header table, in bytes. Maximum value = 131072 .PARAMETER Http3maxheaderblockedstreams Maximum number of HTTP/3 streams that can be blocked while HTTP/3 headers are being decoded. Maximum value = 500 .PARAMETER Http3webtransport Choose whether to enable support for WebTransport over HTTP/3. Possible values = ENABLED, DISABLED .PARAMETER Httppipelinebuffsize Application pipeline request buffering size, in bytes. Maximum value = 20971520 .PARAMETER Allowonlywordcharactersandhyphen When enabled allows only the word characters [A-Za-z0-9_] and hyphen [-] in the request/response header names and the connection will be reset for the other characters. When disabled allows any visible (printing) characters (%21-%7E) except delimiters (double quotes and "(),/:;<=>?@[]{}"). Possible values = ENABLED, DISABLED .PARAMETER Passprotocolupgrade Pass protocol upgrade request to the server. Possible values = ENABLED, DISABLED .PARAMETER Http2direct Choose whether to enable support for Direct HTTP/2. Possible values = ENABLED, DISABLED .PARAMETER Http2strictcipher Choose whether to enable strict HTTP/2 cipher selection. Possible values = ENABLED, DISABLED .PARAMETER Altsvc Choose whether to enable support for Alternative Services. Possible values = ENABLED, DISABLED .PARAMETER Http2initialconnwindowsize Initial window size for connection level flow control, in bytes. Maximum value = 67108864 .PARAMETER Grpcholdlimit Maximum size in bytes allowed to buffer gRPC packets till trailer is received. Maximum value = 33554432 .PARAMETER Grpcholdtimeout Maximum time in milliseconds allowed to buffer gRPC packets till trailer is received. The value should be in multiples of 100. Maximum value = 180000 .PARAMETER Grpclengthdelimitation Set to DISABLED for gRPC without a length delimitation. Possible values = ENABLED, DISABLED .PARAMETER Maxheaderfieldlen Number of bytes allowed for header field for HTTP header. If number of bytes exceeds beyond configured value, then request will be marked invalid. Maximum value = 122880 .EXAMPLE PS C:\>Invoke-NSUnsetNshttpprofile -name <string> An example how to unset nshttpprofile config Object(s). .NOTES File Name : Invoke-NSUnsetNshttpprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nshttpprofile Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateLength(1, 127)] [string]$Name, [Boolean]$dropinvalreqs, [Boolean]$markhttp09inval, [Boolean]$markconnreqinval, [Boolean]$marktracereqinval, [Boolean]$markrfc7230noncompliantinval, [Boolean]$markhttpheaderextrawserror, [Boolean]$cmponpush, [Boolean]$conmultiplex, [Boolean]$maxreusepool, [Boolean]$dropextracrlf, [Boolean]$incomphdrdelay, [Boolean]$websocket, [Boolean]$dropextradata, [Boolean]$clientiphdrexpr, [Boolean]$reqtimeout, [Boolean]$adpttimeout, [Boolean]$reqtimeoutaction, [Boolean]$weblog, [Boolean]$maxreq, [Boolean]$persistentetag, [Boolean]$http2, [Boolean]$http2maxheaderlistsize, [Boolean]$http2maxframesize, [Boolean]$http2maxconcurrentstreams, [Boolean]$http2initialwindowsize, [Boolean]$http2headertablesize, [Boolean]$http2minseverconn, [Boolean]$http2maxpingframespermin, [Boolean]$http2maxsettingsframespermin, [Boolean]$http2maxresetframespermin, [Boolean]$http2maxemptyframespermin, [Boolean]$http2altsvcframe, [Boolean]$altsvcvalue, [Boolean]$reusepooltimeout, [Boolean]$maxheaderlen, [Boolean]$rtsptunnel, [Boolean]$minreusepool, [Boolean]$apdexcltresptimethreshold, [Boolean]$http3, [Boolean]$http3maxheaderfieldsectionsize, [Boolean]$http3maxheadertablesize, [Boolean]$http3maxheaderblockedstreams, [Boolean]$http3webtransport, [Boolean]$httppipelinebuffsize, [Boolean]$allowonlywordcharactersandhyphen, [Boolean]$passprotocolupgrade, [Boolean]$http2direct, [Boolean]$http2strictcipher, [Boolean]$altsvc, [Boolean]$http2initialconnwindowsize, [Boolean]$grpcholdlimit, [Boolean]$grpcholdtimeout, [Boolean]$grpclengthdelimitation, [Boolean]$maxheaderfieldlen ) begin { Write-Verbose "Invoke-NSUnsetNshttpprofile: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('dropinvalreqs') ) { $payload.Add('dropinvalreqs', $dropinvalreqs) } if ( $PSBoundParameters.ContainsKey('markhttp09inval') ) { $payload.Add('markhttp09inval', $markhttp09inval) } if ( $PSBoundParameters.ContainsKey('markconnreqinval') ) { $payload.Add('markconnreqinval', $markconnreqinval) } if ( $PSBoundParameters.ContainsKey('marktracereqinval') ) { $payload.Add('marktracereqinval', $marktracereqinval) } if ( $PSBoundParameters.ContainsKey('markrfc7230noncompliantinval') ) { $payload.Add('markrfc7230noncompliantinval', $markrfc7230noncompliantinval) } if ( $PSBoundParameters.ContainsKey('markhttpheaderextrawserror') ) { $payload.Add('markhttpheaderextrawserror', $markhttpheaderextrawserror) } if ( $PSBoundParameters.ContainsKey('cmponpush') ) { $payload.Add('cmponpush', $cmponpush) } if ( $PSBoundParameters.ContainsKey('conmultiplex') ) { $payload.Add('conmultiplex', $conmultiplex) } if ( $PSBoundParameters.ContainsKey('maxreusepool') ) { $payload.Add('maxreusepool', $maxreusepool) } if ( $PSBoundParameters.ContainsKey('dropextracrlf') ) { $payload.Add('dropextracrlf', $dropextracrlf) } if ( $PSBoundParameters.ContainsKey('incomphdrdelay') ) { $payload.Add('incomphdrdelay', $incomphdrdelay) } if ( $PSBoundParameters.ContainsKey('websocket') ) { $payload.Add('websocket', $websocket) } if ( $PSBoundParameters.ContainsKey('dropextradata') ) { $payload.Add('dropextradata', $dropextradata) } if ( $PSBoundParameters.ContainsKey('clientiphdrexpr') ) { $payload.Add('clientiphdrexpr', $clientiphdrexpr) } if ( $PSBoundParameters.ContainsKey('reqtimeout') ) { $payload.Add('reqtimeout', $reqtimeout) } if ( $PSBoundParameters.ContainsKey('adpttimeout') ) { $payload.Add('adpttimeout', $adpttimeout) } if ( $PSBoundParameters.ContainsKey('reqtimeoutaction') ) { $payload.Add('reqtimeoutaction', $reqtimeoutaction) } if ( $PSBoundParameters.ContainsKey('weblog') ) { $payload.Add('weblog', $weblog) } if ( $PSBoundParameters.ContainsKey('maxreq') ) { $payload.Add('maxreq', $maxreq) } if ( $PSBoundParameters.ContainsKey('persistentetag') ) { $payload.Add('persistentetag', $persistentetag) } if ( $PSBoundParameters.ContainsKey('http2') ) { $payload.Add('http2', $http2) } if ( $PSBoundParameters.ContainsKey('http2maxheaderlistsize') ) { $payload.Add('http2maxheaderlistsize', $http2maxheaderlistsize) } if ( $PSBoundParameters.ContainsKey('http2maxframesize') ) { $payload.Add('http2maxframesize', $http2maxframesize) } if ( $PSBoundParameters.ContainsKey('http2maxconcurrentstreams') ) { $payload.Add('http2maxconcurrentstreams', $http2maxconcurrentstreams) } if ( $PSBoundParameters.ContainsKey('http2initialwindowsize') ) { $payload.Add('http2initialwindowsize', $http2initialwindowsize) } if ( $PSBoundParameters.ContainsKey('http2headertablesize') ) { $payload.Add('http2headertablesize', $http2headertablesize) } if ( $PSBoundParameters.ContainsKey('http2minseverconn') ) { $payload.Add('http2minseverconn', $http2minseverconn) } if ( $PSBoundParameters.ContainsKey('http2maxpingframespermin') ) { $payload.Add('http2maxpingframespermin', $http2maxpingframespermin) } if ( $PSBoundParameters.ContainsKey('http2maxsettingsframespermin') ) { $payload.Add('http2maxsettingsframespermin', $http2maxsettingsframespermin) } if ( $PSBoundParameters.ContainsKey('http2maxresetframespermin') ) { $payload.Add('http2maxresetframespermin', $http2maxresetframespermin) } if ( $PSBoundParameters.ContainsKey('http2maxemptyframespermin') ) { $payload.Add('http2maxemptyframespermin', $http2maxemptyframespermin) } if ( $PSBoundParameters.ContainsKey('http2altsvcframe') ) { $payload.Add('http2altsvcframe', $http2altsvcframe) } if ( $PSBoundParameters.ContainsKey('altsvcvalue') ) { $payload.Add('altsvcvalue', $altsvcvalue) } if ( $PSBoundParameters.ContainsKey('reusepooltimeout') ) { $payload.Add('reusepooltimeout', $reusepooltimeout) } if ( $PSBoundParameters.ContainsKey('maxheaderlen') ) { $payload.Add('maxheaderlen', $maxheaderlen) } if ( $PSBoundParameters.ContainsKey('rtsptunnel') ) { $payload.Add('rtsptunnel', $rtsptunnel) } if ( $PSBoundParameters.ContainsKey('minreusepool') ) { $payload.Add('minreusepool', $minreusepool) } if ( $PSBoundParameters.ContainsKey('apdexcltresptimethreshold') ) { $payload.Add('apdexcltresptimethreshold', $apdexcltresptimethreshold) } if ( $PSBoundParameters.ContainsKey('http3') ) { $payload.Add('http3', $http3) } if ( $PSBoundParameters.ContainsKey('http3maxheaderfieldsectionsize') ) { $payload.Add('http3maxheaderfieldsectionsize', $http3maxheaderfieldsectionsize) } if ( $PSBoundParameters.ContainsKey('http3maxheadertablesize') ) { $payload.Add('http3maxheadertablesize', $http3maxheadertablesize) } if ( $PSBoundParameters.ContainsKey('http3maxheaderblockedstreams') ) { $payload.Add('http3maxheaderblockedstreams', $http3maxheaderblockedstreams) } if ( $PSBoundParameters.ContainsKey('http3webtransport') ) { $payload.Add('http3webtransport', $http3webtransport) } if ( $PSBoundParameters.ContainsKey('httppipelinebuffsize') ) { $payload.Add('httppipelinebuffsize', $httppipelinebuffsize) } if ( $PSBoundParameters.ContainsKey('allowonlywordcharactersandhyphen') ) { $payload.Add('allowonlywordcharactersandhyphen', $allowonlywordcharactersandhyphen) } if ( $PSBoundParameters.ContainsKey('passprotocolupgrade') ) { $payload.Add('passprotocolupgrade', $passprotocolupgrade) } if ( $PSBoundParameters.ContainsKey('http2direct') ) { $payload.Add('http2direct', $http2direct) } if ( $PSBoundParameters.ContainsKey('http2strictcipher') ) { $payload.Add('http2strictcipher', $http2strictcipher) } if ( $PSBoundParameters.ContainsKey('altsvc') ) { $payload.Add('altsvc', $altsvc) } if ( $PSBoundParameters.ContainsKey('http2initialconnwindowsize') ) { $payload.Add('http2initialconnwindowsize', $http2initialconnwindowsize) } if ( $PSBoundParameters.ContainsKey('grpcholdlimit') ) { $payload.Add('grpcholdlimit', $grpcholdlimit) } if ( $PSBoundParameters.ContainsKey('grpcholdtimeout') ) { $payload.Add('grpcholdtimeout', $grpcholdtimeout) } if ( $PSBoundParameters.ContainsKey('grpclengthdelimitation') ) { $payload.Add('grpclengthdelimitation', $grpclengthdelimitation) } if ( $PSBoundParameters.ContainsKey('maxheaderfieldlen') ) { $payload.Add('maxheaderfieldlen', $maxheaderfieldlen) } if ( $PSCmdlet.ShouldProcess("$name", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nshttpprofile -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNshttpprofile: Finished" } } function Invoke-NSGetNshttpprofile { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for HTTP profile resource. .PARAMETER Name Name for an HTTP profile. Must begin with a letter, number, or the underscore \(_\) character. Other characters allowed, after the first character, are the hyphen \(-\), period \(.\), hash \(\#\), space \( \), at \(@\), colon \(:\), and equal \(=\) characters. The name of a HTTP profile cannot be changed after it is created. CLI Users: If the name includes one or more spaces, enclose the name in double or single quotation marks \(for example, "my http profile" or 'my http profile'\). .PARAMETER GetAll Retrieve all nshttpprofile object(s). .PARAMETER Count If specified, the count of the nshttpprofile object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNshttpprofile Get data. .EXAMPLE PS C:\>Invoke-NSGetNshttpprofile -GetAll Get all nshttpprofile data. .EXAMPLE PS C:\>Invoke-NSGetNshttpprofile -Count Get the number of nshttpprofile objects. .EXAMPLE PS C:\>Invoke-NSGetNshttpprofile -name <string> Get nshttpprofile object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNshttpprofile -Filter @{ 'name'='<value>' } Get nshttpprofile data with a filter. .NOTES File Name : Invoke-NSGetNshttpprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nshttpprofile/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateLength(1, 127)] [string]$Name, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNshttpprofile: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nshttpprofile objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nshttpprofile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nshttpprofile objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nshttpprofile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nshttpprofile objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nshttpprofile -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nshttpprofile configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nshttpprofile -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nshttpprofile configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nshttpprofile -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNshttpprofile: Ended" } } function Invoke-NSAddNsicapprofile { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Configuration for ICAP profile resource. .PARAMETER Name Name for an ICAP profile. Must begin with a letter, number, or the underscore \(_\) character. Other characters allowed, after the first character, are the hyphen \(-\), period \(.\), hash \(\#\), space \( \), at \(@\), colon \(:\), and equal \(=\) characters. The name of a ICAP profile cannot be changed after it is created. CLI Users: If the name includes one or more spaces, enclose the name in double or single quotation marks \(for example, "my icap profile" or 'my icap profile'\). .PARAMETER Preview Enable or Disable preview header with ICAP request. This feature allows an ICAP server to see the beginning of a transaction, then decide if it wants to opt-out of the transaction early instead of receiving the remainder of the request message. Possible values = ENABLED, DISABLED .PARAMETER Previewlength Value of Preview Header field. Citrix ADC uses the minimum of this set value and the preview size received on OPTIONS response. Maximum value = 4294967294 .PARAMETER Uri URI representing icap service. It is a mandatory argument while creating an icapprofile. .PARAMETER Hostheader ICAP Host Header. .PARAMETER Useragent ICAP User Agent Header String. .PARAMETER Mode ICAP Mode of operation. It is a mandatory argument while creating an icapprofile. Possible values = REQMOD, RESPMOD .PARAMETER Queryparams Query parameters to be included with ICAP request URI. Entered values should be in arg=value format. For more than one parameters, add & separated values. e.g.: arg1=val1&arg2=val2. .PARAMETER Connectionkeepalive If enabled, Citrix ADC keeps the ICAP connection alive after a transaction to reuse it to send next ICAP request. Possible values = ENABLED, DISABLED .PARAMETER Allow204 Enable or Disable sending Allow: 204 header in ICAP request. Possible values = ENABLED, DISABLED .PARAMETER Inserticapheaders Insert custom ICAP headers in the ICAP request to send to ICAP server. The headers can be static or can be dynamically constructed using PI Policy Expression. For example, to send static user agent and Client's IP address, the expression can be specified as "User-Agent: NS-ICAP-Client/V1.0\r\nX-Client-IP: "+CLIENT.IP.SRC+"\r\n". The Citrix ADC does not check the validity of the specified header name-value. You must manually validate the specified header syntax. .PARAMETER Inserthttprequest Exact HTTP request, in the form of an expression, which the Citrix ADC encapsulates and sends to the ICAP server. If you set this parameter, the ICAP request is sent using only this header. This can be used when the HTTP header is not available to send or ICAP server only needs part of the incoming HTTP request. The request expression is constrained by the feature for which it is used. The Citrix ADC does not check the validity of this request. You must manually validate the request. .PARAMETER Reqtimeout Time, in seconds, within which the remote server should respond to the ICAP-request. If the Netscaler does not receive full response with this time, the specified request timeout action is performed. Zero value disables this timeout functionality. Maximum value = 86400 .PARAMETER Reqtimeoutaction Name of the action to perform if the Vserver/Server representing the remote service does not respond with any response within the timeout value configured. The Supported actions are * BYPASS - This Ignores the remote server response and sends the request/response to Client/Server. * If the ICAP response with Encapsulated headers is not received within the request-timeout value configured, this Ignores the remote ICAP server response and sends the Full request/response to Server/Client. * RESET - Reset the client connection by closing it. The client program, such as a browser, will handle this and may inform the user. The client may then resend the request if desired. * DROP - Drop the request without sending a response to the user. Possible values = BYPASS, DROP, RESET .PARAMETER Logaction Name of the audit message action which would be evaluated on receiving the ICAP response to emit the logs. .PARAMETER PassThru Return details about the created nsicapprofile item. .EXAMPLE PS C:\>Invoke-NSAddNsicapprofile -name <string> -uri <string> -mode <string> An example how to add nsicapprofile config Object(s). .NOTES File Name : Invoke-NSAddNsicapprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsicapprofile/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateLength(1, 127)] [string]$Name, [ValidateSet('ENABLED', 'DISABLED')] [string]$Preview = 'DISABLED', [double]$Previewlength = '4096', [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Uri, [ValidateScript({ $_.Length -gt 1 })] [string]$Hostheader, [ValidateScript({ $_.Length -gt 1 })] [string]$Useragent, [Parameter(Mandatory)] [ValidateSet('REQMOD', 'RESPMOD')] [string]$Mode, [ValidateScript({ $_.Length -gt 1 })] [string]$Queryparams, [ValidateSet('ENABLED', 'DISABLED')] [string]$Connectionkeepalive = 'ENABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Allow204 = 'ENABLED', [ValidateScript({ $_.Length -gt 1 })] [string]$Inserticapheaders, [ValidateScript({ $_.Length -gt 1 })] [string]$Inserthttprequest, [double]$Reqtimeout = '0', [ValidateSet('BYPASS', 'DROP', 'RESET')] [string]$Reqtimeoutaction = 'RESET', [string]$Logaction, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNsicapprofile: Starting" } process { try { $payload = @{ name = $name uri = $uri mode = $mode } if ( $PSBoundParameters.ContainsKey('preview') ) { $payload.Add('preview', $preview) } if ( $PSBoundParameters.ContainsKey('previewlength') ) { $payload.Add('previewlength', $previewlength) } if ( $PSBoundParameters.ContainsKey('hostheader') ) { $payload.Add('hostheader', $hostheader) } if ( $PSBoundParameters.ContainsKey('useragent') ) { $payload.Add('useragent', $useragent) } if ( $PSBoundParameters.ContainsKey('queryparams') ) { $payload.Add('queryparams', $queryparams) } if ( $PSBoundParameters.ContainsKey('connectionkeepalive') ) { $payload.Add('connectionkeepalive', $connectionkeepalive) } if ( $PSBoundParameters.ContainsKey('allow204') ) { $payload.Add('allow204', $allow204) } if ( $PSBoundParameters.ContainsKey('inserticapheaders') ) { $payload.Add('inserticapheaders', $inserticapheaders) } if ( $PSBoundParameters.ContainsKey('inserthttprequest') ) { $payload.Add('inserthttprequest', $inserthttprequest) } if ( $PSBoundParameters.ContainsKey('reqtimeout') ) { $payload.Add('reqtimeout', $reqtimeout) } if ( $PSBoundParameters.ContainsKey('reqtimeoutaction') ) { $payload.Add('reqtimeoutaction', $reqtimeoutaction) } if ( $PSBoundParameters.ContainsKey('logaction') ) { $payload.Add('logaction', $logaction) } if ( $PSCmdlet.ShouldProcess("nsicapprofile", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsicapprofile -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNsicapprofile -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNsicapprofile: Finished" } } function Invoke-NSDeleteNsicapprofile { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Configuration for ICAP profile resource. .PARAMETER Name Name for an ICAP profile. Must begin with a letter, number, or the underscore \(_\) character. Other characters allowed, after the first character, are the hyphen \(-\), period \(.\), hash \(\#\), space \( \), at \(@\), colon \(:\), and equal \(=\) characters. The name of a ICAP profile cannot be changed after it is created. CLI Users: If the name includes one or more spaces, enclose the name in double or single quotation marks \(for example, "my icap profile" or 'my icap profile'\). .EXAMPLE PS C:\>Invoke-NSDeleteNsicapprofile -Name <string> An example how to delete nsicapprofile config Object(s). .NOTES File Name : Invoke-NSDeleteNsicapprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsicapprofile/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Name ) begin { Write-Verbose "Invoke-NSDeleteNsicapprofile: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nsicapprofile -NitroPath nitro/v1/config -Resource $name -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNsicapprofile: Finished" } } function Invoke-NSUpdateNsicapprofile { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for ICAP profile resource. .PARAMETER Name Name for an ICAP profile. Must begin with a letter, number, or the underscore \(_\) character. Other characters allowed, after the first character, are the hyphen \(-\), period \(.\), hash \(\#\), space \( \), at \(@\), colon \(:\), and equal \(=\) characters. The name of a ICAP profile cannot be changed after it is created. CLI Users: If the name includes one or more spaces, enclose the name in double or single quotation marks \(for example, "my icap profile" or 'my icap profile'\). .PARAMETER Preview Enable or Disable preview header with ICAP request. This feature allows an ICAP server to see the beginning of a transaction, then decide if it wants to opt-out of the transaction early instead of receiving the remainder of the request message. Possible values = ENABLED, DISABLED .PARAMETER Previewlength Value of Preview Header field. Citrix ADC uses the minimum of this set value and the preview size received on OPTIONS response. Maximum value = 4294967294 .PARAMETER Uri URI representing icap service. It is a mandatory argument while creating an icapprofile. .PARAMETER Hostheader ICAP Host Header. .PARAMETER Useragent ICAP User Agent Header String. .PARAMETER Mode ICAP Mode of operation. It is a mandatory argument while creating an icapprofile. Possible values = REQMOD, RESPMOD .PARAMETER Queryparams Query parameters to be included with ICAP request URI. Entered values should be in arg=value format. For more than one parameters, add & separated values. e.g.: arg1=val1&arg2=val2. .PARAMETER Connectionkeepalive If enabled, Citrix ADC keeps the ICAP connection alive after a transaction to reuse it to send next ICAP request. Possible values = ENABLED, DISABLED .PARAMETER Allow204 Enable or Disable sending Allow: 204 header in ICAP request. Possible values = ENABLED, DISABLED .PARAMETER Inserticapheaders Insert custom ICAP headers in the ICAP request to send to ICAP server. The headers can be static or can be dynamically constructed using PI Policy Expression. For example, to send static user agent and Client's IP address, the expression can be specified as "User-Agent: NS-ICAP-Client/V1.0\r\nX-Client-IP: "+CLIENT.IP.SRC+"\r\n". The Citrix ADC does not check the validity of the specified header name-value. You must manually validate the specified header syntax. .PARAMETER Inserthttprequest Exact HTTP request, in the form of an expression, which the Citrix ADC encapsulates and sends to the ICAP server. If you set this parameter, the ICAP request is sent using only this header. This can be used when the HTTP header is not available to send or ICAP server only needs part of the incoming HTTP request. The request expression is constrained by the feature for which it is used. The Citrix ADC does not check the validity of this request. You must manually validate the request. .PARAMETER Reqtimeout Time, in seconds, within which the remote server should respond to the ICAP-request. If the Netscaler does not receive full response with this time, the specified request timeout action is performed. Zero value disables this timeout functionality. Maximum value = 86400 .PARAMETER Reqtimeoutaction Name of the action to perform if the Vserver/Server representing the remote service does not respond with any response within the timeout value configured. The Supported actions are * BYPASS - This Ignores the remote server response and sends the request/response to Client/Server. * If the ICAP response with Encapsulated headers is not received within the request-timeout value configured, this Ignores the remote ICAP server response and sends the Full request/response to Server/Client. * RESET - Reset the client connection by closing it. The client program, such as a browser, will handle this and may inform the user. The client may then resend the request if desired. * DROP - Drop the request without sending a response to the user. Possible values = BYPASS, DROP, RESET .PARAMETER Logaction Name of the audit message action which would be evaluated on receiving the ICAP response to emit the logs. .PARAMETER PassThru Return details about the created nsicapprofile item. .EXAMPLE PS C:\>Invoke-NSUpdateNsicapprofile -name <string> An example how to update nsicapprofile config Object(s). .NOTES File Name : Invoke-NSUpdateNsicapprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsicapprofile/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateLength(1, 127)] [string]$Name, [ValidateSet('ENABLED', 'DISABLED')] [string]$Preview, [double]$Previewlength, [ValidateScript({ $_.Length -gt 1 })] [string]$Uri, [ValidateScript({ $_.Length -gt 1 })] [string]$Hostheader, [ValidateScript({ $_.Length -gt 1 })] [string]$Useragent, [ValidateSet('REQMOD', 'RESPMOD')] [string]$Mode, [ValidateScript({ $_.Length -gt 1 })] [string]$Queryparams, [ValidateSet('ENABLED', 'DISABLED')] [string]$Connectionkeepalive, [ValidateSet('ENABLED', 'DISABLED')] [string]$Allow204, [ValidateScript({ $_.Length -gt 1 })] [string]$Inserticapheaders, [ValidateScript({ $_.Length -gt 1 })] [string]$Inserthttprequest, [double]$Reqtimeout, [ValidateSet('BYPASS', 'DROP', 'RESET')] [string]$Reqtimeoutaction, [string]$Logaction, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateNsicapprofile: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('preview') ) { $payload.Add('preview', $preview) } if ( $PSBoundParameters.ContainsKey('previewlength') ) { $payload.Add('previewlength', $previewlength) } if ( $PSBoundParameters.ContainsKey('uri') ) { $payload.Add('uri', $uri) } if ( $PSBoundParameters.ContainsKey('hostheader') ) { $payload.Add('hostheader', $hostheader) } if ( $PSBoundParameters.ContainsKey('useragent') ) { $payload.Add('useragent', $useragent) } if ( $PSBoundParameters.ContainsKey('mode') ) { $payload.Add('mode', $mode) } if ( $PSBoundParameters.ContainsKey('queryparams') ) { $payload.Add('queryparams', $queryparams) } if ( $PSBoundParameters.ContainsKey('connectionkeepalive') ) { $payload.Add('connectionkeepalive', $connectionkeepalive) } if ( $PSBoundParameters.ContainsKey('allow204') ) { $payload.Add('allow204', $allow204) } if ( $PSBoundParameters.ContainsKey('inserticapheaders') ) { $payload.Add('inserticapheaders', $inserticapheaders) } if ( $PSBoundParameters.ContainsKey('inserthttprequest') ) { $payload.Add('inserthttprequest', $inserthttprequest) } if ( $PSBoundParameters.ContainsKey('reqtimeout') ) { $payload.Add('reqtimeout', $reqtimeout) } if ( $PSBoundParameters.ContainsKey('reqtimeoutaction') ) { $payload.Add('reqtimeoutaction', $reqtimeoutaction) } if ( $PSBoundParameters.ContainsKey('logaction') ) { $payload.Add('logaction', $logaction) } if ( $PSCmdlet.ShouldProcess("nsicapprofile", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nsicapprofile -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNsicapprofile -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNsicapprofile: Finished" } } function Invoke-NSUnsetNsicapprofile { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for ICAP profile resource. .PARAMETER Name Name for an ICAP profile. Must begin with a letter, number, or the underscore \(_\) character. Other characters allowed, after the first character, are the hyphen \(-\), period \(.\), hash \(\#\), space \( \), at \(@\), colon \(:\), and equal \(=\) characters. The name of a ICAP profile cannot be changed after it is created. CLI Users: If the name includes one or more spaces, enclose the name in double or single quotation marks \(for example, "my icap profile" or 'my icap profile'\). .PARAMETER Preview Enable or Disable preview header with ICAP request. This feature allows an ICAP server to see the beginning of a transaction, then decide if it wants to opt-out of the transaction early instead of receiving the remainder of the request message. Possible values = ENABLED, DISABLED .PARAMETER Previewlength Value of Preview Header field. Citrix ADC uses the minimum of this set value and the preview size received on OPTIONS response. Maximum value = 4294967294 .PARAMETER Hostheader ICAP Host Header. .PARAMETER Useragent ICAP User Agent Header String. .PARAMETER Queryparams Query parameters to be included with ICAP request URI. Entered values should be in arg=value format. For more than one parameters, add & separated values. e.g.: arg1=val1&arg2=val2. .PARAMETER Connectionkeepalive If enabled, Citrix ADC keeps the ICAP connection alive after a transaction to reuse it to send next ICAP request. Possible values = ENABLED, DISABLED .PARAMETER Allow204 Enable or Disable sending Allow: 204 header in ICAP request. Possible values = ENABLED, DISABLED .PARAMETER Inserticapheaders Insert custom ICAP headers in the ICAP request to send to ICAP server. The headers can be static or can be dynamically constructed using PI Policy Expression. For example, to send static user agent and Client's IP address, the expression can be specified as "User-Agent: NS-ICAP-Client/V1.0\r\nX-Client-IP: "+CLIENT.IP.SRC+"\r\n". The Citrix ADC does not check the validity of the specified header name-value. You must manually validate the specified header syntax. .PARAMETER Inserthttprequest Exact HTTP request, in the form of an expression, which the Citrix ADC encapsulates and sends to the ICAP server. If you set this parameter, the ICAP request is sent using only this header. This can be used when the HTTP header is not available to send or ICAP server only needs part of the incoming HTTP request. The request expression is constrained by the feature for which it is used. The Citrix ADC does not check the validity of this request. You must manually validate the request. .PARAMETER Reqtimeout Time, in seconds, within which the remote server should respond to the ICAP-request. If the Netscaler does not receive full response with this time, the specified request timeout action is performed. Zero value disables this timeout functionality. Maximum value = 86400 .PARAMETER Reqtimeoutaction Name of the action to perform if the Vserver/Server representing the remote service does not respond with any response within the timeout value configured. The Supported actions are * BYPASS - This Ignores the remote server response and sends the request/response to Client/Server. * If the ICAP response with Encapsulated headers is not received within the request-timeout value configured, this Ignores the remote ICAP server response and sends the Full request/response to Server/Client. * RESET - Reset the client connection by closing it. The client program, such as a browser, will handle this and may inform the user. The client may then resend the request if desired. * DROP - Drop the request without sending a response to the user. Possible values = BYPASS, DROP, RESET .PARAMETER Logaction Name of the audit message action which would be evaluated on receiving the ICAP response to emit the logs. .EXAMPLE PS C:\>Invoke-NSUnsetNsicapprofile -name <string> An example how to unset nsicapprofile config Object(s). .NOTES File Name : Invoke-NSUnsetNsicapprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsicapprofile Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateLength(1, 127)] [string]$Name, [Boolean]$preview, [Boolean]$previewlength, [Boolean]$hostheader, [Boolean]$useragent, [Boolean]$queryparams, [Boolean]$connectionkeepalive, [Boolean]$allow204, [Boolean]$inserticapheaders, [Boolean]$inserthttprequest, [Boolean]$reqtimeout, [Boolean]$reqtimeoutaction, [Boolean]$logaction ) begin { Write-Verbose "Invoke-NSUnsetNsicapprofile: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('preview') ) { $payload.Add('preview', $preview) } if ( $PSBoundParameters.ContainsKey('previewlength') ) { $payload.Add('previewlength', $previewlength) } if ( $PSBoundParameters.ContainsKey('hostheader') ) { $payload.Add('hostheader', $hostheader) } if ( $PSBoundParameters.ContainsKey('useragent') ) { $payload.Add('useragent', $useragent) } if ( $PSBoundParameters.ContainsKey('queryparams') ) { $payload.Add('queryparams', $queryparams) } if ( $PSBoundParameters.ContainsKey('connectionkeepalive') ) { $payload.Add('connectionkeepalive', $connectionkeepalive) } if ( $PSBoundParameters.ContainsKey('allow204') ) { $payload.Add('allow204', $allow204) } if ( $PSBoundParameters.ContainsKey('inserticapheaders') ) { $payload.Add('inserticapheaders', $inserticapheaders) } if ( $PSBoundParameters.ContainsKey('inserthttprequest') ) { $payload.Add('inserthttprequest', $inserthttprequest) } if ( $PSBoundParameters.ContainsKey('reqtimeout') ) { $payload.Add('reqtimeout', $reqtimeout) } if ( $PSBoundParameters.ContainsKey('reqtimeoutaction') ) { $payload.Add('reqtimeoutaction', $reqtimeoutaction) } if ( $PSBoundParameters.ContainsKey('logaction') ) { $payload.Add('logaction', $logaction) } if ( $PSCmdlet.ShouldProcess("$name", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nsicapprofile -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNsicapprofile: Finished" } } function Invoke-NSGetNsicapprofile { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for ICAP profile resource. .PARAMETER Name Name for an ICAP profile. Must begin with a letter, number, or the underscore \(_\) character. Other characters allowed, after the first character, are the hyphen \(-\), period \(.\), hash \(\#\), space \( \), at \(@\), colon \(:\), and equal \(=\) characters. The name of a ICAP profile cannot be changed after it is created. CLI Users: If the name includes one or more spaces, enclose the name in double or single quotation marks \(for example, "my icap profile" or 'my icap profile'\). .PARAMETER GetAll Retrieve all nsicapprofile object(s). .PARAMETER Count If specified, the count of the nsicapprofile object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsicapprofile Get data. .EXAMPLE PS C:\>Invoke-NSGetNsicapprofile -GetAll Get all nsicapprofile data. .EXAMPLE PS C:\>Invoke-NSGetNsicapprofile -Count Get the number of nsicapprofile objects. .EXAMPLE PS C:\>Invoke-NSGetNsicapprofile -name <string> Get nsicapprofile object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsicapprofile -Filter @{ 'name'='<value>' } Get nsicapprofile data with a filter. .NOTES File Name : Invoke-NSGetNsicapprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsicapprofile/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateLength(1, 127)] [string]$Name, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNsicapprofile: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsicapprofile objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsicapprofile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsicapprofile objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsicapprofile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsicapprofile objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsicapprofile -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsicapprofile configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsicapprofile -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nsicapprofile configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsicapprofile -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsicapprofile: Ended" } } function Invoke-NSAddNsip { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Configuration for ip resource. .PARAMETER Ipaddress IPv4 address to create on the Citrix ADC. Cannot be changed after the IP address is created. .PARAMETER Netmask Subnet mask associated with the IP address. .PARAMETER Type Type of the IP address to create on the Citrix ADC. Cannot be changed after the IP address is created. The following are the different types of Citrix ADC owned IP addresses: * A Subnet IP (SNIP) address is used by the Citrix ADC to communicate with the servers. The Citrix ADC also uses the subnet IP address when generating its own packets, such as packets related to dynamic routing protocols, or to send monitor probes to check the health of the servers. * A Virtual IP (VIP) address is the IP address associated with a virtual server. It is the IP address to which clients connect. An appliance managing a wide range of traffic may have many VIPs configured. Some of the attributes of the VIP address are customized to meet the requirements of the virtual server. * A GSLB site IP (GSLBIP) address is associated with a GSLB site. It is not mandatory to specify a GSLBIP address when you initially configure the Citrix ADC. A GSLBIP address is used only when you create a GSLB site. * A Cluster IP (CLIP) address is the management address of the cluster. All cluster configurations must be performed by accessing the cluster through this IP address. Possible values = SNIP, VIP, NSIP, HostIP, GSLBsiteIP, CLIP .PARAMETER Arp Respond to ARP requests for this IP address. Possible values = ENABLED, DISABLED .PARAMETER Icmp Respond to ICMP requests for this IP address. Possible values = ENABLED, DISABLED .PARAMETER Vserver Use this option to set (enable or disable) the virtual server attribute for this IP address. Possible values = ENABLED, DISABLED .PARAMETER Telnet Allow Telnet access to this IP address. Possible values = ENABLED, DISABLED .PARAMETER Ftp Allow File Transfer Protocol (FTP) access to this IP address. Possible values = ENABLED, DISABLED .PARAMETER Gui Allow graphical user interface (GUI) access to this IP address. Possible values = ENABLED, SECUREONLY, DISABLED .PARAMETER Ssh Allow secure shell (SSH) access to this IP address. Possible values = ENABLED, DISABLED .PARAMETER Snmp Allow Simple Network Management Protocol (SNMP) access to this IP address. Possible values = ENABLED, DISABLED .PARAMETER Mgmtaccess Allow access to management applications on this IP address. Possible values = ENABLED, DISABLED .PARAMETER Restrictaccess Block access to nonmanagement applications on this IP. This option is applicable for MIPs, SNIPs, and NSIP, and is disabled by default. Nonmanagement applications can run on the underlying Citrix ADC Free BSD operating system. Possible values = ENABLED, DISABLED .PARAMETER Dynamicrouting Allow dynamic routing on this IP address. Specific to Subnet IP (SNIP) address. Possible values = ENABLED, DISABLED .PARAMETER Decrementttl Decrement TTL by 1 when ENABLED.This setting is applicable only for UDP traffic. Possible values = ENABLED, DISABLED .PARAMETER Ospf Use this option to enable or disable OSPF on this IP address for the entity. Possible values = ENABLED, DISABLED .PARAMETER Bgp Use this option to enable or disable BGP on this IP address for the entity. Possible values = ENABLED, DISABLED .PARAMETER Rip Use this option to enable or disable RIP on this IP address for the entity. Possible values = ENABLED, DISABLED .PARAMETER Hostroute Option to push the VIP to ZebOS routing table for Kernel route redistribution through dynamic routing protocols. Possible values = ENABLED, DISABLED .PARAMETER Advertiseondefaultpartition Advertise VIPs from Shared VLAN on Default Partition. Possible values = ENABLED, DISABLED .PARAMETER Networkroute Option to push the SNIP subnet to ZebOS routing table for Kernel route redistribution through dynamic routing protocol. Possible values = ENABLED, DISABLED .PARAMETER Tag Tag value for the network/host route associated with this IP. .PARAMETER Hostrtgw IP address of the gateway of the route for this VIP address. .PARAMETER Metric Integer value to add to or subtract from the cost of the route advertised for the VIP address. .PARAMETER Vserverrhilevel Advertise the route for the Virtual IP (VIP) address on the basis of the state of the virtual servers associated with that VIP. * NONE - Advertise the route for the VIP address, regardless of the state of the virtual servers associated with the address. * ONE VSERVER - Advertise the route for the VIP address if at least one of the associated virtual servers is in UP state. * ALL VSERVER - Advertise the route for the VIP address if all of the associated virtual servers are in UP state. * VSVR_CNTRLD - Advertise the route for the VIP address according to the RHIstate (RHI STATE) parameter setting on all the associated virtual servers of the VIP address along with their states. When Vserver RHI Level (RHI) parameter is set to VSVR_CNTRLD, the following are different RHI behaviors for the VIP address on the basis of RHIstate (RHI STATE) settings on the virtual servers associated with the VIP address: * If you set RHI STATE to PASSIVE on all virtual servers, the Citrix ADC always advertises the route for the VIP address. * If you set RHI STATE to ACTIVE on all virtual servers, the Citrix ADC advertises the route for the VIP address if at least one of the associated virtual servers is in UP state. *If you set RHI STATE to ACTIVE on some and PASSIVE on others, the Citrix ADC advertises the route for the VIP address if at least one of the associated virtual servers, whose RHI STATE set to ACTIVE, is in UP state. Possible values = ONE_VSERVER, ALL_VSERVERS, NONE, VSVR_CNTRLD .PARAMETER Ospflsatype Type of LSAs to be used by the OSPF protocol, running on the Citrix ADC, for advertising the route for this VIP address. Possible values = TYPE1, TYPE5 .PARAMETER Ospfarea ID of the area in which the type1 link-state advertisements (LSAs) are to be advertised for this virtual IP (VIP) address by the OSPF protocol running on the Citrix ADC. When this parameter is not set, the VIP is advertised on all areas. Maximum value = 4294967294LU .PARAMETER State Enable or disable the IP address. Possible values = ENABLED, DISABLED .PARAMETER Vrid A positive integer that uniquely identifies a VMAC address for binding to this VIP address. This binding is used to set up Citrix ADCs in an active-active configuration using VRRP. Maximum value = 255 .PARAMETER Icmpresponse Respond to ICMP requests for a Virtual IP (VIP) address on the basis of the states of the virtual servers associated with that VIP. Available settings function as follows: * NONE - The Citrix ADC responds to any ICMP request for the VIP address, irrespective of the states of the virtual servers associated with the address. * ONE VSERVER - The Citrix ADC responds to any ICMP request for the VIP address if at least one of the associated virtual servers is in UP state. * ALL VSERVER - The Citrix ADC responds to any ICMP request for the VIP address if all of the associated virtual servers are in UP state. * VSVR_CNTRLD - The behavior depends on the ICMP VSERVER RESPONSE setting on all the associated virtual servers. The following settings can be made for the ICMP VSERVER RESPONSE parameter on a virtual server: * If you set ICMP VSERVER RESPONSE to PASSIVE on all virtual servers, Citrix ADC always responds. * If you set ICMP VSERVER RESPONSE to ACTIVE on all virtual servers, Citrix ADC responds if even one virtual server is UP. * When you set ICMP VSERVER RESPONSE to ACTIVE on some and PASSIVE on others, Citrix ADC responds if even one virtual server set to ACTIVE is UP. Possible values = NONE, ONE_VSERVER, ALL_VSERVERS, VSVR_CNTRLD .PARAMETER Ownernode The owner node in a Cluster for this IP address. Owner node can vary from 0 to 31. If ownernode is not specified then the IP is treated as Striped IP. .PARAMETER Arpresponse Respond to ARP requests for a Virtual IP (VIP) address on the basis of the states of the virtual servers associated with that VIP. Available settings function as follows: * NONE - The Citrix ADC responds to any ARP request for the VIP address, irrespective of the states of the virtual servers associated with the address. * ONE VSERVER - The Citrix ADC responds to any ARP request for the VIP address if at least one of the associated virtual servers is in UP state. * ALL VSERVER - The Citrix ADC responds to any ARP request for the VIP address if all of the associated virtual servers are in UP state. Possible values = NONE, ONE_VSERVER, ALL_VSERVERS .PARAMETER Ownerdownresponse in cluster system, if the owner node is down, whether should it respond to icmp/arp. Possible values = YES, NO .PARAMETER Td Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0. TD id 4095 is used reserved for LSN use . Maximum value = 4095 .PARAMETER Arpowner The arp owner in a Cluster for this IP address. It can vary from 0 to 31. .PARAMETER Mptcpadvertise If enabled, this IP will be advertised by Citrix ADC to MPTCP enabled clients as part of ADD_ADDR option. Possible values = YES, NO .EXAMPLE PS C:\>Invoke-NSAddNsip -ipaddress <string> -netmask <string> An example how to add nsip config Object(s). .NOTES File Name : Invoke-NSAddNsip Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsip/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Ipaddress, [Parameter(Mandatory)] [string]$Netmask, [ValidateSet('SNIP', 'VIP', 'NSIP', 'HostIP', 'GSLBsiteIP', 'CLIP')] [string]$Type = 'SNIP', [ValidateSet('ENABLED', 'DISABLED')] [string]$Arp = 'ENABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Icmp = 'ENABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Vserver = 'ENABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Telnet = 'ENABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Ftp = 'ENABLED', [ValidateSet('ENABLED', 'SECUREONLY', 'DISABLED')] [string]$Gui = 'ENABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Ssh = 'ENABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Snmp = 'ENABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Mgmtaccess = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Restrictaccess = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Dynamicrouting = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Decrementttl = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Ospf = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Bgp = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Rip = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Hostroute, [ValidateSet('ENABLED', 'DISABLED')] [string]$Advertiseondefaultpartition = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Networkroute, [double]$Tag = '0', [string]$Hostrtgw = '-1', [int]$Metric, [ValidateSet('ONE_VSERVER', 'ALL_VSERVERS', 'NONE', 'VSVR_CNTRLD')] [string]$Vserverrhilevel = 'ONE_VSERVER', [ValidateSet('TYPE1', 'TYPE5')] [string]$Ospflsatype = 'TYPE5', [double]$Ospfarea = '-1', [ValidateSet('ENABLED', 'DISABLED')] [string]$State = 'ENABLED', [double]$Vrid, [ValidateSet('NONE', 'ONE_VSERVER', 'ALL_VSERVERS', 'VSVR_CNTRLD')] [string]$Icmpresponse = '5', [double]$Ownernode = '255', [ValidateSet('NONE', 'ONE_VSERVER', 'ALL_VSERVERS')] [string]$Arpresponse = '5', [ValidateSet('YES', 'NO')] [string]$Ownerdownresponse = 'YES', [double]$Td, [double]$Arpowner = '255', [ValidateSet('YES', 'NO')] [string]$Mptcpadvertise = 'NO' ) begin { Write-Verbose "Invoke-NSAddNsip: Starting" } process { try { $payload = @{ ipaddress = $ipaddress netmask = $netmask } if ( $PSBoundParameters.ContainsKey('type') ) { $payload.Add('type', $type) } if ( $PSBoundParameters.ContainsKey('arp') ) { $payload.Add('arp', $arp) } if ( $PSBoundParameters.ContainsKey('icmp') ) { $payload.Add('icmp', $icmp) } if ( $PSBoundParameters.ContainsKey('vserver') ) { $payload.Add('vserver', $vserver) } if ( $PSBoundParameters.ContainsKey('telnet') ) { $payload.Add('telnet', $telnet) } if ( $PSBoundParameters.ContainsKey('ftp') ) { $payload.Add('ftp', $ftp) } if ( $PSBoundParameters.ContainsKey('gui') ) { $payload.Add('gui', $gui) } if ( $PSBoundParameters.ContainsKey('ssh') ) { $payload.Add('ssh', $ssh) } if ( $PSBoundParameters.ContainsKey('snmp') ) { $payload.Add('snmp', $snmp) } if ( $PSBoundParameters.ContainsKey('mgmtaccess') ) { $payload.Add('mgmtaccess', $mgmtaccess) } if ( $PSBoundParameters.ContainsKey('restrictaccess') ) { $payload.Add('restrictaccess', $restrictaccess) } if ( $PSBoundParameters.ContainsKey('dynamicrouting') ) { $payload.Add('dynamicrouting', $dynamicrouting) } if ( $PSBoundParameters.ContainsKey('decrementttl') ) { $payload.Add('decrementttl', $decrementttl) } if ( $PSBoundParameters.ContainsKey('ospf') ) { $payload.Add('ospf', $ospf) } if ( $PSBoundParameters.ContainsKey('bgp') ) { $payload.Add('bgp', $bgp) } if ( $PSBoundParameters.ContainsKey('rip') ) { $payload.Add('rip', $rip) } if ( $PSBoundParameters.ContainsKey('hostroute') ) { $payload.Add('hostroute', $hostroute) } if ( $PSBoundParameters.ContainsKey('advertiseondefaultpartition') ) { $payload.Add('advertiseondefaultpartition', $advertiseondefaultpartition) } if ( $PSBoundParameters.ContainsKey('networkroute') ) { $payload.Add('networkroute', $networkroute) } if ( $PSBoundParameters.ContainsKey('tag') ) { $payload.Add('tag', $tag) } if ( $PSBoundParameters.ContainsKey('hostrtgw') ) { $payload.Add('hostrtgw', $hostrtgw) } if ( $PSBoundParameters.ContainsKey('metric') ) { $payload.Add('metric', $metric) } if ( $PSBoundParameters.ContainsKey('vserverrhilevel') ) { $payload.Add('vserverrhilevel', $vserverrhilevel) } if ( $PSBoundParameters.ContainsKey('ospflsatype') ) { $payload.Add('ospflsatype', $ospflsatype) } if ( $PSBoundParameters.ContainsKey('ospfarea') ) { $payload.Add('ospfarea', $ospfarea) } if ( $PSBoundParameters.ContainsKey('state') ) { $payload.Add('state', $state) } if ( $PSBoundParameters.ContainsKey('vrid') ) { $payload.Add('vrid', $vrid) } if ( $PSBoundParameters.ContainsKey('icmpresponse') ) { $payload.Add('icmpresponse', $icmpresponse) } if ( $PSBoundParameters.ContainsKey('ownernode') ) { $payload.Add('ownernode', $ownernode) } if ( $PSBoundParameters.ContainsKey('arpresponse') ) { $payload.Add('arpresponse', $arpresponse) } if ( $PSBoundParameters.ContainsKey('ownerdownresponse') ) { $payload.Add('ownerdownresponse', $ownerdownresponse) } if ( $PSBoundParameters.ContainsKey('td') ) { $payload.Add('td', $td) } if ( $PSBoundParameters.ContainsKey('arpowner') ) { $payload.Add('arpowner', $arpowner) } if ( $PSBoundParameters.ContainsKey('mptcpadvertise') ) { $payload.Add('mptcpadvertise', $mptcpadvertise) } if ( $PSCmdlet.ShouldProcess("nsip", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsip -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNsip: Finished" } } function Invoke-NSDeleteNsip { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Configuration for ip resource. .PARAMETER Ipaddress IPv4 address to create on the Citrix ADC. Cannot be changed after the IP address is created. .PARAMETER Td Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0. TD id 4095 is used reserved for LSN use . Maximum value = 4095 .EXAMPLE PS C:\>Invoke-NSDeleteNsip -Ipaddress <string> An example how to delete nsip config Object(s). .NOTES File Name : Invoke-NSDeleteNsip Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsip/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Ipaddress, [double]$Td ) begin { Write-Verbose "Invoke-NSDeleteNsip: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Td') ) { $arguments.Add('td', $Td) } if ( $PSCmdlet.ShouldProcess("$ipaddress", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nsip -NitroPath nitro/v1/config -Resource $ipaddress -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNsip: Finished" } } function Invoke-NSUpdateNsip { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for ip resource. .PARAMETER Ipaddress IPv4 address to create on the Citrix ADC. Cannot be changed after the IP address is created. .PARAMETER Td Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0. TD id 4095 is used reserved for LSN use . Maximum value = 4095 .PARAMETER Netmask Subnet mask associated with the IP address. .PARAMETER Arp Respond to ARP requests for this IP address. Possible values = ENABLED, DISABLED .PARAMETER Icmp Respond to ICMP requests for this IP address. Possible values = ENABLED, DISABLED .PARAMETER Vserver Use this option to set (enable or disable) the virtual server attribute for this IP address. Possible values = ENABLED, DISABLED .PARAMETER Telnet Allow Telnet access to this IP address. Possible values = ENABLED, DISABLED .PARAMETER Ftp Allow File Transfer Protocol (FTP) access to this IP address. Possible values = ENABLED, DISABLED .PARAMETER Gui Allow graphical user interface (GUI) access to this IP address. Possible values = ENABLED, SECUREONLY, DISABLED .PARAMETER Ssh Allow secure shell (SSH) access to this IP address. Possible values = ENABLED, DISABLED .PARAMETER Snmp Allow Simple Network Management Protocol (SNMP) access to this IP address. Possible values = ENABLED, DISABLED .PARAMETER Mgmtaccess Allow access to management applications on this IP address. Possible values = ENABLED, DISABLED .PARAMETER Restrictaccess Block access to nonmanagement applications on this IP. This option is applicable for MIPs, SNIPs, and NSIP, and is disabled by default. Nonmanagement applications can run on the underlying Citrix ADC Free BSD operating system. Possible values = ENABLED, DISABLED .PARAMETER Decrementttl Decrement TTL by 1 when ENABLED.This setting is applicable only for UDP traffic. Possible values = ENABLED, DISABLED .PARAMETER Dynamicrouting Allow dynamic routing on this IP address. Specific to Subnet IP (SNIP) address. Possible values = ENABLED, DISABLED .PARAMETER Ospf Use this option to enable or disable OSPF on this IP address for the entity. Possible values = ENABLED, DISABLED .PARAMETER Bgp Use this option to enable or disable BGP on this IP address for the entity. Possible values = ENABLED, DISABLED .PARAMETER Rip Use this option to enable or disable RIP on this IP address for the entity. Possible values = ENABLED, DISABLED .PARAMETER Hostroute Option to push the VIP to ZebOS routing table for Kernel route redistribution through dynamic routing protocols. Possible values = ENABLED, DISABLED .PARAMETER Advertiseondefaultpartition Advertise VIPs from Shared VLAN on Default Partition. Possible values = ENABLED, DISABLED .PARAMETER Networkroute Option to push the SNIP subnet to ZebOS routing table for Kernel route redistribution through dynamic routing protocol. Possible values = ENABLED, DISABLED .PARAMETER Hostrtgw IP address of the gateway of the route for this VIP address. .PARAMETER Metric Integer value to add to or subtract from the cost of the route advertised for the VIP address. .PARAMETER Vserverrhilevel Advertise the route for the Virtual IP (VIP) address on the basis of the state of the virtual servers associated with that VIP. * NONE - Advertise the route for the VIP address, regardless of the state of the virtual servers associated with the address. * ONE VSERVER - Advertise the route for the VIP address if at least one of the associated virtual servers is in UP state. * ALL VSERVER - Advertise the route for the VIP address if all of the associated virtual servers are in UP state. * VSVR_CNTRLD - Advertise the route for the VIP address according to the RHIstate (RHI STATE) parameter setting on all the associated virtual servers of the VIP address along with their states. When Vserver RHI Level (RHI) parameter is set to VSVR_CNTRLD, the following are different RHI behaviors for the VIP address on the basis of RHIstate (RHI STATE) settings on the virtual servers associated with the VIP address: * If you set RHI STATE to PASSIVE on all virtual servers, the Citrix ADC always advertises the route for the VIP address. * If you set RHI STATE to ACTIVE on all virtual servers, the Citrix ADC advertises the route for the VIP address if at least one of the associated virtual servers is in UP state. *If you set RHI STATE to ACTIVE on some and PASSIVE on others, the Citrix ADC advertises the route for the VIP address if at least one of the associated virtual servers, whose RHI STATE set to ACTIVE, is in UP state. Possible values = ONE_VSERVER, ALL_VSERVERS, NONE, VSVR_CNTRLD .PARAMETER Ospflsatype Type of LSAs to be used by the OSPF protocol, running on the Citrix ADC, for advertising the route for this VIP address. Possible values = TYPE1, TYPE5 .PARAMETER Ospfarea ID of the area in which the type1 link-state advertisements (LSAs) are to be advertised for this virtual IP (VIP) address by the OSPF protocol running on the Citrix ADC. When this parameter is not set, the VIP is advertised on all areas. Maximum value = 4294967294LU .PARAMETER Tag Tag value for the network/host route associated with this IP. .PARAMETER Vrid A positive integer that uniquely identifies a VMAC address for binding to this VIP address. This binding is used to set up Citrix ADCs in an active-active configuration using VRRP. Maximum value = 255 .PARAMETER Icmpresponse Respond to ICMP requests for a Virtual IP (VIP) address on the basis of the states of the virtual servers associated with that VIP. Available settings function as follows: * NONE - The Citrix ADC responds to any ICMP request for the VIP address, irrespective of the states of the virtual servers associated with the address. * ONE VSERVER - The Citrix ADC responds to any ICMP request for the VIP address if at least one of the associated virtual servers is in UP state. * ALL VSERVER - The Citrix ADC responds to any ICMP request for the VIP address if all of the associated virtual servers are in UP state. * VSVR_CNTRLD - The behavior depends on the ICMP VSERVER RESPONSE setting on all the associated virtual servers. The following settings can be made for the ICMP VSERVER RESPONSE parameter on a virtual server: * If you set ICMP VSERVER RESPONSE to PASSIVE on all virtual servers, Citrix ADC always responds. * If you set ICMP VSERVER RESPONSE to ACTIVE on all virtual servers, Citrix ADC responds if even one virtual server is UP. * When you set ICMP VSERVER RESPONSE to ACTIVE on some and PASSIVE on others, Citrix ADC responds if even one virtual server set to ACTIVE is UP. Possible values = NONE, ONE_VSERVER, ALL_VSERVERS, VSVR_CNTRLD .PARAMETER Arpresponse Respond to ARP requests for a Virtual IP (VIP) address on the basis of the states of the virtual servers associated with that VIP. Available settings function as follows: * NONE - The Citrix ADC responds to any ARP request for the VIP address, irrespective of the states of the virtual servers associated with the address. * ONE VSERVER - The Citrix ADC responds to any ARP request for the VIP address if at least one of the associated virtual servers is in UP state. * ALL VSERVER - The Citrix ADC responds to any ARP request for the VIP address if all of the associated virtual servers are in UP state. Possible values = NONE, ONE_VSERVER, ALL_VSERVERS .PARAMETER Ownerdownresponse in cluster system, if the owner node is down, whether should it respond to icmp/arp. Possible values = YES, NO .PARAMETER Arpowner The arp owner in a Cluster for this IP address. It can vary from 0 to 31. .PARAMETER Mptcpadvertise If enabled, this IP will be advertised by Citrix ADC to MPTCP enabled clients as part of ADD_ADDR option. Possible values = YES, NO .EXAMPLE PS C:\>Invoke-NSUpdateNsip -ipaddress <string> An example how to update nsip config Object(s). .NOTES File Name : Invoke-NSUpdateNsip Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsip/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Ipaddress, [double]$Td, [string]$Netmask, [ValidateSet('ENABLED', 'DISABLED')] [string]$Arp, [ValidateSet('ENABLED', 'DISABLED')] [string]$Icmp, [ValidateSet('ENABLED', 'DISABLED')] [string]$Vserver, [ValidateSet('ENABLED', 'DISABLED')] [string]$Telnet, [ValidateSet('ENABLED', 'DISABLED')] [string]$Ftp, [ValidateSet('ENABLED', 'SECUREONLY', 'DISABLED')] [string]$Gui, [ValidateSet('ENABLED', 'DISABLED')] [string]$Ssh, [ValidateSet('ENABLED', 'DISABLED')] [string]$Snmp, [ValidateSet('ENABLED', 'DISABLED')] [string]$Mgmtaccess, [ValidateSet('ENABLED', 'DISABLED')] [string]$Restrictaccess, [ValidateSet('ENABLED', 'DISABLED')] [string]$Decrementttl, [ValidateSet('ENABLED', 'DISABLED')] [string]$Dynamicrouting, [ValidateSet('ENABLED', 'DISABLED')] [string]$Ospf, [ValidateSet('ENABLED', 'DISABLED')] [string]$Bgp, [ValidateSet('ENABLED', 'DISABLED')] [string]$Rip, [ValidateSet('ENABLED', 'DISABLED')] [string]$Hostroute, [ValidateSet('ENABLED', 'DISABLED')] [string]$Advertiseondefaultpartition, [ValidateSet('ENABLED', 'DISABLED')] [string]$Networkroute, [string]$Hostrtgw, [int]$Metric, [ValidateSet('ONE_VSERVER', 'ALL_VSERVERS', 'NONE', 'VSVR_CNTRLD')] [string]$Vserverrhilevel, [ValidateSet('TYPE1', 'TYPE5')] [string]$Ospflsatype, [double]$Ospfarea, [double]$Tag, [double]$Vrid, [ValidateSet('NONE', 'ONE_VSERVER', 'ALL_VSERVERS', 'VSVR_CNTRLD')] [string]$Icmpresponse, [ValidateSet('NONE', 'ONE_VSERVER', 'ALL_VSERVERS')] [string]$Arpresponse, [ValidateSet('YES', 'NO')] [string]$Ownerdownresponse, [double]$Arpowner, [ValidateSet('YES', 'NO')] [string]$Mptcpadvertise ) begin { Write-Verbose "Invoke-NSUpdateNsip: Starting" } process { try { $payload = @{ ipaddress = $ipaddress } if ( $PSBoundParameters.ContainsKey('td') ) { $payload.Add('td', $td) } if ( $PSBoundParameters.ContainsKey('netmask') ) { $payload.Add('netmask', $netmask) } if ( $PSBoundParameters.ContainsKey('arp') ) { $payload.Add('arp', $arp) } if ( $PSBoundParameters.ContainsKey('icmp') ) { $payload.Add('icmp', $icmp) } if ( $PSBoundParameters.ContainsKey('vserver') ) { $payload.Add('vserver', $vserver) } if ( $PSBoundParameters.ContainsKey('telnet') ) { $payload.Add('telnet', $telnet) } if ( $PSBoundParameters.ContainsKey('ftp') ) { $payload.Add('ftp', $ftp) } if ( $PSBoundParameters.ContainsKey('gui') ) { $payload.Add('gui', $gui) } if ( $PSBoundParameters.ContainsKey('ssh') ) { $payload.Add('ssh', $ssh) } if ( $PSBoundParameters.ContainsKey('snmp') ) { $payload.Add('snmp', $snmp) } if ( $PSBoundParameters.ContainsKey('mgmtaccess') ) { $payload.Add('mgmtaccess', $mgmtaccess) } if ( $PSBoundParameters.ContainsKey('restrictaccess') ) { $payload.Add('restrictaccess', $restrictaccess) } if ( $PSBoundParameters.ContainsKey('decrementttl') ) { $payload.Add('decrementttl', $decrementttl) } if ( $PSBoundParameters.ContainsKey('dynamicrouting') ) { $payload.Add('dynamicrouting', $dynamicrouting) } if ( $PSBoundParameters.ContainsKey('ospf') ) { $payload.Add('ospf', $ospf) } if ( $PSBoundParameters.ContainsKey('bgp') ) { $payload.Add('bgp', $bgp) } if ( $PSBoundParameters.ContainsKey('rip') ) { $payload.Add('rip', $rip) } if ( $PSBoundParameters.ContainsKey('hostroute') ) { $payload.Add('hostroute', $hostroute) } if ( $PSBoundParameters.ContainsKey('advertiseondefaultpartition') ) { $payload.Add('advertiseondefaultpartition', $advertiseondefaultpartition) } if ( $PSBoundParameters.ContainsKey('networkroute') ) { $payload.Add('networkroute', $networkroute) } if ( $PSBoundParameters.ContainsKey('hostrtgw') ) { $payload.Add('hostrtgw', $hostrtgw) } if ( $PSBoundParameters.ContainsKey('metric') ) { $payload.Add('metric', $metric) } if ( $PSBoundParameters.ContainsKey('vserverrhilevel') ) { $payload.Add('vserverrhilevel', $vserverrhilevel) } if ( $PSBoundParameters.ContainsKey('ospflsatype') ) { $payload.Add('ospflsatype', $ospflsatype) } if ( $PSBoundParameters.ContainsKey('ospfarea') ) { $payload.Add('ospfarea', $ospfarea) } if ( $PSBoundParameters.ContainsKey('tag') ) { $payload.Add('tag', $tag) } if ( $PSBoundParameters.ContainsKey('vrid') ) { $payload.Add('vrid', $vrid) } if ( $PSBoundParameters.ContainsKey('icmpresponse') ) { $payload.Add('icmpresponse', $icmpresponse) } if ( $PSBoundParameters.ContainsKey('arpresponse') ) { $payload.Add('arpresponse', $arpresponse) } if ( $PSBoundParameters.ContainsKey('ownerdownresponse') ) { $payload.Add('ownerdownresponse', $ownerdownresponse) } if ( $PSBoundParameters.ContainsKey('arpowner') ) { $payload.Add('arpowner', $arpowner) } if ( $PSBoundParameters.ContainsKey('mptcpadvertise') ) { $payload.Add('mptcpadvertise', $mptcpadvertise) } if ( $PSCmdlet.ShouldProcess("nsip", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nsip -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNsip: Finished" } } function Invoke-NSUnsetNsip { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for ip resource. .PARAMETER Ipaddress IPv4 address to create on the Citrix ADC. Cannot be changed after the IP address is created. .PARAMETER Td Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0. TD id 4095 is used reserved for LSN use . Maximum value = 4095 .PARAMETER Ospfarea ID of the area in which the type1 link-state advertisements (LSAs) are to be advertised for this virtual IP (VIP) address by the OSPF protocol running on the Citrix ADC. When this parameter is not set, the VIP is advertised on all areas. Maximum value = 4294967294LU .PARAMETER Hostrtgw IP address of the gateway of the route for this VIP address. .PARAMETER Netmask Subnet mask associated with the IP address. .PARAMETER Arp Respond to ARP requests for this IP address. Possible values = ENABLED, DISABLED .PARAMETER Icmp Respond to ICMP requests for this IP address. Possible values = ENABLED, DISABLED .PARAMETER Vserver Use this option to set (enable or disable) the virtual server attribute for this IP address. Possible values = ENABLED, DISABLED .PARAMETER Telnet Allow Telnet access to this IP address. Possible values = ENABLED, DISABLED .PARAMETER Ftp Allow File Transfer Protocol (FTP) access to this IP address. Possible values = ENABLED, DISABLED .PARAMETER Gui Allow graphical user interface (GUI) access to this IP address. Possible values = ENABLED, SECUREONLY, DISABLED .PARAMETER Ssh Allow secure shell (SSH) access to this IP address. Possible values = ENABLED, DISABLED .PARAMETER Snmp Allow Simple Network Management Protocol (SNMP) access to this IP address. Possible values = ENABLED, DISABLED .PARAMETER Mgmtaccess Allow access to management applications on this IP address. Possible values = ENABLED, DISABLED .PARAMETER Restrictaccess Block access to nonmanagement applications on this IP. This option is applicable for MIPs, SNIPs, and NSIP, and is disabled by default. Nonmanagement applications can run on the underlying Citrix ADC Free BSD operating system. Possible values = ENABLED, DISABLED .PARAMETER Decrementttl Decrement TTL by 1 when ENABLED.This setting is applicable only for UDP traffic. Possible values = ENABLED, DISABLED .PARAMETER Dynamicrouting Allow dynamic routing on this IP address. Specific to Subnet IP (SNIP) address. Possible values = ENABLED, DISABLED .PARAMETER Ospf Use this option to enable or disable OSPF on this IP address for the entity. Possible values = ENABLED, DISABLED .PARAMETER Bgp Use this option to enable or disable BGP on this IP address for the entity. Possible values = ENABLED, DISABLED .PARAMETER Rip Use this option to enable or disable RIP on this IP address for the entity. Possible values = ENABLED, DISABLED .PARAMETER Hostroute Option to push the VIP to ZebOS routing table for Kernel route redistribution through dynamic routing protocols. Possible values = ENABLED, DISABLED .PARAMETER Advertiseondefaultpartition Advertise VIPs from Shared VLAN on Default Partition. Possible values = ENABLED, DISABLED .PARAMETER Networkroute Option to push the SNIP subnet to ZebOS routing table for Kernel route redistribution through dynamic routing protocol. Possible values = ENABLED, DISABLED .PARAMETER Metric Integer value to add to or subtract from the cost of the route advertised for the VIP address. .PARAMETER Vserverrhilevel Advertise the route for the Virtual IP (VIP) address on the basis of the state of the virtual servers associated with that VIP. * NONE - Advertise the route for the VIP address, regardless of the state of the virtual servers associated with the address. * ONE VSERVER - Advertise the route for the VIP address if at least one of the associated virtual servers is in UP state. * ALL VSERVER - Advertise the route for the VIP address if all of the associated virtual servers are in UP state. * VSVR_CNTRLD - Advertise the route for the VIP address according to the RHIstate (RHI STATE) parameter setting on all the associated virtual servers of the VIP address along with their states. When Vserver RHI Level (RHI) parameter is set to VSVR_CNTRLD, the following are different RHI behaviors for the VIP address on the basis of RHIstate (RHI STATE) settings on the virtual servers associated with the VIP address: * If you set RHI STATE to PASSIVE on all virtual servers, the Citrix ADC always advertises the route for the VIP address. * If you set RHI STATE to ACTIVE on all virtual servers, the Citrix ADC advertises the route for the VIP address if at least one of the associated virtual servers is in UP state. *If you set RHI STATE to ACTIVE on some and PASSIVE on others, the Citrix ADC advertises the route for the VIP address if at least one of the associated virtual servers, whose RHI STATE set to ACTIVE, is in UP state. Possible values = ONE_VSERVER, ALL_VSERVERS, NONE, VSVR_CNTRLD .PARAMETER Ospflsatype Type of LSAs to be used by the OSPF protocol, running on the Citrix ADC, for advertising the route for this VIP address. Possible values = TYPE1, TYPE5 .PARAMETER Tag Tag value for the network/host route associated with this IP. .PARAMETER Vrid A positive integer that uniquely identifies a VMAC address for binding to this VIP address. This binding is used to set up Citrix ADCs in an active-active configuration using VRRP. Maximum value = 255 .PARAMETER Icmpresponse Respond to ICMP requests for a Virtual IP (VIP) address on the basis of the states of the virtual servers associated with that VIP. Available settings function as follows: * NONE - The Citrix ADC responds to any ICMP request for the VIP address, irrespective of the states of the virtual servers associated with the address. * ONE VSERVER - The Citrix ADC responds to any ICMP request for the VIP address if at least one of the associated virtual servers is in UP state. * ALL VSERVER - The Citrix ADC responds to any ICMP request for the VIP address if all of the associated virtual servers are in UP state. * VSVR_CNTRLD - The behavior depends on the ICMP VSERVER RESPONSE setting on all the associated virtual servers. The following settings can be made for the ICMP VSERVER RESPONSE parameter on a virtual server: * If you set ICMP VSERVER RESPONSE to PASSIVE on all virtual servers, Citrix ADC always responds. * If you set ICMP VSERVER RESPONSE to ACTIVE on all virtual servers, Citrix ADC responds if even one virtual server is UP. * When you set ICMP VSERVER RESPONSE to ACTIVE on some and PASSIVE on others, Citrix ADC responds if even one virtual server set to ACTIVE is UP. Possible values = NONE, ONE_VSERVER, ALL_VSERVERS, VSVR_CNTRLD .PARAMETER Arpresponse Respond to ARP requests for a Virtual IP (VIP) address on the basis of the states of the virtual servers associated with that VIP. Available settings function as follows: * NONE - The Citrix ADC responds to any ARP request for the VIP address, irrespective of the states of the virtual servers associated with the address. * ONE VSERVER - The Citrix ADC responds to any ARP request for the VIP address if at least one of the associated virtual servers is in UP state. * ALL VSERVER - The Citrix ADC responds to any ARP request for the VIP address if all of the associated virtual servers are in UP state. Possible values = NONE, ONE_VSERVER, ALL_VSERVERS .PARAMETER Ownerdownresponse in cluster system, if the owner node is down, whether should it respond to icmp/arp. Possible values = YES, NO .PARAMETER Arpowner The arp owner in a Cluster for this IP address. It can vary from 0 to 31. .PARAMETER Mptcpadvertise If enabled, this IP will be advertised by Citrix ADC to MPTCP enabled clients as part of ADD_ADDR option. Possible values = YES, NO .EXAMPLE PS C:\>Invoke-NSUnsetNsip -ipaddress <string> An example how to unset nsip config Object(s). .NOTES File Name : Invoke-NSUnsetNsip Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsip Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateScript({ $_.Length -gt 1 })] [string]$Ipaddress, [Boolean]$td, [Boolean]$ospfarea, [Boolean]$hostrtgw, [Boolean]$netmask, [Boolean]$arp, [Boolean]$icmp, [Boolean]$vserver, [Boolean]$telnet, [Boolean]$ftp, [Boolean]$gui, [Boolean]$ssh, [Boolean]$snmp, [Boolean]$mgmtaccess, [Boolean]$restrictaccess, [Boolean]$decrementttl, [Boolean]$dynamicrouting, [Boolean]$ospf, [Boolean]$bgp, [Boolean]$rip, [Boolean]$hostroute, [Boolean]$advertiseondefaultpartition, [Boolean]$networkroute, [Boolean]$metric, [Boolean]$vserverrhilevel, [Boolean]$ospflsatype, [Boolean]$tag, [Boolean]$vrid, [Boolean]$icmpresponse, [Boolean]$arpresponse, [Boolean]$ownerdownresponse, [Boolean]$arpowner, [Boolean]$mptcpadvertise ) begin { Write-Verbose "Invoke-NSUnsetNsip: Starting" } process { try { $payload = @{ ipaddress = $ipaddress } if ( $PSBoundParameters.ContainsKey('td') ) { $payload.Add('td', $td) } if ( $PSBoundParameters.ContainsKey('ospfarea') ) { $payload.Add('ospfarea', $ospfarea) } if ( $PSBoundParameters.ContainsKey('hostrtgw') ) { $payload.Add('hostrtgw', $hostrtgw) } if ( $PSBoundParameters.ContainsKey('netmask') ) { $payload.Add('netmask', $netmask) } if ( $PSBoundParameters.ContainsKey('arp') ) { $payload.Add('arp', $arp) } if ( $PSBoundParameters.ContainsKey('icmp') ) { $payload.Add('icmp', $icmp) } if ( $PSBoundParameters.ContainsKey('vserver') ) { $payload.Add('vserver', $vserver) } if ( $PSBoundParameters.ContainsKey('telnet') ) { $payload.Add('telnet', $telnet) } if ( $PSBoundParameters.ContainsKey('ftp') ) { $payload.Add('ftp', $ftp) } if ( $PSBoundParameters.ContainsKey('gui') ) { $payload.Add('gui', $gui) } if ( $PSBoundParameters.ContainsKey('ssh') ) { $payload.Add('ssh', $ssh) } if ( $PSBoundParameters.ContainsKey('snmp') ) { $payload.Add('snmp', $snmp) } if ( $PSBoundParameters.ContainsKey('mgmtaccess') ) { $payload.Add('mgmtaccess', $mgmtaccess) } if ( $PSBoundParameters.ContainsKey('restrictaccess') ) { $payload.Add('restrictaccess', $restrictaccess) } if ( $PSBoundParameters.ContainsKey('decrementttl') ) { $payload.Add('decrementttl', $decrementttl) } if ( $PSBoundParameters.ContainsKey('dynamicrouting') ) { $payload.Add('dynamicrouting', $dynamicrouting) } if ( $PSBoundParameters.ContainsKey('ospf') ) { $payload.Add('ospf', $ospf) } if ( $PSBoundParameters.ContainsKey('bgp') ) { $payload.Add('bgp', $bgp) } if ( $PSBoundParameters.ContainsKey('rip') ) { $payload.Add('rip', $rip) } if ( $PSBoundParameters.ContainsKey('hostroute') ) { $payload.Add('hostroute', $hostroute) } if ( $PSBoundParameters.ContainsKey('advertiseondefaultpartition') ) { $payload.Add('advertiseondefaultpartition', $advertiseondefaultpartition) } if ( $PSBoundParameters.ContainsKey('networkroute') ) { $payload.Add('networkroute', $networkroute) } if ( $PSBoundParameters.ContainsKey('metric') ) { $payload.Add('metric', $metric) } if ( $PSBoundParameters.ContainsKey('vserverrhilevel') ) { $payload.Add('vserverrhilevel', $vserverrhilevel) } if ( $PSBoundParameters.ContainsKey('ospflsatype') ) { $payload.Add('ospflsatype', $ospflsatype) } if ( $PSBoundParameters.ContainsKey('tag') ) { $payload.Add('tag', $tag) } if ( $PSBoundParameters.ContainsKey('vrid') ) { $payload.Add('vrid', $vrid) } if ( $PSBoundParameters.ContainsKey('icmpresponse') ) { $payload.Add('icmpresponse', $icmpresponse) } if ( $PSBoundParameters.ContainsKey('arpresponse') ) { $payload.Add('arpresponse', $arpresponse) } if ( $PSBoundParameters.ContainsKey('ownerdownresponse') ) { $payload.Add('ownerdownresponse', $ownerdownresponse) } if ( $PSBoundParameters.ContainsKey('arpowner') ) { $payload.Add('arpowner', $arpowner) } if ( $PSBoundParameters.ContainsKey('mptcpadvertise') ) { $payload.Add('mptcpadvertise', $mptcpadvertise) } if ( $PSCmdlet.ShouldProcess("$ipaddress", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nsip -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNsip: Finished" } } function Invoke-NSEnableNsip { <# .SYNOPSIS Enable System/Global level configuration. config Object. .DESCRIPTION Configuration for ip resource. .PARAMETER Ipaddress IPv4 address to create on the Citrix ADC. Cannot be changed after the IP address is created. .PARAMETER Td Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0. TD id 4095 is used reserved for LSN use . Maximum value = 4095 .EXAMPLE PS C:\>Invoke-NSEnableNsip -ipaddress <string> An example how to enable nsip config Object(s). .NOTES File Name : Invoke-NSEnableNsip Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsip/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Ipaddress, [double]$Td ) begin { Write-Verbose "Invoke-NSEnableNsip: Starting" } process { try { $payload = @{ ipaddress = $ipaddress } if ( $PSBoundParameters.ContainsKey('td') ) { $payload.Add('td', $td) } if ( $PSCmdlet.ShouldProcess($Name, "Enable System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsip -Action enable -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSEnableNsip: Finished" } } function Invoke-NSDisableNsip { <# .SYNOPSIS Disable System/Global level configuration. config Object. .DESCRIPTION Configuration for ip resource. .PARAMETER Ipaddress IPv4 address to create on the Citrix ADC. Cannot be changed after the IP address is created. .PARAMETER Td Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0. TD id 4095 is used reserved for LSN use . Maximum value = 4095 .EXAMPLE PS C:\>Invoke-NSDisableNsip -ipaddress <string> An example how to disable nsip config Object(s). .NOTES File Name : Invoke-NSDisableNsip Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsip/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Ipaddress, [double]$Td ) begin { Write-Verbose "Invoke-NSDisableNsip: Starting" } process { try { $payload = @{ ipaddress = $ipaddress } if ( $PSBoundParameters.ContainsKey('td') ) { $payload.Add('td', $td) } if ( $PSCmdlet.ShouldProcess($Name, "Disable System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsip -Action disable -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDisableNsip: Finished" } } function Invoke-NSGetNsip { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for ip resource. .PARAMETER Ipaddress IPv4 address to create on the Citrix ADC. Cannot be changed after the IP address is created. .PARAMETER Td Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0. TD id 4095 is used reserved for LSN use . Maximum value = 4095 .PARAMETER Type Type of the IP address to create on the Citrix ADC. Cannot be changed after the IP address is created. The following are the different types of Citrix ADC owned IP addresses: * A Subnet IP (SNIP) address is used by the Citrix ADC to communicate with the servers. The Citrix ADC also uses the subnet IP address when generating its own packets, such as packets related to dynamic routing protocols, or to send monitor probes to check the health of the servers. * A Virtual IP (VIP) address is the IP address associated with a virtual server. It is the IP address to which clients connect. An appliance managing a wide range of traffic may have many VIPs configured. Some of the attributes of the VIP address are customized to meet the requirements of the virtual server. * A GSLB site IP (GSLBIP) address is associated with a GSLB site. It is not mandatory to specify a GSLBIP address when you initially configure the Citrix ADC. A GSLBIP address is used only when you create a GSLB site. * A Cluster IP (CLIP) address is the management address of the cluster. All cluster configurations must be performed by accessing the cluster through this IP address. Possible values = SNIP, VIP, NSIP, HostIP, GSLBsiteIP, CLIP .PARAMETER GetAll Retrieve all nsip object(s). .PARAMETER Count If specified, the count of the nsip object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsip Get data. .EXAMPLE PS C:\>Invoke-NSGetNsip -GetAll Get all nsip data. .EXAMPLE PS C:\>Invoke-NSGetNsip -Count Get the number of nsip objects. .EXAMPLE PS C:\>Invoke-NSGetNsip -name <string> Get nsip object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsip -Filter @{ 'name'='<value>' } Get nsip data with a filter. .NOTES File Name : Invoke-NSGetNsip Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsip/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByArgument')] [ValidateScript({ $_.Length -gt 1 })] [string]$Ipaddress, [Parameter(ParameterSetName = 'GetByArgument')] [double]$Td, [Parameter(ParameterSetName = 'GetByArgument')] [ValidateSet('SNIP', 'VIP', 'NSIP', 'HostIP', 'GSLBsiteIP', 'CLIP')] [string]$Type, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNsip: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsip objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsip -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsip objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsip -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsip objects by arguments" $arguments = @{ } if ( $PSBoundParameters.ContainsKey('ipaddress') ) { $arguments.Add('ipaddress', $ipaddress) } if ( $PSBoundParameters.ContainsKey('td') ) { $arguments.Add('td', $td) } if ( $PSBoundParameters.ContainsKey('type') ) { $arguments.Add('type', $type) } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsip -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsip configuration for property ''" } else { Write-Verbose "Retrieving nsip configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsip -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsip: Ended" } } function Invoke-NSAddNsip6 { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Configuration for ip6 resource. .PARAMETER Ipv6address IPv6 address to create on the Citrix ADC. .PARAMETER Scope Scope of the IPv6 address to be created. Cannot be changed after the IP address is created. Possible values = global, link-local .PARAMETER Type Type of IP address to be created on the Citrix ADC. Cannot be changed after the IP address is created. Possible values = NSIP, VIP, SNIP, GSLBsiteIP, ADNSsvcIP, RADIUSListenersvcIP, CLIP .PARAMETER Vlan The VLAN number. Maximum value = 4094 .PARAMETER Nd Respond to Neighbor Discovery (ND) requests for this IP address. Possible values = ENABLED, DISABLED .PARAMETER Icmp Respond to ICMP requests for this IP address. Possible values = ENABLED, DISABLED .PARAMETER Vserver Enable or disable the state of all the virtual servers associated with this VIP6 address. Possible values = ENABLED, DISABLED .PARAMETER Telnet Allow Telnet access to this IP address. Possible values = ENABLED, DISABLED .PARAMETER Ftp Allow File Transfer Protocol (FTP) access to this IP address. Possible values = ENABLED, DISABLED .PARAMETER Gui Allow graphical user interface (GUI) access to this IP address. Possible values = ENABLED, SECUREONLY, DISABLED .PARAMETER Ssh Allow secure Shell (SSH) access to this IP address. Possible values = ENABLED, DISABLED .PARAMETER Snmp Allow Simple Network Management Protocol (SNMP) access to this IP address. Possible values = ENABLED, DISABLED .PARAMETER Mgmtaccess Allow access to management applications on this IP address. Possible values = ENABLED, DISABLED .PARAMETER Restrictaccess Block access to nonmanagement applications on this IP address. This option is applicable forMIP6s, SNIP6s, and NSIP6s, and is disabled by default. Nonmanagement applications can run on the underlying Citrix ADC Free BSD operating system. Possible values = ENABLED, DISABLED .PARAMETER Dynamicrouting Allow dynamic routing on this IP address. Specific to Subnet IPv6 (SNIP6) address. Possible values = ENABLED, DISABLED .PARAMETER Decrementhoplimit Decrement Hop Limit by 1 when ENABLED.This setting is applicable only for UDP traffic. Possible values = ENABLED, DISABLED .PARAMETER Hostroute Option to push the VIP6 to ZebOS routing table for Kernel route redistribution through dynamic routing protocols. Possible values = ENABLED, DISABLED .PARAMETER Advertiseondefaultpartition Advertise VIPs from Shared VLAN on Default Partition. Possible values = ENABLED, DISABLED .PARAMETER Networkroute Option to push the SNIP6 subnet to ZebOS routing table for Kernel route redistribution through dynamic routing protocol. Possible values = ENABLED, DISABLED .PARAMETER Tag Tag value for the network/host route associated with this IP. .PARAMETER Ip6hostrtgw IPv6 address of the gateway for the route. If Gateway is not set, VIP uses :: as the gateway. .PARAMETER Metric Integer value to add to or subtract from the cost of the route advertised for the VIP6 address. .PARAMETER Vserverrhilevel Advertise or do not advertise the route for the Virtual IP (VIP6) address on the basis of the state of the virtual servers associated with that VIP6. * NONE - Advertise the route for the VIP6 address, irrespective of the state of the virtual servers associated with the address. * ONE VSERVER - Advertise the route for the VIP6 address if at least one of the associated virtual servers is in UP state. * ALL VSERVER - Advertise the route for the VIP6 address if all of the associated virtual servers are in UP state. * VSVR_CNTRLD. Advertise the route for the VIP address according to the RHIstate (RHI STATE) parameter setting on all the associated virtual servers of the VIP address along with their states. When Vserver RHI Level (RHI) parameter is set to VSVR_CNTRLD, the following are different RHI behaviors for the VIP address on the basis of RHIstate (RHI STATE) settings on the virtual servers associated with the VIP address: * If you set RHI STATE to PASSIVE on all virtual servers, the Citrix ADC always advertises the route for the VIP address. * If you set RHI STATE to ACTIVE on all virtual servers, the Citrix ADC advertises the route for the VIP address if at least one of the associated virtual servers is in UP state. *If you set RHI STATE to ACTIVE on some and PASSIVE on others, the Citrix ADC advertises the route for the VIP address if at least one of the associated virtual servers, whose RHI STATE set to ACTIVE, is in UP state. Possible values = ONE_VSERVER, ALL_VSERVERS, NONE, VSVR_CNTRLD .PARAMETER Ospf6lsatype Type of LSAs to be used by the IPv6 OSPF protocol, running on the Citrix ADC, for advertising the route for the VIP6 address. Possible values = INTRA_AREA, EXTERNAL .PARAMETER Ospfarea ID of the area in which the Intra-Area-Prefix LSAs are to be advertised for the VIP6 address by the IPv6 OSPF protocol running on the Citrix ADC. When ospfArea is not set, VIP6 is advertised on all areas. Maximum value = 4294967294LU .PARAMETER State Enable or disable the IP address. Possible values = DISABLED, ENABLED .PARAMETER Map Mapped IPV4 address for the IPV6 address. .PARAMETER Vrid6 A positive integer that uniquely identifies a VMAC address for binding to this VIP address. This binding is used to set up Citrix ADCs in an active-active configuration using VRRP. Maximum value = 255 .PARAMETER Ownernode ID of the cluster node for which you are adding the IP address. Must be used if you want the IP address to be active only on the specific node. Can be configured only through the cluster IP address. Cannot be changed after the IP address is created. .PARAMETER Ownerdownresponse in cluster system, if the owner node is down, whether should it respond to icmp/arp. Possible values = YES, NO .PARAMETER Td Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0. Maximum value = 4094 .PARAMETER Ndowner NdOwner in Cluster for VIPS and Striped SNIPS. .PARAMETER Mptcpadvertise If enabled, this IP will be advertised by Citrix ADC to MPTCP enabled clients as part of ADD_ADDR option. Possible values = YES, NO .EXAMPLE PS C:\>Invoke-NSAddNsip6 -ipv6address <string> An example how to add nsip6 config Object(s). .NOTES File Name : Invoke-NSAddNsip6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsip6/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Ipv6address, [ValidateSet('global', 'link-local')] [string]$Scope = 'global', [ValidateSet('NSIP', 'VIP', 'SNIP', 'GSLBsiteIP', 'ADNSsvcIP', 'RADIUSListenersvcIP', 'CLIP')] [string]$Type = 'SNIP', [double]$Vlan = '0', [ValidateSet('ENABLED', 'DISABLED')] [string]$Nd = 'ENABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Icmp = 'ENABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Vserver = 'ENABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Telnet = 'ENABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Ftp = 'ENABLED', [ValidateSet('ENABLED', 'SECUREONLY', 'DISABLED')] [string]$Gui = 'ENABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Ssh = 'ENABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Snmp = 'ENABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Mgmtaccess = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Restrictaccess = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Dynamicrouting = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Decrementhoplimit = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Hostroute, [ValidateSet('ENABLED', 'DISABLED')] [string]$Advertiseondefaultpartition = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Networkroute, [double]$Tag = '0', [string]$Ip6hostrtgw = '0', [int]$Metric, [ValidateSet('ONE_VSERVER', 'ALL_VSERVERS', 'NONE', 'VSVR_CNTRLD')] [string]$Vserverrhilevel = 'ONE_VSERVER', [ValidateSet('INTRA_AREA', 'EXTERNAL')] [string]$Ospf6lsatype = 'EXTERNAL', [double]$Ospfarea = '-1', [ValidateSet('DISABLED', 'ENABLED')] [string]$State = 'ENABLED', [string]$Map, [double]$Vrid6, [double]$Ownernode = '255', [ValidateSet('YES', 'NO')] [string]$Ownerdownresponse = 'YES', [double]$Td, [double]$Ndowner = '255', [ValidateSet('YES', 'NO')] [string]$Mptcpadvertise = 'NO' ) begin { Write-Verbose "Invoke-NSAddNsip6: Starting" } process { try { $payload = @{ ipv6address = $ipv6address } if ( $PSBoundParameters.ContainsKey('scope') ) { $payload.Add('scope', $scope) } if ( $PSBoundParameters.ContainsKey('type') ) { $payload.Add('type', $type) } if ( $PSBoundParameters.ContainsKey('vlan') ) { $payload.Add('vlan', $vlan) } if ( $PSBoundParameters.ContainsKey('nd') ) { $payload.Add('nd', $nd) } if ( $PSBoundParameters.ContainsKey('icmp') ) { $payload.Add('icmp', $icmp) } if ( $PSBoundParameters.ContainsKey('vserver') ) { $payload.Add('vserver', $vserver) } if ( $PSBoundParameters.ContainsKey('telnet') ) { $payload.Add('telnet', $telnet) } if ( $PSBoundParameters.ContainsKey('ftp') ) { $payload.Add('ftp', $ftp) } if ( $PSBoundParameters.ContainsKey('gui') ) { $payload.Add('gui', $gui) } if ( $PSBoundParameters.ContainsKey('ssh') ) { $payload.Add('ssh', $ssh) } if ( $PSBoundParameters.ContainsKey('snmp') ) { $payload.Add('snmp', $snmp) } if ( $PSBoundParameters.ContainsKey('mgmtaccess') ) { $payload.Add('mgmtaccess', $mgmtaccess) } if ( $PSBoundParameters.ContainsKey('restrictaccess') ) { $payload.Add('restrictaccess', $restrictaccess) } if ( $PSBoundParameters.ContainsKey('dynamicrouting') ) { $payload.Add('dynamicrouting', $dynamicrouting) } if ( $PSBoundParameters.ContainsKey('decrementhoplimit') ) { $payload.Add('decrementhoplimit', $decrementhoplimit) } if ( $PSBoundParameters.ContainsKey('hostroute') ) { $payload.Add('hostroute', $hostroute) } if ( $PSBoundParameters.ContainsKey('advertiseondefaultpartition') ) { $payload.Add('advertiseondefaultpartition', $advertiseondefaultpartition) } if ( $PSBoundParameters.ContainsKey('networkroute') ) { $payload.Add('networkroute', $networkroute) } if ( $PSBoundParameters.ContainsKey('tag') ) { $payload.Add('tag', $tag) } if ( $PSBoundParameters.ContainsKey('ip6hostrtgw') ) { $payload.Add('ip6hostrtgw', $ip6hostrtgw) } if ( $PSBoundParameters.ContainsKey('metric') ) { $payload.Add('metric', $metric) } if ( $PSBoundParameters.ContainsKey('vserverrhilevel') ) { $payload.Add('vserverrhilevel', $vserverrhilevel) } if ( $PSBoundParameters.ContainsKey('ospf6lsatype') ) { $payload.Add('ospf6lsatype', $ospf6lsatype) } if ( $PSBoundParameters.ContainsKey('ospfarea') ) { $payload.Add('ospfarea', $ospfarea) } if ( $PSBoundParameters.ContainsKey('state') ) { $payload.Add('state', $state) } if ( $PSBoundParameters.ContainsKey('map') ) { $payload.Add('map', $map) } if ( $PSBoundParameters.ContainsKey('vrid6') ) { $payload.Add('vrid6', $vrid6) } if ( $PSBoundParameters.ContainsKey('ownernode') ) { $payload.Add('ownernode', $ownernode) } if ( $PSBoundParameters.ContainsKey('ownerdownresponse') ) { $payload.Add('ownerdownresponse', $ownerdownresponse) } if ( $PSBoundParameters.ContainsKey('td') ) { $payload.Add('td', $td) } if ( $PSBoundParameters.ContainsKey('ndowner') ) { $payload.Add('ndowner', $ndowner) } if ( $PSBoundParameters.ContainsKey('mptcpadvertise') ) { $payload.Add('mptcpadvertise', $mptcpadvertise) } if ( $PSCmdlet.ShouldProcess("nsip6", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsip6 -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNsip6: Finished" } } function Invoke-NSDeleteNsip6 { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Configuration for ip6 resource. .PARAMETER Ipv6address IPv6 address to create on the Citrix ADC. .PARAMETER Td Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0. Maximum value = 4094 .EXAMPLE PS C:\>Invoke-NSDeleteNsip6 -Ipv6address <string> An example how to delete nsip6 config Object(s). .NOTES File Name : Invoke-NSDeleteNsip6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsip6/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Ipv6address, [double]$Td ) begin { Write-Verbose "Invoke-NSDeleteNsip6: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Td') ) { $arguments.Add('td', $Td) } if ( $PSCmdlet.ShouldProcess("$ipv6address", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nsip6 -NitroPath nitro/v1/config -Resource $ipv6address -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNsip6: Finished" } } function Invoke-NSUpdateNsip6 { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for ip6 resource. .PARAMETER Ipv6address IPv6 address to create on the Citrix ADC. .PARAMETER Td Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0. Maximum value = 4094 .PARAMETER Nd Respond to Neighbor Discovery (ND) requests for this IP address. Possible values = ENABLED, DISABLED .PARAMETER Icmp Respond to ICMP requests for this IP address. Possible values = ENABLED, DISABLED .PARAMETER Vserver Enable or disable the state of all the virtual servers associated with this VIP6 address. Possible values = ENABLED, DISABLED .PARAMETER Telnet Allow Telnet access to this IP address. Possible values = ENABLED, DISABLED .PARAMETER Ftp Allow File Transfer Protocol (FTP) access to this IP address. Possible values = ENABLED, DISABLED .PARAMETER Gui Allow graphical user interface (GUI) access to this IP address. Possible values = ENABLED, SECUREONLY, DISABLED .PARAMETER Ssh Allow secure Shell (SSH) access to this IP address. Possible values = ENABLED, DISABLED .PARAMETER Snmp Allow Simple Network Management Protocol (SNMP) access to this IP address. Possible values = ENABLED, DISABLED .PARAMETER Mgmtaccess Allow access to management applications on this IP address. Possible values = ENABLED, DISABLED .PARAMETER Ownerdownresponse in cluster system, if the owner node is down, whether should it respond to icmp/arp. Possible values = YES, NO .PARAMETER Restrictaccess Block access to nonmanagement applications on this IP address. This option is applicable forMIP6s, SNIP6s, and NSIP6s, and is disabled by default. Nonmanagement applications can run on the underlying Citrix ADC Free BSD operating system. Possible values = ENABLED, DISABLED .PARAMETER State Enable or disable the IP address. Possible values = DISABLED, ENABLED .PARAMETER Map Mapped IPV4 address for the IPV6 address. .PARAMETER Decrementhoplimit Decrement Hop Limit by 1 when ENABLED.This setting is applicable only for UDP traffic. Possible values = ENABLED, DISABLED .PARAMETER Dynamicrouting Allow dynamic routing on this IP address. Specific to Subnet IPv6 (SNIP6) address. Possible values = ENABLED, DISABLED .PARAMETER Hostroute Option to push the VIP6 to ZebOS routing table for Kernel route redistribution through dynamic routing protocols. Possible values = ENABLED, DISABLED .PARAMETER Advertiseondefaultpartition Advertise VIPs from Shared VLAN on Default Partition. Possible values = ENABLED, DISABLED .PARAMETER Networkroute Option to push the SNIP6 subnet to ZebOS routing table for Kernel route redistribution through dynamic routing protocol. Possible values = ENABLED, DISABLED .PARAMETER Ip6hostrtgw IPv6 address of the gateway for the route. If Gateway is not set, VIP uses :: as the gateway. .PARAMETER Metric Integer value to add to or subtract from the cost of the route advertised for the VIP6 address. .PARAMETER Vserverrhilevel Advertise or do not advertise the route for the Virtual IP (VIP6) address on the basis of the state of the virtual servers associated with that VIP6. * NONE - Advertise the route for the VIP6 address, irrespective of the state of the virtual servers associated with the address. * ONE VSERVER - Advertise the route for the VIP6 address if at least one of the associated virtual servers is in UP state. * ALL VSERVER - Advertise the route for the VIP6 address if all of the associated virtual servers are in UP state. * VSVR_CNTRLD. Advertise the route for the VIP address according to the RHIstate (RHI STATE) parameter setting on all the associated virtual servers of the VIP address along with their states. When Vserver RHI Level (RHI) parameter is set to VSVR_CNTRLD, the following are different RHI behaviors for the VIP address on the basis of RHIstate (RHI STATE) settings on the virtual servers associated with the VIP address: * If you set RHI STATE to PASSIVE on all virtual servers, the Citrix ADC always advertises the route for the VIP address. * If you set RHI STATE to ACTIVE on all virtual servers, the Citrix ADC advertises the route for the VIP address if at least one of the associated virtual servers is in UP state. *If you set RHI STATE to ACTIVE on some and PASSIVE on others, the Citrix ADC advertises the route for the VIP address if at least one of the associated virtual servers, whose RHI STATE set to ACTIVE, is in UP state. Possible values = ONE_VSERVER, ALL_VSERVERS, NONE, VSVR_CNTRLD .PARAMETER Ospf6lsatype Type of LSAs to be used by the IPv6 OSPF protocol, running on the Citrix ADC, for advertising the route for the VIP6 address. Possible values = INTRA_AREA, EXTERNAL .PARAMETER Ospfarea ID of the area in which the Intra-Area-Prefix LSAs are to be advertised for the VIP6 address by the IPv6 OSPF protocol running on the Citrix ADC. When ospfArea is not set, VIP6 is advertised on all areas. Maximum value = 4294967294LU .PARAMETER Tag Tag value for the network/host route associated with this IP. .PARAMETER Vrid6 A positive integer that uniquely identifies a VMAC address for binding to this VIP address. This binding is used to set up Citrix ADCs in an active-active configuration using VRRP. Maximum value = 255 .PARAMETER Ndowner NdOwner in Cluster for VIPS and Striped SNIPS. .PARAMETER Mptcpadvertise If enabled, this IP will be advertised by Citrix ADC to MPTCP enabled clients as part of ADD_ADDR option. Possible values = YES, NO .EXAMPLE PS C:\>Invoke-NSUpdateNsip6 -ipv6address <string> An example how to update nsip6 config Object(s). .NOTES File Name : Invoke-NSUpdateNsip6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsip6/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Ipv6address, [double]$Td, [ValidateSet('ENABLED', 'DISABLED')] [string]$Nd, [ValidateSet('ENABLED', 'DISABLED')] [string]$Icmp, [ValidateSet('ENABLED', 'DISABLED')] [string]$Vserver, [ValidateSet('ENABLED', 'DISABLED')] [string]$Telnet, [ValidateSet('ENABLED', 'DISABLED')] [string]$Ftp, [ValidateSet('ENABLED', 'SECUREONLY', 'DISABLED')] [string]$Gui, [ValidateSet('ENABLED', 'DISABLED')] [string]$Ssh, [ValidateSet('ENABLED', 'DISABLED')] [string]$Snmp, [ValidateSet('ENABLED', 'DISABLED')] [string]$Mgmtaccess, [ValidateSet('YES', 'NO')] [string]$Ownerdownresponse, [ValidateSet('ENABLED', 'DISABLED')] [string]$Restrictaccess, [ValidateSet('DISABLED', 'ENABLED')] [string]$State, [string]$Map, [ValidateSet('ENABLED', 'DISABLED')] [string]$Decrementhoplimit, [ValidateSet('ENABLED', 'DISABLED')] [string]$Dynamicrouting, [ValidateSet('ENABLED', 'DISABLED')] [string]$Hostroute, [ValidateSet('ENABLED', 'DISABLED')] [string]$Advertiseondefaultpartition, [ValidateSet('ENABLED', 'DISABLED')] [string]$Networkroute, [string]$Ip6hostrtgw, [int]$Metric, [ValidateSet('ONE_VSERVER', 'ALL_VSERVERS', 'NONE', 'VSVR_CNTRLD')] [string]$Vserverrhilevel, [ValidateSet('INTRA_AREA', 'EXTERNAL')] [string]$Ospf6lsatype, [double]$Ospfarea, [double]$Tag, [double]$Vrid6, [double]$Ndowner, [ValidateSet('YES', 'NO')] [string]$Mptcpadvertise ) begin { Write-Verbose "Invoke-NSUpdateNsip6: Starting" } process { try { $payload = @{ ipv6address = $ipv6address } if ( $PSBoundParameters.ContainsKey('td') ) { $payload.Add('td', $td) } if ( $PSBoundParameters.ContainsKey('nd') ) { $payload.Add('nd', $nd) } if ( $PSBoundParameters.ContainsKey('icmp') ) { $payload.Add('icmp', $icmp) } if ( $PSBoundParameters.ContainsKey('vserver') ) { $payload.Add('vserver', $vserver) } if ( $PSBoundParameters.ContainsKey('telnet') ) { $payload.Add('telnet', $telnet) } if ( $PSBoundParameters.ContainsKey('ftp') ) { $payload.Add('ftp', $ftp) } if ( $PSBoundParameters.ContainsKey('gui') ) { $payload.Add('gui', $gui) } if ( $PSBoundParameters.ContainsKey('ssh') ) { $payload.Add('ssh', $ssh) } if ( $PSBoundParameters.ContainsKey('snmp') ) { $payload.Add('snmp', $snmp) } if ( $PSBoundParameters.ContainsKey('mgmtaccess') ) { $payload.Add('mgmtaccess', $mgmtaccess) } if ( $PSBoundParameters.ContainsKey('ownerdownresponse') ) { $payload.Add('ownerdownresponse', $ownerdownresponse) } if ( $PSBoundParameters.ContainsKey('restrictaccess') ) { $payload.Add('restrictaccess', $restrictaccess) } if ( $PSBoundParameters.ContainsKey('state') ) { $payload.Add('state', $state) } if ( $PSBoundParameters.ContainsKey('map') ) { $payload.Add('map', $map) } if ( $PSBoundParameters.ContainsKey('decrementhoplimit') ) { $payload.Add('decrementhoplimit', $decrementhoplimit) } if ( $PSBoundParameters.ContainsKey('dynamicrouting') ) { $payload.Add('dynamicrouting', $dynamicrouting) } if ( $PSBoundParameters.ContainsKey('hostroute') ) { $payload.Add('hostroute', $hostroute) } if ( $PSBoundParameters.ContainsKey('advertiseondefaultpartition') ) { $payload.Add('advertiseondefaultpartition', $advertiseondefaultpartition) } if ( $PSBoundParameters.ContainsKey('networkroute') ) { $payload.Add('networkroute', $networkroute) } if ( $PSBoundParameters.ContainsKey('ip6hostrtgw') ) { $payload.Add('ip6hostrtgw', $ip6hostrtgw) } if ( $PSBoundParameters.ContainsKey('metric') ) { $payload.Add('metric', $metric) } if ( $PSBoundParameters.ContainsKey('vserverrhilevel') ) { $payload.Add('vserverrhilevel', $vserverrhilevel) } if ( $PSBoundParameters.ContainsKey('ospf6lsatype') ) { $payload.Add('ospf6lsatype', $ospf6lsatype) } if ( $PSBoundParameters.ContainsKey('ospfarea') ) { $payload.Add('ospfarea', $ospfarea) } if ( $PSBoundParameters.ContainsKey('tag') ) { $payload.Add('tag', $tag) } if ( $PSBoundParameters.ContainsKey('vrid6') ) { $payload.Add('vrid6', $vrid6) } if ( $PSBoundParameters.ContainsKey('ndowner') ) { $payload.Add('ndowner', $ndowner) } if ( $PSBoundParameters.ContainsKey('mptcpadvertise') ) { $payload.Add('mptcpadvertise', $mptcpadvertise) } if ( $PSCmdlet.ShouldProcess("nsip6", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nsip6 -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNsip6: Finished" } } function Invoke-NSUnsetNsip6 { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for ip6 resource. .PARAMETER Ipv6address IPv6 address to create on the Citrix ADC. .PARAMETER Td Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0. Maximum value = 4094 .PARAMETER Ospfarea ID of the area in which the Intra-Area-Prefix LSAs are to be advertised for the VIP6 address by the IPv6 OSPF protocol running on the Citrix ADC. When ospfArea is not set, VIP6 is advertised on all areas. Maximum value = 4294967294LU .PARAMETER Nd Respond to Neighbor Discovery (ND) requests for this IP address. Possible values = ENABLED, DISABLED .PARAMETER Icmp Respond to ICMP requests for this IP address. Possible values = ENABLED, DISABLED .PARAMETER Vserver Enable or disable the state of all the virtual servers associated with this VIP6 address. Possible values = ENABLED, DISABLED .PARAMETER Telnet Allow Telnet access to this IP address. Possible values = ENABLED, DISABLED .PARAMETER Ftp Allow File Transfer Protocol (FTP) access to this IP address. Possible values = ENABLED, DISABLED .PARAMETER Gui Allow graphical user interface (GUI) access to this IP address. Possible values = ENABLED, SECUREONLY, DISABLED .PARAMETER Ssh Allow secure Shell (SSH) access to this IP address. Possible values = ENABLED, DISABLED .PARAMETER Snmp Allow Simple Network Management Protocol (SNMP) access to this IP address. Possible values = ENABLED, DISABLED .PARAMETER Mgmtaccess Allow access to management applications on this IP address. Possible values = ENABLED, DISABLED .PARAMETER Ownerdownresponse in cluster system, if the owner node is down, whether should it respond to icmp/arp. Possible values = YES, NO .PARAMETER Restrictaccess Block access to nonmanagement applications on this IP address. This option is applicable forMIP6s, SNIP6s, and NSIP6s, and is disabled by default. Nonmanagement applications can run on the underlying Citrix ADC Free BSD operating system. Possible values = ENABLED, DISABLED .PARAMETER State Enable or disable the IP address. Possible values = DISABLED, ENABLED .PARAMETER Map Mapped IPV4 address for the IPV6 address. .PARAMETER Decrementhoplimit Decrement Hop Limit by 1 when ENABLED.This setting is applicable only for UDP traffic. Possible values = ENABLED, DISABLED .PARAMETER Dynamicrouting Allow dynamic routing on this IP address. Specific to Subnet IPv6 (SNIP6) address. Possible values = ENABLED, DISABLED .PARAMETER Hostroute Option to push the VIP6 to ZebOS routing table for Kernel route redistribution through dynamic routing protocols. Possible values = ENABLED, DISABLED .PARAMETER Advertiseondefaultpartition Advertise VIPs from Shared VLAN on Default Partition. Possible values = ENABLED, DISABLED .PARAMETER Networkroute Option to push the SNIP6 subnet to ZebOS routing table for Kernel route redistribution through dynamic routing protocol. Possible values = ENABLED, DISABLED .PARAMETER Ip6hostrtgw IPv6 address of the gateway for the route. If Gateway is not set, VIP uses :: as the gateway. .PARAMETER Metric Integer value to add to or subtract from the cost of the route advertised for the VIP6 address. .PARAMETER Vserverrhilevel Advertise or do not advertise the route for the Virtual IP (VIP6) address on the basis of the state of the virtual servers associated with that VIP6. * NONE - Advertise the route for the VIP6 address, irrespective of the state of the virtual servers associated with the address. * ONE VSERVER - Advertise the route for the VIP6 address if at least one of the associated virtual servers is in UP state. * ALL VSERVER - Advertise the route for the VIP6 address if all of the associated virtual servers are in UP state. * VSVR_CNTRLD. Advertise the route for the VIP address according to the RHIstate (RHI STATE) parameter setting on all the associated virtual servers of the VIP address along with their states. When Vserver RHI Level (RHI) parameter is set to VSVR_CNTRLD, the following are different RHI behaviors for the VIP address on the basis of RHIstate (RHI STATE) settings on the virtual servers associated with the VIP address: * If you set RHI STATE to PASSIVE on all virtual servers, the Citrix ADC always advertises the route for the VIP address. * If you set RHI STATE to ACTIVE on all virtual servers, the Citrix ADC advertises the route for the VIP address if at least one of the associated virtual servers is in UP state. *If you set RHI STATE to ACTIVE on some and PASSIVE on others, the Citrix ADC advertises the route for the VIP address if at least one of the associated virtual servers, whose RHI STATE set to ACTIVE, is in UP state. Possible values = ONE_VSERVER, ALL_VSERVERS, NONE, VSVR_CNTRLD .PARAMETER Ospf6lsatype Type of LSAs to be used by the IPv6 OSPF protocol, running on the Citrix ADC, for advertising the route for the VIP6 address. Possible values = INTRA_AREA, EXTERNAL .PARAMETER Tag Tag value for the network/host route associated with this IP. .PARAMETER Vrid6 A positive integer that uniquely identifies a VMAC address for binding to this VIP address. This binding is used to set up Citrix ADCs in an active-active configuration using VRRP. Maximum value = 255 .PARAMETER Ndowner NdOwner in Cluster for VIPS and Striped SNIPS. .PARAMETER Mptcpadvertise If enabled, this IP will be advertised by Citrix ADC to MPTCP enabled clients as part of ADD_ADDR option. Possible values = YES, NO .EXAMPLE PS C:\>Invoke-NSUnsetNsip6 -ipv6address <string> An example how to unset nsip6 config Object(s). .NOTES File Name : Invoke-NSUnsetNsip6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsip6 Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateScript({ $_.Length -gt 1 })] [string]$Ipv6address, [Boolean]$td, [Boolean]$ospfarea, [Boolean]$nd, [Boolean]$icmp, [Boolean]$vserver, [Boolean]$telnet, [Boolean]$ftp, [Boolean]$gui, [Boolean]$ssh, [Boolean]$snmp, [Boolean]$mgmtaccess, [Boolean]$ownerdownresponse, [Boolean]$restrictaccess, [Boolean]$state, [Boolean]$map, [Boolean]$decrementhoplimit, [Boolean]$dynamicrouting, [Boolean]$hostroute, [Boolean]$advertiseondefaultpartition, [Boolean]$networkroute, [Boolean]$ip6hostrtgw, [Boolean]$metric, [Boolean]$vserverrhilevel, [Boolean]$ospf6lsatype, [Boolean]$tag, [Boolean]$vrid6, [Boolean]$ndowner, [Boolean]$mptcpadvertise ) begin { Write-Verbose "Invoke-NSUnsetNsip6: Starting" } process { try { $payload = @{ ipv6address = $ipv6address } if ( $PSBoundParameters.ContainsKey('td') ) { $payload.Add('td', $td) } if ( $PSBoundParameters.ContainsKey('ospfarea') ) { $payload.Add('ospfarea', $ospfarea) } if ( $PSBoundParameters.ContainsKey('nd') ) { $payload.Add('nd', $nd) } if ( $PSBoundParameters.ContainsKey('icmp') ) { $payload.Add('icmp', $icmp) } if ( $PSBoundParameters.ContainsKey('vserver') ) { $payload.Add('vserver', $vserver) } if ( $PSBoundParameters.ContainsKey('telnet') ) { $payload.Add('telnet', $telnet) } if ( $PSBoundParameters.ContainsKey('ftp') ) { $payload.Add('ftp', $ftp) } if ( $PSBoundParameters.ContainsKey('gui') ) { $payload.Add('gui', $gui) } if ( $PSBoundParameters.ContainsKey('ssh') ) { $payload.Add('ssh', $ssh) } if ( $PSBoundParameters.ContainsKey('snmp') ) { $payload.Add('snmp', $snmp) } if ( $PSBoundParameters.ContainsKey('mgmtaccess') ) { $payload.Add('mgmtaccess', $mgmtaccess) } if ( $PSBoundParameters.ContainsKey('ownerdownresponse') ) { $payload.Add('ownerdownresponse', $ownerdownresponse) } if ( $PSBoundParameters.ContainsKey('restrictaccess') ) { $payload.Add('restrictaccess', $restrictaccess) } if ( $PSBoundParameters.ContainsKey('state') ) { $payload.Add('state', $state) } if ( $PSBoundParameters.ContainsKey('map') ) { $payload.Add('map', $map) } if ( $PSBoundParameters.ContainsKey('decrementhoplimit') ) { $payload.Add('decrementhoplimit', $decrementhoplimit) } if ( $PSBoundParameters.ContainsKey('dynamicrouting') ) { $payload.Add('dynamicrouting', $dynamicrouting) } if ( $PSBoundParameters.ContainsKey('hostroute') ) { $payload.Add('hostroute', $hostroute) } if ( $PSBoundParameters.ContainsKey('advertiseondefaultpartition') ) { $payload.Add('advertiseondefaultpartition', $advertiseondefaultpartition) } if ( $PSBoundParameters.ContainsKey('networkroute') ) { $payload.Add('networkroute', $networkroute) } if ( $PSBoundParameters.ContainsKey('ip6hostrtgw') ) { $payload.Add('ip6hostrtgw', $ip6hostrtgw) } if ( $PSBoundParameters.ContainsKey('metric') ) { $payload.Add('metric', $metric) } if ( $PSBoundParameters.ContainsKey('vserverrhilevel') ) { $payload.Add('vserverrhilevel', $vserverrhilevel) } if ( $PSBoundParameters.ContainsKey('ospf6lsatype') ) { $payload.Add('ospf6lsatype', $ospf6lsatype) } if ( $PSBoundParameters.ContainsKey('tag') ) { $payload.Add('tag', $tag) } if ( $PSBoundParameters.ContainsKey('vrid6') ) { $payload.Add('vrid6', $vrid6) } if ( $PSBoundParameters.ContainsKey('ndowner') ) { $payload.Add('ndowner', $ndowner) } if ( $PSBoundParameters.ContainsKey('mptcpadvertise') ) { $payload.Add('mptcpadvertise', $mptcpadvertise) } if ( $PSCmdlet.ShouldProcess("$ipv6address", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nsip6 -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNsip6: Finished" } } function Invoke-NSGetNsip6 { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for ip6 resource. .PARAMETER GetAll Retrieve all nsip6 object(s). .PARAMETER Count If specified, the count of the nsip6 object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsip6 Get data. .EXAMPLE PS C:\>Invoke-NSGetNsip6 -GetAll Get all nsip6 data. .EXAMPLE PS C:\>Invoke-NSGetNsip6 -Count Get the number of nsip6 objects. .EXAMPLE PS C:\>Invoke-NSGetNsip6 -name <string> Get nsip6 object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsip6 -Filter @{ 'name'='<value>' } Get nsip6 data with a filter. .NOTES File Name : Invoke-NSGetNsip6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsip6/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNsip6: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsip6 objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsip6 -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsip6 objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsip6 -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsip6 objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsip6 -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsip6 configuration for property ''" } else { Write-Verbose "Retrieving nsip6 configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsip6 -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsip6: Ended" } } function Invoke-NSGetNsjob { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for job resource. .PARAMETER Id Running job id. .PARAMETER GetAll Retrieve all nsjob object(s). .PARAMETER Count If specified, the count of the nsjob object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsjob Get data. .EXAMPLE PS C:\>Invoke-NSGetNsjob -GetAll Get all nsjob data. .EXAMPLE PS C:\>Invoke-NSGetNsjob -Count Get the number of nsjob objects. .EXAMPLE PS C:\>Invoke-NSGetNsjob -name <string> Get nsjob object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsjob -Filter @{ 'name'='<value>' } Get nsjob data with a filter. .NOTES File Name : Invoke-NSGetNsjob Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsjob/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [double]$Id, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNsjob: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsjob objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsjob -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsjob objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsjob -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsjob objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsjob -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsjob configuration for property 'id'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsjob -NitroPath nitro/v1/config -Resource $id -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nsjob configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsjob -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsjob: Ended" } } function Invoke-NSGetNslicense { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for license resource. .PARAMETER GetAll Retrieve all nslicense object(s). .PARAMETER Count If specified, the count of the nslicense object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNslicense Get data. .EXAMPLE PS C:\>Invoke-NSGetNslicense -GetAll Get all nslicense data. .EXAMPLE PS C:\>Invoke-NSGetNslicense -name <string> Get nslicense object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNslicense -Filter @{ 'name'='<value>' } Get nslicense data with a filter. .NOTES File Name : Invoke-NSGetNslicense Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nslicense/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNslicense: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nslicense objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslicense -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nslicense objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslicense -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nslicense objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslicense -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nslicense configuration for property ''" } else { Write-Verbose "Retrieving nslicense configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslicense -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNslicense: Ended" } } function Invoke-NSUpdateNslicenseparameters { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for licenseparameters resource. .PARAMETER Alert1gracetimeout If ADC remains in grace for the configured hours then first grace alert will be raised. Maximum value = 24 .PARAMETER Alert2gracetimeout If ADC remains in grace for the configured hours then major grace alert will be raised. Maximum value = 720 .PARAMETER Licenseexpiryalerttime If ADC termed license is nearer to expiry then SNMP expiry alert will be raised. Maximum value = 365 .PARAMETER Heartbeatinterval Heartbeat between ADC and Licenseserver is configurable and applicable in case of pooled licensing. Maximum value = 280 .PARAMETER Inventoryrefreshinterval Inventory refresh interval between ADC and Licenseserver is configurable and applicable in case of pooled licensing. Maximum value = 1440 .EXAMPLE PS C:\>Invoke-NSUpdateNslicenseparameters An example how to update nslicenseparameters config Object(s). .NOTES File Name : Invoke-NSUpdateNslicenseparameters Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nslicenseparameters/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [double]$Alert1gracetimeout, [double]$Alert2gracetimeout, [double]$Licenseexpiryalerttime, [double]$Heartbeatinterval, [double]$Inventoryrefreshinterval ) begin { Write-Verbose "Invoke-NSUpdateNslicenseparameters: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('alert1gracetimeout') ) { $payload.Add('alert1gracetimeout', $alert1gracetimeout) } if ( $PSBoundParameters.ContainsKey('alert2gracetimeout') ) { $payload.Add('alert2gracetimeout', $alert2gracetimeout) } if ( $PSBoundParameters.ContainsKey('licenseexpiryalerttime') ) { $payload.Add('licenseexpiryalerttime', $licenseexpiryalerttime) } if ( $PSBoundParameters.ContainsKey('heartbeatinterval') ) { $payload.Add('heartbeatinterval', $heartbeatinterval) } if ( $PSBoundParameters.ContainsKey('inventoryrefreshinterval') ) { $payload.Add('inventoryrefreshinterval', $inventoryrefreshinterval) } if ( $PSCmdlet.ShouldProcess("nslicenseparameters", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nslicenseparameters -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNslicenseparameters: Finished" } } function Invoke-NSUnsetNslicenseparameters { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for licenseparameters resource. .PARAMETER Alert1gracetimeout If ADC remains in grace for the configured hours then first grace alert will be raised. Maximum value = 24 .PARAMETER Alert2gracetimeout If ADC remains in grace for the configured hours then major grace alert will be raised. Maximum value = 720 .PARAMETER Licenseexpiryalerttime If ADC termed license is nearer to expiry then SNMP expiry alert will be raised. Maximum value = 365 .PARAMETER Heartbeatinterval Heartbeat between ADC and Licenseserver is configurable and applicable in case of pooled licensing. Maximum value = 280 .PARAMETER Inventoryrefreshinterval Inventory refresh interval between ADC and Licenseserver is configurable and applicable in case of pooled licensing. Maximum value = 1440 .EXAMPLE PS C:\>Invoke-NSUnsetNslicenseparameters An example how to unset nslicenseparameters config Object(s). .NOTES File Name : Invoke-NSUnsetNslicenseparameters Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nslicenseparameters Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Boolean]$alert1gracetimeout, [Boolean]$alert2gracetimeout, [Boolean]$licenseexpiryalerttime, [Boolean]$heartbeatinterval, [Boolean]$inventoryrefreshinterval ) begin { Write-Verbose "Invoke-NSUnsetNslicenseparameters: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('alert1gracetimeout') ) { $payload.Add('alert1gracetimeout', $alert1gracetimeout) } if ( $PSBoundParameters.ContainsKey('alert2gracetimeout') ) { $payload.Add('alert2gracetimeout', $alert2gracetimeout) } if ( $PSBoundParameters.ContainsKey('licenseexpiryalerttime') ) { $payload.Add('licenseexpiryalerttime', $licenseexpiryalerttime) } if ( $PSBoundParameters.ContainsKey('heartbeatinterval') ) { $payload.Add('heartbeatinterval', $heartbeatinterval) } if ( $PSBoundParameters.ContainsKey('inventoryrefreshinterval') ) { $payload.Add('inventoryrefreshinterval', $inventoryrefreshinterval) } if ( $PSCmdlet.ShouldProcess("nslicenseparameters", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nslicenseparameters -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNslicenseparameters: Finished" } } function Invoke-NSGetNslicenseparameters { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for licenseparameters resource. .PARAMETER GetAll Retrieve all nslicenseparameters object(s). .PARAMETER Count If specified, the count of the nslicenseparameters object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNslicenseparameters Get data. .EXAMPLE PS C:\>Invoke-NSGetNslicenseparameters -GetAll Get all nslicenseparameters data. .EXAMPLE PS C:\>Invoke-NSGetNslicenseparameters -name <string> Get nslicenseparameters object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNslicenseparameters -Filter @{ 'name'='<value>' } Get nslicenseparameters data with a filter. .NOTES File Name : Invoke-NSGetNslicenseparameters Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nslicenseparameters/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNslicenseparameters: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nslicenseparameters objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslicenseparameters -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nslicenseparameters objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslicenseparameters -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nslicenseparameters objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslicenseparameters -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nslicenseparameters configuration for property ''" } else { Write-Verbose "Retrieving nslicenseparameters configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslicenseparameters -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNslicenseparameters: Ended" } } function Invoke-NSAddNslicenseproxyserver { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Configuration for licenseproxyserver resource. .PARAMETER Serverip IP address of the License proxy server. .PARAMETER Servername Fully qualified domain name of the License proxy server. .PARAMETER Port License proxy server port. .EXAMPLE PS C:\>Invoke-NSAddNslicenseproxyserver -port <double> An example how to add nslicenseproxyserver config Object(s). .NOTES File Name : Invoke-NSAddNslicenseproxyserver Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nslicenseproxyserver/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateScript({ $_.Length -gt 1 })] [string]$Serverip, [string]$Servername, [Parameter(Mandatory)] [double]$Port ) begin { Write-Verbose "Invoke-NSAddNslicenseproxyserver: Starting" } process { try { $payload = @{ port = $port } if ( $PSBoundParameters.ContainsKey('serverip') ) { $payload.Add('serverip', $serverip) } if ( $PSBoundParameters.ContainsKey('servername') ) { $payload.Add('servername', $servername) } if ( $PSCmdlet.ShouldProcess("nslicenseproxyserver", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nslicenseproxyserver -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNslicenseproxyserver: Finished" } } function Invoke-NSDeleteNslicenseproxyserver { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Configuration for licenseproxyserver resource. .PARAMETER Serverip IP address of the License proxy server. .PARAMETER Servername Fully qualified domain name of the License proxy server. .EXAMPLE PS C:\>Invoke-NSDeleteNslicenseproxyserver -Serverip <string> An example how to delete nslicenseproxyserver config Object(s). .NOTES File Name : Invoke-NSDeleteNslicenseproxyserver Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nslicenseproxyserver/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Serverip, [string]$Servername ) begin { Write-Verbose "Invoke-NSDeleteNslicenseproxyserver: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Servername') ) { $arguments.Add('servername', $Servername) } if ( $PSCmdlet.ShouldProcess("$serverip", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nslicenseproxyserver -NitroPath nitro/v1/config -Resource $serverip -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNslicenseproxyserver: Finished" } } function Invoke-NSUpdateNslicenseproxyserver { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for licenseproxyserver resource. .PARAMETER Serverip IP address of the License proxy server. .PARAMETER Servername Fully qualified domain name of the License proxy server. .PARAMETER Port License proxy server port. .EXAMPLE PS C:\>Invoke-NSUpdateNslicenseproxyserver -port <double> An example how to update nslicenseproxyserver config Object(s). .NOTES File Name : Invoke-NSUpdateNslicenseproxyserver Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nslicenseproxyserver/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateScript({ $_.Length -gt 1 })] [string]$Serverip, [string]$Servername, [Parameter(Mandatory)] [double]$Port ) begin { Write-Verbose "Invoke-NSUpdateNslicenseproxyserver: Starting" } process { try { $payload = @{ port = $port } if ( $PSBoundParameters.ContainsKey('serverip') ) { $payload.Add('serverip', $serverip) } if ( $PSBoundParameters.ContainsKey('servername') ) { $payload.Add('servername', $servername) } if ( $PSCmdlet.ShouldProcess("nslicenseproxyserver", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nslicenseproxyserver -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNslicenseproxyserver: Finished" } } function Invoke-NSGetNslicenseproxyserver { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for licenseproxyserver resource. .PARAMETER GetAll Retrieve all nslicenseproxyserver object(s). .PARAMETER Count If specified, the count of the nslicenseproxyserver object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNslicenseproxyserver Get data. .EXAMPLE PS C:\>Invoke-NSGetNslicenseproxyserver -GetAll Get all nslicenseproxyserver data. .EXAMPLE PS C:\>Invoke-NSGetNslicenseproxyserver -Count Get the number of nslicenseproxyserver objects. .EXAMPLE PS C:\>Invoke-NSGetNslicenseproxyserver -name <string> Get nslicenseproxyserver object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNslicenseproxyserver -Filter @{ 'name'='<value>' } Get nslicenseproxyserver data with a filter. .NOTES File Name : Invoke-NSGetNslicenseproxyserver Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nslicenseproxyserver/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNslicenseproxyserver: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nslicenseproxyserver objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslicenseproxyserver -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nslicenseproxyserver objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslicenseproxyserver -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nslicenseproxyserver objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslicenseproxyserver -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nslicenseproxyserver configuration for property ''" } else { Write-Verbose "Retrieving nslicenseproxyserver configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslicenseproxyserver -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNslicenseproxyserver: Ended" } } function Invoke-NSAddNslicenseserver { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Configuration for licenseserver resource. .PARAMETER Licenseserverip IP address of the License server. .PARAMETER Servername Fully qualified domain name of the License server. .PARAMETER Port License server port. .PARAMETER Forceupdateip If this flag is used while adding the licenseserver, existing config will be overwritten. Use this flag only if you are sure that the new licenseserver has the required capacity. .PARAMETER Licensemode This paramter indicates type of license customer interested while configuring add/set licenseserver. Possible values = Pooled, VCPU, CICO, SelfManagedPool, SelfManagedvCPU .EXAMPLE PS C:\>Invoke-NSAddNslicenseserver An example how to add nslicenseserver config Object(s). .NOTES File Name : Invoke-NSAddNslicenseserver Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nslicenseserver/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateScript({ $_.Length -gt 1 })] [string]$Licenseserverip, [string]$Servername, [double]$Port, [boolean]$Forceupdateip, [ValidateSet('Pooled', 'VCPU', 'CICO', 'SelfManagedPool', 'SelfManagedvCPU')] [string]$Licensemode ) begin { Write-Verbose "Invoke-NSAddNslicenseserver: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('licenseserverip') ) { $payload.Add('licenseserverip', $licenseserverip) } if ( $PSBoundParameters.ContainsKey('servername') ) { $payload.Add('servername', $servername) } if ( $PSBoundParameters.ContainsKey('port') ) { $payload.Add('port', $port) } if ( $PSBoundParameters.ContainsKey('forceupdateip') ) { $payload.Add('forceupdateip', $forceupdateip) } if ( $PSBoundParameters.ContainsKey('licensemode') ) { $payload.Add('licensemode', $licensemode) } if ( $PSCmdlet.ShouldProcess("nslicenseserver", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nslicenseserver -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNslicenseserver: Finished" } } function Invoke-NSDeleteNslicenseserver { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Configuration for licenseserver resource. .PARAMETER Licenseserverip IP address of the License server. .PARAMETER Servername Fully qualified domain name of the License server. .EXAMPLE PS C:\>Invoke-NSDeleteNslicenseserver -Licenseserverip <string> An example how to delete nslicenseserver config Object(s). .NOTES File Name : Invoke-NSDeleteNslicenseserver Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nslicenseserver/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Licenseserverip, [string]$Servername ) begin { Write-Verbose "Invoke-NSDeleteNslicenseserver: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Servername') ) { $arguments.Add('servername', $Servername) } if ( $PSCmdlet.ShouldProcess("$licenseserverip", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nslicenseserver -NitroPath nitro/v1/config -Resource $licenseserverip -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNslicenseserver: Finished" } } function Invoke-NSUpdateNslicenseserver { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for licenseserver resource. .PARAMETER Licenseserverip IP address of the License server. .PARAMETER Servername Fully qualified domain name of the License server. .PARAMETER Port License server port. .PARAMETER Licensemode This paramter indicates type of license customer interested while configuring add/set licenseserver. Possible values = Pooled, VCPU, CICO, SelfManagedPool, SelfManagedvCPU .EXAMPLE PS C:\>Invoke-NSUpdateNslicenseserver An example how to update nslicenseserver config Object(s). .NOTES File Name : Invoke-NSUpdateNslicenseserver Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nslicenseserver/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateScript({ $_.Length -gt 1 })] [string]$Licenseserverip, [string]$Servername, [double]$Port, [ValidateSet('Pooled', 'VCPU', 'CICO', 'SelfManagedPool', 'SelfManagedvCPU')] [string]$Licensemode ) begin { Write-Verbose "Invoke-NSUpdateNslicenseserver: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('licenseserverip') ) { $payload.Add('licenseserverip', $licenseserverip) } if ( $PSBoundParameters.ContainsKey('servername') ) { $payload.Add('servername', $servername) } if ( $PSBoundParameters.ContainsKey('port') ) { $payload.Add('port', $port) } if ( $PSBoundParameters.ContainsKey('licensemode') ) { $payload.Add('licensemode', $licensemode) } if ( $PSCmdlet.ShouldProcess("nslicenseserver", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nslicenseserver -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNslicenseserver: Finished" } } function Invoke-NSGetNslicenseserver { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for licenseserver resource. .PARAMETER Licenseserverip IP address of the License server. .PARAMETER Servername Fully qualified domain name of the License server. .PARAMETER Nodeid Unique number that identifies the cluster node. Maximum value = 31 .PARAMETER GetAll Retrieve all nslicenseserver object(s). .PARAMETER Count If specified, the count of the nslicenseserver object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNslicenseserver Get data. .EXAMPLE PS C:\>Invoke-NSGetNslicenseserver -GetAll Get all nslicenseserver data. .EXAMPLE PS C:\>Invoke-NSGetNslicenseserver -Count Get the number of nslicenseserver objects. .EXAMPLE PS C:\>Invoke-NSGetNslicenseserver -name <string> Get nslicenseserver object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNslicenseserver -Filter @{ 'name'='<value>' } Get nslicenseserver data with a filter. .NOTES File Name : Invoke-NSGetNslicenseserver Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nslicenseserver/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByArgument')] [ValidateScript({ $_.Length -gt 1 })] [string]$Licenseserverip, [Parameter(ParameterSetName = 'GetByArgument')] [string]$Servername, [Parameter(ParameterSetName = 'GetByArgument')] [double]$Nodeid, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNslicenseserver: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nslicenseserver objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslicenseserver -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nslicenseserver objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslicenseserver -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nslicenseserver objects by arguments" $arguments = @{ } if ( $PSBoundParameters.ContainsKey('licenseserverip') ) { $arguments.Add('licenseserverip', $licenseserverip) } if ( $PSBoundParameters.ContainsKey('servername') ) { $arguments.Add('servername', $servername) } if ( $PSBoundParameters.ContainsKey('nodeid') ) { $arguments.Add('nodeid', $nodeid) } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslicenseserver -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nslicenseserver configuration for property ''" } else { Write-Verbose "Retrieving nslicenseserver configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslicenseserver -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNslicenseserver: Ended" } } function Invoke-NSGetNslicenseserverpool { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for licenseserver resource. .PARAMETER Getalllicenses If this flag is used while doing getinventory, it displays all licenses from licenseserver. .PARAMETER GetAll Retrieve all nslicenseserverpool object(s). .PARAMETER Count If specified, the count of the nslicenseserverpool object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNslicenseserverpool Get data. .EXAMPLE PS C:\>Invoke-NSGetNslicenseserverpool -GetAll Get all nslicenseserverpool data. .EXAMPLE PS C:\>Invoke-NSGetNslicenseserverpool -name <string> Get nslicenseserverpool object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNslicenseserverpool -Filter @{ 'name'='<value>' } Get nslicenseserverpool data with a filter. .NOTES File Name : Invoke-NSGetNslicenseserverpool Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nslicenseserverpool/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByArgument')] [boolean]$Getalllicenses, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNslicenseserverpool: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nslicenseserverpool objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslicenseserverpool -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nslicenseserverpool objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslicenseserverpool -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nslicenseserverpool objects by arguments" $arguments = @{ } if ( $PSBoundParameters.ContainsKey('getalllicenses') ) { $arguments.Add('getalllicenses', $getalllicenses) } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslicenseserverpool -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nslicenseserverpool configuration for property ''" } else { Write-Verbose "Retrieving nslicenseserverpool configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslicenseserverpool -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNslicenseserverpool: Ended" } } function Invoke-NSAddNslimitidentifier { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Configuration for limit Identifier resource. .PARAMETER Limitidentifier Name for a rate limit identifier. Must begin with an ASCII letter or underscore (_) character, and must consist only of ASCII alphanumeric or underscore characters. Reserved words must not be used. .PARAMETER Threshold Maximum number of requests that are allowed in the given timeslice when requests (mode is set as REQUEST_RATE) are tracked per timeslice. When connections (mode is set as CONNECTION) are tracked, it is the total number of connections that would be let through. .PARAMETER Timeslice Time interval, in milliseconds, specified in multiples of 10, during which requests are tracked to check if they cross the threshold. This argument is needed only when the mode is set to REQUEST_RATE. .PARAMETER Mode Defines the type of traffic to be tracked. * REQUEST_RATE - Tracks requests/timeslice. * CONNECTION - Tracks active transactions. Examples 1. To permit 20 requests in 10 ms and 2 traps in 10 ms: add limitidentifier limit_req -mode request_rate -limitType smooth -timeslice 1000 -Threshold 2000 -trapsInTimeSlice 200 2. To permit 50 requests in 10 ms: set limitidentifier limit_req -mode request_rate -timeslice 1000 -Threshold 5000 -limitType smooth 3. To permit 1 request in 40 ms: set limitidentifier limit_req -mode request_rate -timeslice 2000 -Threshold 50 -limitType smooth 4. To permit 1 request in 200 ms and 1 trap in 130 ms: set limitidentifier limit_req -mode request_rate -timeslice 1000 -Threshold 5 -limitType smooth -trapsInTimeSlice 8 5. To permit 5000 requests in 1000 ms and 200 traps in 1000 ms: set limitidentifier limit_req -mode request_rate -timeslice 1000 -Threshold 5000 -limitType BURSTY. Possible values = CONNECTION, REQUEST_RATE, NONE .PARAMETER Limittype Smooth or bursty request type. * SMOOTH - When you want the permitted number of requests in a given interval of time to be spread evenly across the timeslice * BURSTY - When you want the permitted number of requests to exhaust the quota anytime within the timeslice. This argument is needed only when the mode is set to REQUEST_RATE. Possible values = BURSTY, SMOOTH .PARAMETER Selectorname Name of the rate limit selector. If this argument is NULL, rate limiting will be applied on all traffic received by the virtual server or the Citrix ADC (depending on whether the limit identifier is bound to a virtual server or globally) without any filtering. .PARAMETER Maxbandwidth Maximum bandwidth permitted, in kbps. Maximum value = 4294967287 .PARAMETER Trapsintimeslice Number of traps to be sent in the timeslice configured. A value of 0 indicates that traps are disabled. Maximum value = 65535 .PARAMETER PassThru Return details about the created nslimitidentifier item. .EXAMPLE PS C:\>Invoke-NSAddNslimitidentifier -limitidentifier <string> An example how to add nslimitidentifier config Object(s). .NOTES File Name : Invoke-NSAddNslimitidentifier Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nslimitidentifier/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidatePattern('^(([a-zA-Z0-9]|[_])+([a-zA-Z0-9]|[_])+)$')] [string]$Limitidentifier, [double]$Threshold = '1', [double]$Timeslice = '1000', [ValidateSet('CONNECTION', 'REQUEST_RATE', 'NONE')] [string]$Mode = 'REQUEST_RATE', [ValidateSet('BURSTY', 'SMOOTH')] [string]$Limittype = 'BURSTY', [ValidateScript({ $_.Length -gt 1 })] [string]$Selectorname, [double]$Maxbandwidth, [double]$Trapsintimeslice, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNslimitidentifier: Starting" } process { try { $payload = @{ limitidentifier = $limitidentifier } if ( $PSBoundParameters.ContainsKey('threshold') ) { $payload.Add('threshold', $threshold) } if ( $PSBoundParameters.ContainsKey('timeslice') ) { $payload.Add('timeslice', $timeslice) } if ( $PSBoundParameters.ContainsKey('mode') ) { $payload.Add('mode', $mode) } if ( $PSBoundParameters.ContainsKey('limittype') ) { $payload.Add('limittype', $limittype) } if ( $PSBoundParameters.ContainsKey('selectorname') ) { $payload.Add('selectorname', $selectorname) } if ( $PSBoundParameters.ContainsKey('maxbandwidth') ) { $payload.Add('maxbandwidth', $maxbandwidth) } if ( $PSBoundParameters.ContainsKey('trapsintimeslice') ) { $payload.Add('trapsintimeslice', $trapsintimeslice) } if ( $PSCmdlet.ShouldProcess("nslimitidentifier", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nslimitidentifier -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNslimitidentifier -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNslimitidentifier: Finished" } } function Invoke-NSDeleteNslimitidentifier { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Configuration for limit Identifier resource. .PARAMETER Limitidentifier Name for a rate limit identifier. Must begin with an ASCII letter or underscore (_) character, and must consist only of ASCII alphanumeric or underscore characters. Reserved words must not be used. .EXAMPLE PS C:\>Invoke-NSDeleteNslimitidentifier -Limitidentifier <string> An example how to delete nslimitidentifier config Object(s). .NOTES File Name : Invoke-NSDeleteNslimitidentifier Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nslimitidentifier/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Limitidentifier ) begin { Write-Verbose "Invoke-NSDeleteNslimitidentifier: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$limitidentifier", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nslimitidentifier -NitroPath nitro/v1/config -Resource $limitidentifier -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNslimitidentifier: Finished" } } function Invoke-NSUpdateNslimitidentifier { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for limit Identifier resource. .PARAMETER Limitidentifier Name for a rate limit identifier. Must begin with an ASCII letter or underscore (_) character, and must consist only of ASCII alphanumeric or underscore characters. Reserved words must not be used. .PARAMETER Threshold Maximum number of requests that are allowed in the given timeslice when requests (mode is set as REQUEST_RATE) are tracked per timeslice. When connections (mode is set as CONNECTION) are tracked, it is the total number of connections that would be let through. .PARAMETER Timeslice Time interval, in milliseconds, specified in multiples of 10, during which requests are tracked to check if they cross the threshold. This argument is needed only when the mode is set to REQUEST_RATE. .PARAMETER Mode Defines the type of traffic to be tracked. * REQUEST_RATE - Tracks requests/timeslice. * CONNECTION - Tracks active transactions. Examples 1. To permit 20 requests in 10 ms and 2 traps in 10 ms: add limitidentifier limit_req -mode request_rate -limitType smooth -timeslice 1000 -Threshold 2000 -trapsInTimeSlice 200 2. To permit 50 requests in 10 ms: set limitidentifier limit_req -mode request_rate -timeslice 1000 -Threshold 5000 -limitType smooth 3. To permit 1 request in 40 ms: set limitidentifier limit_req -mode request_rate -timeslice 2000 -Threshold 50 -limitType smooth 4. To permit 1 request in 200 ms and 1 trap in 130 ms: set limitidentifier limit_req -mode request_rate -timeslice 1000 -Threshold 5 -limitType smooth -trapsInTimeSlice 8 5. To permit 5000 requests in 1000 ms and 200 traps in 1000 ms: set limitidentifier limit_req -mode request_rate -timeslice 1000 -Threshold 5000 -limitType BURSTY. Possible values = CONNECTION, REQUEST_RATE, NONE .PARAMETER Limittype Smooth or bursty request type. * SMOOTH - When you want the permitted number of requests in a given interval of time to be spread evenly across the timeslice * BURSTY - When you want the permitted number of requests to exhaust the quota anytime within the timeslice. This argument is needed only when the mode is set to REQUEST_RATE. Possible values = BURSTY, SMOOTH .PARAMETER Selectorname Name of the rate limit selector. If this argument is NULL, rate limiting will be applied on all traffic received by the virtual server or the Citrix ADC (depending on whether the limit identifier is bound to a virtual server or globally) without any filtering. .PARAMETER Maxbandwidth Maximum bandwidth permitted, in kbps. Maximum value = 4294967287 .PARAMETER Trapsintimeslice Number of traps to be sent in the timeslice configured. A value of 0 indicates that traps are disabled. Maximum value = 65535 .PARAMETER PassThru Return details about the created nslimitidentifier item. .EXAMPLE PS C:\>Invoke-NSUpdateNslimitidentifier -limitidentifier <string> An example how to update nslimitidentifier config Object(s). .NOTES File Name : Invoke-NSUpdateNslimitidentifier Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nslimitidentifier/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidatePattern('^(([a-zA-Z0-9]|[_])+([a-zA-Z0-9]|[_])+)$')] [string]$Limitidentifier, [double]$Threshold, [double]$Timeslice, [ValidateSet('CONNECTION', 'REQUEST_RATE', 'NONE')] [string]$Mode, [ValidateSet('BURSTY', 'SMOOTH')] [string]$Limittype, [ValidateScript({ $_.Length -gt 1 })] [string]$Selectorname, [double]$Maxbandwidth, [double]$Trapsintimeslice, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateNslimitidentifier: Starting" } process { try { $payload = @{ limitidentifier = $limitidentifier } if ( $PSBoundParameters.ContainsKey('threshold') ) { $payload.Add('threshold', $threshold) } if ( $PSBoundParameters.ContainsKey('timeslice') ) { $payload.Add('timeslice', $timeslice) } if ( $PSBoundParameters.ContainsKey('mode') ) { $payload.Add('mode', $mode) } if ( $PSBoundParameters.ContainsKey('limittype') ) { $payload.Add('limittype', $limittype) } if ( $PSBoundParameters.ContainsKey('selectorname') ) { $payload.Add('selectorname', $selectorname) } if ( $PSBoundParameters.ContainsKey('maxbandwidth') ) { $payload.Add('maxbandwidth', $maxbandwidth) } if ( $PSBoundParameters.ContainsKey('trapsintimeslice') ) { $payload.Add('trapsintimeslice', $trapsintimeslice) } if ( $PSCmdlet.ShouldProcess("nslimitidentifier", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nslimitidentifier -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNslimitidentifier -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNslimitidentifier: Finished" } } function Invoke-NSUnsetNslimitidentifier { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for limit Identifier resource. .PARAMETER Limitidentifier Name for a rate limit identifier. Must begin with an ASCII letter or underscore (_) character, and must consist only of ASCII alphanumeric or underscore characters. Reserved words must not be used. .PARAMETER Selectorname Name of the rate limit selector. If this argument is NULL, rate limiting will be applied on all traffic received by the virtual server or the Citrix ADC (depending on whether the limit identifier is bound to a virtual server or globally) without any filtering. .PARAMETER Threshold Maximum number of requests that are allowed in the given timeslice when requests (mode is set as REQUEST_RATE) are tracked per timeslice. When connections (mode is set as CONNECTION) are tracked, it is the total number of connections that would be let through. .PARAMETER Timeslice Time interval, in milliseconds, specified in multiples of 10, during which requests are tracked to check if they cross the threshold. This argument is needed only when the mode is set to REQUEST_RATE. .PARAMETER Mode Defines the type of traffic to be tracked. * REQUEST_RATE - Tracks requests/timeslice. * CONNECTION - Tracks active transactions. Examples 1. To permit 20 requests in 10 ms and 2 traps in 10 ms: add limitidentifier limit_req -mode request_rate -limitType smooth -timeslice 1000 -Threshold 2000 -trapsInTimeSlice 200 2. To permit 50 requests in 10 ms: set limitidentifier limit_req -mode request_rate -timeslice 1000 -Threshold 5000 -limitType smooth 3. To permit 1 request in 40 ms: set limitidentifier limit_req -mode request_rate -timeslice 2000 -Threshold 50 -limitType smooth 4. To permit 1 request in 200 ms and 1 trap in 130 ms: set limitidentifier limit_req -mode request_rate -timeslice 1000 -Threshold 5 -limitType smooth -trapsInTimeSlice 8 5. To permit 5000 requests in 1000 ms and 200 traps in 1000 ms: set limitidentifier limit_req -mode request_rate -timeslice 1000 -Threshold 5000 -limitType BURSTY. Possible values = CONNECTION, REQUEST_RATE, NONE .PARAMETER Limittype Smooth or bursty request type. * SMOOTH - When you want the permitted number of requests in a given interval of time to be spread evenly across the timeslice * BURSTY - When you want the permitted number of requests to exhaust the quota anytime within the timeslice. This argument is needed only when the mode is set to REQUEST_RATE. Possible values = BURSTY, SMOOTH .PARAMETER Maxbandwidth Maximum bandwidth permitted, in kbps. Maximum value = 4294967287 .PARAMETER Trapsintimeslice Number of traps to be sent in the timeslice configured. A value of 0 indicates that traps are disabled. Maximum value = 65535 .EXAMPLE PS C:\>Invoke-NSUnsetNslimitidentifier -limitidentifier <string> An example how to unset nslimitidentifier config Object(s). .NOTES File Name : Invoke-NSUnsetNslimitidentifier Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nslimitidentifier Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidatePattern('^(([a-zA-Z0-9]|[_])+([a-zA-Z0-9]|[_])+)$')] [string]$Limitidentifier, [Boolean]$selectorname, [Boolean]$threshold, [Boolean]$timeslice, [Boolean]$mode, [Boolean]$limittype, [Boolean]$maxbandwidth, [Boolean]$trapsintimeslice ) begin { Write-Verbose "Invoke-NSUnsetNslimitidentifier: Starting" } process { try { $payload = @{ limitidentifier = $limitidentifier } if ( $PSBoundParameters.ContainsKey('selectorname') ) { $payload.Add('selectorname', $selectorname) } if ( $PSBoundParameters.ContainsKey('threshold') ) { $payload.Add('threshold', $threshold) } if ( $PSBoundParameters.ContainsKey('timeslice') ) { $payload.Add('timeslice', $timeslice) } if ( $PSBoundParameters.ContainsKey('mode') ) { $payload.Add('mode', $mode) } if ( $PSBoundParameters.ContainsKey('limittype') ) { $payload.Add('limittype', $limittype) } if ( $PSBoundParameters.ContainsKey('maxbandwidth') ) { $payload.Add('maxbandwidth', $maxbandwidth) } if ( $PSBoundParameters.ContainsKey('trapsintimeslice') ) { $payload.Add('trapsintimeslice', $trapsintimeslice) } if ( $PSCmdlet.ShouldProcess("$limitidentifier", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nslimitidentifier -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNslimitidentifier: Finished" } } function Invoke-NSGetNslimitidentifier { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for limit Identifier resource. .PARAMETER Limitidentifier Name for a rate limit identifier. Must begin with an ASCII letter or underscore (_) character, and must consist only of ASCII alphanumeric or underscore characters. Reserved words must not be used. .PARAMETER GetAll Retrieve all nslimitidentifier object(s). .PARAMETER Count If specified, the count of the nslimitidentifier object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNslimitidentifier Get data. .EXAMPLE PS C:\>Invoke-NSGetNslimitidentifier -GetAll Get all nslimitidentifier data. .EXAMPLE PS C:\>Invoke-NSGetNslimitidentifier -Count Get the number of nslimitidentifier objects. .EXAMPLE PS C:\>Invoke-NSGetNslimitidentifier -name <string> Get nslimitidentifier object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNslimitidentifier -Filter @{ 'name'='<value>' } Get nslimitidentifier data with a filter. .NOTES File Name : Invoke-NSGetNslimitidentifier Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nslimitidentifier/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidatePattern('^(([a-zA-Z0-9]|[_])+([a-zA-Z0-9]|[_])+)$')] [string]$Limitidentifier, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNslimitidentifier: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nslimitidentifier objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslimitidentifier -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nslimitidentifier objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslimitidentifier -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nslimitidentifier objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslimitidentifier -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nslimitidentifier configuration for property 'limitidentifier'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslimitidentifier -NitroPath nitro/v1/config -Resource $limitidentifier -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nslimitidentifier configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslimitidentifier -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNslimitidentifier: Ended" } } function Invoke-NSGetNslimitidentifierBinding { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Binding object which returns the resources bound to nslimitidentifier. .PARAMETER Limitidentifier Name of the rate limit identifier about which to display information. If a name is not provided, information about all rate limit identifiers is shown. .PARAMETER GetAll Retrieve all nslimitidentifier_binding object(s). .PARAMETER Count If specified, the count of the nslimitidentifier_binding object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNslimitidentifierBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetNslimitidentifierBinding -GetAll Get all nslimitidentifier_binding data. .EXAMPLE PS C:\>Invoke-NSGetNslimitidentifierBinding -name <string> Get nslimitidentifier_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNslimitidentifierBinding -Filter @{ 'name'='<value>' } Get nslimitidentifier_binding data with a filter. .NOTES File Name : Invoke-NSGetNslimitidentifierBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nslimitidentifier_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [string]$Limitidentifier, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNslimitidentifierBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all nslimitidentifier_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslimitidentifier_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nslimitidentifier_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslimitidentifier_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nslimitidentifier_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslimitidentifier_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nslimitidentifier_binding configuration for property 'limitidentifier'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslimitidentifier_binding -NitroPath nitro/v1/config -Resource $limitidentifier -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nslimitidentifier_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslimitidentifier_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNslimitidentifierBinding: Ended" } } function Invoke-NSGetNslimitidentifierNslimitsessionsBinding { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Binding object showing the nslimitsessions that can be bound to nslimitidentifier. .PARAMETER Limitidentifier Name of the rate limit identifier about which to display information. If a name is not provided, information about all rate limit identifiers is shown. .PARAMETER GetAll Retrieve all nslimitidentifier_nslimitsessions_binding object(s). .PARAMETER Count If specified, the count of the nslimitidentifier_nslimitsessions_binding object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNslimitidentifierNslimitsessionsBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetNslimitidentifierNslimitsessionsBinding -GetAll Get all nslimitidentifier_nslimitsessions_binding data. .EXAMPLE PS C:\>Invoke-NSGetNslimitidentifierNslimitsessionsBinding -Count Get the number of nslimitidentifier_nslimitsessions_binding objects. .EXAMPLE PS C:\>Invoke-NSGetNslimitidentifierNslimitsessionsBinding -name <string> Get nslimitidentifier_nslimitsessions_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNslimitidentifierNslimitsessionsBinding -Filter @{ 'name'='<value>' } Get nslimitidentifier_nslimitsessions_binding data with a filter. .NOTES File Name : Invoke-NSGetNslimitidentifierNslimitsessionsBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nslimitidentifier_nslimitsessions_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [string]$Limitidentifier, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNslimitidentifierNslimitsessionsBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all nslimitidentifier_nslimitsessions_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslimitidentifier_nslimitsessions_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nslimitidentifier_nslimitsessions_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslimitidentifier_nslimitsessions_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nslimitidentifier_nslimitsessions_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslimitidentifier_nslimitsessions_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nslimitidentifier_nslimitsessions_binding configuration for property 'limitidentifier'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslimitidentifier_nslimitsessions_binding -NitroPath nitro/v1/config -Resource $limitidentifier -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nslimitidentifier_nslimitsessions_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslimitidentifier_nslimitsessions_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNslimitidentifierNslimitsessionsBinding: Ended" } } function Invoke-NSAddNslimitselector { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Configuration for limit selector resource. .PARAMETER Selectorname . .PARAMETER Rule . .PARAMETER PassThru Return details about the created nslimitselector item. .EXAMPLE PS C:\>Invoke-NSAddNslimitselector -selectorname <string> An example how to add nslimitselector config Object(s). .NOTES File Name : Invoke-NSAddNslimitselector Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nslimitselector/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Selectorname, [ValidateScript({ $_.Length -gt 1 })] [string[]]$Rule, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNslimitselector: Starting" } process { try { $payload = @{ selectorname = $selectorname } if ( $PSBoundParameters.ContainsKey('rule') ) { $payload.Add('rule', $rule) } if ( $PSCmdlet.ShouldProcess("nslimitselector", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nslimitselector -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNslimitselector -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNslimitselector: Finished" } } function Invoke-NSDeleteNslimitselector { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Configuration for limit selector resource. .PARAMETER Selectorname . .EXAMPLE PS C:\>Invoke-NSDeleteNslimitselector -Selectorname <string> An example how to delete nslimitselector config Object(s). .NOTES File Name : Invoke-NSDeleteNslimitselector Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nslimitselector/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Selectorname ) begin { Write-Verbose "Invoke-NSDeleteNslimitselector: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$selectorname", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nslimitselector -NitroPath nitro/v1/config -Resource $selectorname -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNslimitselector: Finished" } } function Invoke-NSUpdateNslimitselector { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for limit selector resource. .PARAMETER Selectorname . .PARAMETER Rule . .PARAMETER PassThru Return details about the created nslimitselector item. .EXAMPLE PS C:\>Invoke-NSUpdateNslimitselector -selectorname <string> An example how to update nslimitselector config Object(s). .NOTES File Name : Invoke-NSUpdateNslimitselector Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nslimitselector/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Selectorname, [ValidateScript({ $_.Length -gt 1 })] [string[]]$Rule, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateNslimitselector: Starting" } process { try { $payload = @{ selectorname = $selectorname } if ( $PSBoundParameters.ContainsKey('rule') ) { $payload.Add('rule', $rule) } if ( $PSCmdlet.ShouldProcess("nslimitselector", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nslimitselector -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNslimitselector -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNslimitselector: Finished" } } function Invoke-NSUnsetNslimitselector { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for limit selector resource. .PARAMETER Selectorname . .PARAMETER Rule . .EXAMPLE PS C:\>Invoke-NSUnsetNslimitselector -selectorname <string> An example how to unset nslimitselector config Object(s). .NOTES File Name : Invoke-NSUnsetNslimitselector Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nslimitselector Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [string]$Selectorname, [Boolean]$rule ) begin { Write-Verbose "Invoke-NSUnsetNslimitselector: Starting" } process { try { $payload = @{ selectorname = $selectorname } if ( $PSBoundParameters.ContainsKey('rule') ) { $payload.Add('rule', $rule) } if ( $PSCmdlet.ShouldProcess("$selectorname", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nslimitselector -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNslimitselector: Finished" } } function Invoke-NSGetNslimitselector { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for limit selector resource. .PARAMETER Selectorname . .PARAMETER GetAll Retrieve all nslimitselector object(s). .PARAMETER Count If specified, the count of the nslimitselector object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNslimitselector Get data. .EXAMPLE PS C:\>Invoke-NSGetNslimitselector -GetAll Get all nslimitselector data. .EXAMPLE PS C:\>Invoke-NSGetNslimitselector -Count Get the number of nslimitselector objects. .EXAMPLE PS C:\>Invoke-NSGetNslimitselector -name <string> Get nslimitselector object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNslimitselector -Filter @{ 'name'='<value>' } Get nslimitselector data with a filter. .NOTES File Name : Invoke-NSGetNslimitselector Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nslimitselector/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [string]$Selectorname, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNslimitselector: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nslimitselector objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslimitselector -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nslimitselector objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslimitselector -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nslimitselector objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslimitselector -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nslimitselector configuration for property 'selectorname'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslimitselector -NitroPath nitro/v1/config -Resource $selectorname -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nslimitselector configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslimitselector -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNslimitselector: Ended" } } function Invoke-NSClearNslimitsessions { <# .SYNOPSIS Clear System/Global level configuration. config Object. .DESCRIPTION Configuration for limit sessions resource. .PARAMETER Limitidentifier Name of the rate limit identifier for which to display the sessions. .EXAMPLE PS C:\>Invoke-NSClearNslimitsessions -limitidentifier <string> An example how to clear nslimitsessions config Object(s). .NOTES File Name : Invoke-NSClearNslimitsessions Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nslimitsessions/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Limitidentifier ) begin { Write-Verbose "Invoke-NSClearNslimitsessions: Starting" } process { try { $payload = @{ limitidentifier = $limitidentifier } if ( $PSCmdlet.ShouldProcess($Name, "Clear System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nslimitsessions -Action clear -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSClearNslimitsessions: Finished" } } function Invoke-NSGetNslimitsessions { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for limit sessions resource. .PARAMETER Limitidentifier Name of the rate limit identifier for which to display the sessions. .PARAMETER Detail Show the individual hash values. .PARAMETER GetAll Retrieve all nslimitsessions object(s). .PARAMETER Count If specified, the count of the nslimitsessions object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNslimitsessions Get data. .EXAMPLE PS C:\>Invoke-NSGetNslimitsessions -GetAll Get all nslimitsessions data. .EXAMPLE PS C:\>Invoke-NSGetNslimitsessions -Count Get the number of nslimitsessions objects. .EXAMPLE PS C:\>Invoke-NSGetNslimitsessions -name <string> Get nslimitsessions object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNslimitsessions -Filter @{ 'name'='<value>' } Get nslimitsessions data with a filter. .NOTES File Name : Invoke-NSGetNslimitsessions Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nslimitsessions/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByArgument')] [ValidateScript({ $_.Length -gt 1 })] [string]$Limitidentifier, [Parameter(ParameterSetName = 'GetByArgument')] [boolean]$Detail, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNslimitsessions: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nslimitsessions objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslimitsessions -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nslimitsessions objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslimitsessions -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nslimitsessions objects by arguments" $arguments = @{ } if ( $PSBoundParameters.ContainsKey('limitidentifier') ) { $arguments.Add('limitidentifier', $limitidentifier) } if ( $PSBoundParameters.ContainsKey('detail') ) { $arguments.Add('detail', $detail) } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslimitsessions -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nslimitsessions configuration for property ''" } else { Write-Verbose "Retrieving nslimitsessions configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nslimitsessions -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNslimitsessions: Ended" } } function Invoke-NSGetNsmigration { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for Migration operation resource. .PARAMETER Dumpsession Displays the current active migrated session details, if DUMPSESSION option is YES. Possible values = YES, NO .PARAMETER GetAll Retrieve all nsmigration object(s). .PARAMETER Count If specified, the count of the nsmigration object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsmigration Get data. .EXAMPLE PS C:\>Invoke-NSGetNsmigration -GetAll Get all nsmigration data. .EXAMPLE PS C:\>Invoke-NSGetNsmigration -Count Get the number of nsmigration objects. .EXAMPLE PS C:\>Invoke-NSGetNsmigration -name <string> Get nsmigration object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsmigration -Filter @{ 'name'='<value>' } Get nsmigration data with a filter. .NOTES File Name : Invoke-NSGetNsmigration Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsmigration/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByArgument')] [ValidateSet('YES', 'NO')] [string]$Dumpsession, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNsmigration: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsmigration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsmigration -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsmigration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsmigration -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsmigration objects by arguments" $arguments = @{ } if ( $PSBoundParameters.ContainsKey('dumpsession') ) { $arguments.Add('dumpsession', $dumpsession) } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsmigration -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsmigration configuration for property ''" } else { Write-Verbose "Retrieving nsmigration configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsmigration -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsmigration: Ended" } } function Invoke-NSEnableNsmode { <# .SYNOPSIS Enable System/Global level configuration. config Object. .DESCRIPTION Configuration for ns mode resource. .PARAMETER Mode Mode to be enabled. Multiple modes can be specified by providing a blank space between each mode. Possible values = FR, FastRamp, L2, L2mode, L3, L3mode, USIP, UseSourceIP, CKA, ClientKeepAlive, TCPB, TCPBuffering, MBF, MACbasedforwarding, Edge, USNIP, SRADV, DRADV, IRADV, SRADV6, DRADV6, PMTUD, RISE_APBR, RISE_RHI, BridgeBPDUs, ULFD .EXAMPLE PS C:\>Invoke-NSEnableNsmode An example how to enable nsmode config Object(s). .NOTES File Name : Invoke-NSEnableNsmode Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsmode/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateSet('FR', 'FastRamp', 'L2', 'L2mode', 'L3', 'L3mode', 'USIP', 'UseSourceIP', 'CKA', 'ClientKeepAlive', 'TCPB', 'TCPBuffering', 'MBF', 'MACbasedforwarding', 'Edge', 'USNIP', 'SRADV', 'DRADV', 'IRADV', 'SRADV6', 'DRADV6', 'PMTUD', 'RISE_APBR', 'RISE_RHI', 'BridgeBPDUs', 'ULFD')] [string[]]$Mode ) begin { Write-Verbose "Invoke-NSEnableNsmode: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('mode') ) { $payload.Add('mode', $mode) } if ( $PSCmdlet.ShouldProcess($Name, "Enable System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsmode -Action enable -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSEnableNsmode: Finished" } } function Invoke-NSDisableNsmode { <# .SYNOPSIS Disable System/Global level configuration. config Object. .DESCRIPTION Configuration for ns mode resource. .PARAMETER Mode Mode to be enabled. Multiple modes can be specified by providing a blank space between each mode. Possible values = FR, FastRamp, L2, L2mode, L3, L3mode, USIP, UseSourceIP, CKA, ClientKeepAlive, TCPB, TCPBuffering, MBF, MACbasedforwarding, Edge, USNIP, SRADV, DRADV, IRADV, SRADV6, DRADV6, PMTUD, RISE_APBR, RISE_RHI, BridgeBPDUs, ULFD .EXAMPLE PS C:\>Invoke-NSDisableNsmode An example how to disable nsmode config Object(s). .NOTES File Name : Invoke-NSDisableNsmode Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsmode/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateSet('FR', 'FastRamp', 'L2', 'L2mode', 'L3', 'L3mode', 'USIP', 'UseSourceIP', 'CKA', 'ClientKeepAlive', 'TCPB', 'TCPBuffering', 'MBF', 'MACbasedforwarding', 'Edge', 'USNIP', 'SRADV', 'DRADV', 'IRADV', 'SRADV6', 'DRADV6', 'PMTUD', 'RISE_APBR', 'RISE_RHI', 'BridgeBPDUs', 'ULFD')] [string[]]$Mode ) begin { Write-Verbose "Invoke-NSDisableNsmode: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('mode') ) { $payload.Add('mode', $mode) } if ( $PSCmdlet.ShouldProcess($Name, "Disable System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsmode -Action disable -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDisableNsmode: Finished" } } function Invoke-NSGetNsmode { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for ns mode resource. .PARAMETER GetAll Retrieve all nsmode object(s). .PARAMETER Count If specified, the count of the nsmode object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsmode Get data. .EXAMPLE PS C:\>Invoke-NSGetNsmode -GetAll Get all nsmode data. .EXAMPLE PS C:\>Invoke-NSGetNsmode -name <string> Get nsmode object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsmode -Filter @{ 'name'='<value>' } Get nsmode data with a filter. .NOTES File Name : Invoke-NSGetNsmode Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsmode/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNsmode: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsmode objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsmode -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsmode objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsmode -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsmode objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsmode -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsmode configuration for property ''" } else { Write-Verbose "Retrieving nsmode configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsmode -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsmode: Ended" } } function Invoke-NSUpdateNsparam { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for Citrix ADC parameters resource. .PARAMETER Httpport HTTP ports on the web server. This allows the system to perform connection off-load for any client request that has a destination port matching one of these configured ports. Maximum value = 65535 .PARAMETER Maxconn Maximum number of connections that will be made from the appliance to the web server(s) attached to it. The value entered here is applied globally to all attached servers. Maximum value = 4294967294 .PARAMETER Maxreq Maximum number of requests that the system can pass on a particular connection between the appliance and a server attached to it. Setting this value to 0 allows an unlimited number of requests to be passed. This value is overridden by the maximum number of requests configured on the individual service. Maximum value = 65535 .PARAMETER Cip Enable or disable the insertion of the actual client IP address into the HTTP header request passed from the client to one, some, or all servers attached to the system. The passed address can then be accessed through a minor modification to the server. * If the CIP header is specified, it will be used as the client IP header. * If the CIP header is not specified, the value that has been set will be used as the client IP header. Possible values = ENABLED, DISABLED .PARAMETER Cipheader Text that will be used as the client IP address header. .PARAMETER Cookieversion Version of the cookie inserted by the system. Possible values = 0, 1 .PARAMETER Securecookie Enable or disable secure flag for persistence cookie. Possible values = ENABLED, DISABLED .PARAMETER Pmtumin Minimum path MTU value that Citrix ADC will process in the ICMP fragmentation needed message. If the ICMP message contains a value less than this value, then this value is used instead. Maximum value = 1500 .PARAMETER Pmtutimeout Interval, in minutes, for flushing the PMTU entries. Maximum value = 1440 .PARAMETER Ftpportrange Minimum and maximum port (port range) that FTP services are allowed to use. .PARAMETER Crportrange Port range for cache redirection services. .PARAMETER Timezone Time zone for the Citrix ADC. Name of the time zone should be specified as argument. .PARAMETER Grantquotamaxclient Percentage of shared quota to be granted at a time for maxClient. Maximum value = 100 .PARAMETER Exclusivequotamaxclient Percentage of maxClient to be given to PEs. Maximum value = 100 .PARAMETER Grantquotaspillover Percentage of shared quota to be granted at a time for spillover. Maximum value = 100 .PARAMETER Exclusivequotaspillover Percentage of maximum limit to be given to PEs. Maximum value = 100 .PARAMETER Useproxyport Enable/Disable use_proxy_port setting. Possible values = ENABLED, DISABLED .PARAMETER Internaluserlogin Enables/disables the internal user from logging in to the appliance. Before disabling internal user login, you must have key-based authentication set up on the appliance. The file name for the key pair must be "ns_comm_key". Possible values = ENABLED, DISABLED .PARAMETER Aftpallowrandomsourceport Allow the FTP server to come from a random source port for active FTP data connections. Possible values = ENABLED, DISABLED .PARAMETER Icaports The ICA ports on the Web server. This allows the system to perform connection off-load for any client request that has a destination port matching one of these configured ports. .PARAMETER Tcpcip Enable or disable the insertion of the client TCP/IP header in TCP payload passed from the client to one, some, or all servers attached to the system. The passed address can then be accessed through a minor modification to the server. Possible values = ENABLED, DISABLED .PARAMETER Servicepathingressvlan VLAN on which the subscriber traffic arrives on the appliance. .PARAMETER Secureicaports The Secure ICA ports on the Web server. This allows the system to perform connection off-load for any client request that has a destination port matching one of these configured ports. .PARAMETER Mgmthttpport This allow the configuration of management HTTP port. Maximum value = 65534 .PARAMETER Mgmthttpsport This allows the configuration of management HTTPS port. Maximum value = 65534 .PARAMETER Proxyprotocol Disable/Enable v1 or v2 proxy protocol header for client info insertion. Possible values = ENABLED, DISABLED .PARAMETER Advancedanalyticsstats Disable/Enable advanace analytics stats. Possible values = ENABLED, DISABLED .PARAMETER Ipttl Set the IP Time to Live (TTL) and Hop Limit value for all outgoing packets from Citrix ADC. Maximum value = 255 .EXAMPLE PS C:\>Invoke-NSUpdateNsparam An example how to update nsparam config Object(s). .NOTES File Name : Invoke-NSUpdateNsparam Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsparam/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [int[]]$Httpport, [double]$Maxconn, [double]$Maxreq, [ValidateSet('ENABLED', 'DISABLED')] [string]$Cip, [ValidateScript({ $_.Length -gt 1 })] [string]$Cipheader, [ValidateSet('0', '1')] [string]$Cookieversion, [ValidateSet('ENABLED', 'DISABLED')] [string]$Securecookie, [double]$Pmtumin, [double]$Pmtutimeout, [ValidateLength(1024, 64000)] [string]$Ftpportrange, [ValidateLength(1, 65535)] [string]$Crportrange, [ValidateLength(1, 63)] [string]$Timezone, [double]$Grantquotamaxclient, [double]$Exclusivequotamaxclient, [double]$Grantquotaspillover, [double]$Exclusivequotaspillover, [ValidateSet('ENABLED', 'DISABLED')] [string]$Useproxyport, [ValidateSet('ENABLED', 'DISABLED')] [string]$Internaluserlogin, [ValidateSet('ENABLED', 'DISABLED')] [string]$Aftpallowrandomsourceport, [int[]]$Icaports, [ValidateSet('ENABLED', 'DISABLED')] [string]$Tcpcip, [double]$Servicepathingressvlan, [int[]]$Secureicaports, [int]$Mgmthttpport, [int]$Mgmthttpsport, [ValidateSet('ENABLED', 'DISABLED')] [string]$Proxyprotocol, [ValidateSet('ENABLED', 'DISABLED')] [string]$Advancedanalyticsstats, [double]$Ipttl ) begin { Write-Verbose "Invoke-NSUpdateNsparam: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('httpport') ) { $payload.Add('httpport', $httpport) } if ( $PSBoundParameters.ContainsKey('maxconn') ) { $payload.Add('maxconn', $maxconn) } if ( $PSBoundParameters.ContainsKey('maxreq') ) { $payload.Add('maxreq', $maxreq) } if ( $PSBoundParameters.ContainsKey('cip') ) { $payload.Add('cip', $cip) } if ( $PSBoundParameters.ContainsKey('cipheader') ) { $payload.Add('cipheader', $cipheader) } if ( $PSBoundParameters.ContainsKey('cookieversion') ) { $payload.Add('cookieversion', $cookieversion) } if ( $PSBoundParameters.ContainsKey('securecookie') ) { $payload.Add('securecookie', $securecookie) } if ( $PSBoundParameters.ContainsKey('pmtumin') ) { $payload.Add('pmtumin', $pmtumin) } if ( $PSBoundParameters.ContainsKey('pmtutimeout') ) { $payload.Add('pmtutimeout', $pmtutimeout) } if ( $PSBoundParameters.ContainsKey('ftpportrange') ) { $payload.Add('ftpportrange', $ftpportrange) } if ( $PSBoundParameters.ContainsKey('crportrange') ) { $payload.Add('crportrange', $crportrange) } if ( $PSBoundParameters.ContainsKey('timezone') ) { $payload.Add('timezone', $timezone) } if ( $PSBoundParameters.ContainsKey('grantquotamaxclient') ) { $payload.Add('grantquotamaxclient', $grantquotamaxclient) } if ( $PSBoundParameters.ContainsKey('exclusivequotamaxclient') ) { $payload.Add('exclusivequotamaxclient', $exclusivequotamaxclient) } if ( $PSBoundParameters.ContainsKey('grantquotaspillover') ) { $payload.Add('grantquotaspillover', $grantquotaspillover) } if ( $PSBoundParameters.ContainsKey('exclusivequotaspillover') ) { $payload.Add('exclusivequotaspillover', $exclusivequotaspillover) } if ( $PSBoundParameters.ContainsKey('useproxyport') ) { $payload.Add('useproxyport', $useproxyport) } if ( $PSBoundParameters.ContainsKey('internaluserlogin') ) { $payload.Add('internaluserlogin', $internaluserlogin) } if ( $PSBoundParameters.ContainsKey('aftpallowrandomsourceport') ) { $payload.Add('aftpallowrandomsourceport', $aftpallowrandomsourceport) } if ( $PSBoundParameters.ContainsKey('icaports') ) { $payload.Add('icaports', $icaports) } if ( $PSBoundParameters.ContainsKey('tcpcip') ) { $payload.Add('tcpcip', $tcpcip) } if ( $PSBoundParameters.ContainsKey('servicepathingressvlan') ) { $payload.Add('servicepathingressvlan', $servicepathingressvlan) } if ( $PSBoundParameters.ContainsKey('secureicaports') ) { $payload.Add('secureicaports', $secureicaports) } if ( $PSBoundParameters.ContainsKey('mgmthttpport') ) { $payload.Add('mgmthttpport', $mgmthttpport) } if ( $PSBoundParameters.ContainsKey('mgmthttpsport') ) { $payload.Add('mgmthttpsport', $mgmthttpsport) } if ( $PSBoundParameters.ContainsKey('proxyprotocol') ) { $payload.Add('proxyprotocol', $proxyprotocol) } if ( $PSBoundParameters.ContainsKey('advancedanalyticsstats') ) { $payload.Add('advancedanalyticsstats', $advancedanalyticsstats) } if ( $PSBoundParameters.ContainsKey('ipttl') ) { $payload.Add('ipttl', $ipttl) } if ( $PSCmdlet.ShouldProcess("nsparam", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nsparam -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNsparam: Finished" } } function Invoke-NSUnsetNsparam { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for Citrix ADC parameters resource. .PARAMETER Ftpportrange Minimum and maximum port (port range) that FTP services are allowed to use. .PARAMETER Crportrange Port range for cache redirection services. .PARAMETER Aftpallowrandomsourceport Allow the FTP server to come from a random source port for active FTP data connections. Possible values = ENABLED, DISABLED .PARAMETER Httpport HTTP ports on the web server. This allows the system to perform connection off-load for any client request that has a destination port matching one of these configured ports. Maximum value = 65535 .PARAMETER Maxconn Maximum number of connections that will be made from the appliance to the web server(s) attached to it. The value entered here is applied globally to all attached servers. Maximum value = 4294967294 .PARAMETER Maxreq Maximum number of requests that the system can pass on a particular connection between the appliance and a server attached to it. Setting this value to 0 allows an unlimited number of requests to be passed. This value is overridden by the maximum number of requests configured on the individual service. Maximum value = 65535 .PARAMETER Cip Enable or disable the insertion of the actual client IP address into the HTTP header request passed from the client to one, some, or all servers attached to the system. The passed address can then be accessed through a minor modification to the server. * If the CIP header is specified, it will be used as the client IP header. * If the CIP header is not specified, the value that has been set will be used as the client IP header. Possible values = ENABLED, DISABLED .PARAMETER Cipheader Text that will be used as the client IP address header. .PARAMETER Cookieversion Version of the cookie inserted by the system. Possible values = 0, 1 .PARAMETER Securecookie Enable or disable secure flag for persistence cookie. Possible values = ENABLED, DISABLED .PARAMETER Pmtumin Minimum path MTU value that Citrix ADC will process in the ICMP fragmentation needed message. If the ICMP message contains a value less than this value, then this value is used instead. Maximum value = 1500 .PARAMETER Pmtutimeout Interval, in minutes, for flushing the PMTU entries. Maximum value = 1440 .PARAMETER Timezone Time zone for the Citrix ADC. Name of the time zone should be specified as argument. .PARAMETER Grantquotamaxclient Percentage of shared quota to be granted at a time for maxClient. Maximum value = 100 .PARAMETER Exclusivequotamaxclient Percentage of maxClient to be given to PEs. Maximum value = 100 .PARAMETER Grantquotaspillover Percentage of shared quota to be granted at a time for spillover. Maximum value = 100 .PARAMETER Exclusivequotaspillover Percentage of maximum limit to be given to PEs. Maximum value = 100 .PARAMETER Useproxyport Enable/Disable use_proxy_port setting. Possible values = ENABLED, DISABLED .PARAMETER Internaluserlogin Enables/disables the internal user from logging in to the appliance. Before disabling internal user login, you must have key-based authentication set up on the appliance. The file name for the key pair must be "ns_comm_key". Possible values = ENABLED, DISABLED .PARAMETER Icaports The ICA ports on the Web server. This allows the system to perform connection off-load for any client request that has a destination port matching one of these configured ports. .PARAMETER Tcpcip Enable or disable the insertion of the client TCP/IP header in TCP payload passed from the client to one, some, or all servers attached to the system. The passed address can then be accessed through a minor modification to the server. Possible values = ENABLED, DISABLED .PARAMETER Servicepathingressvlan VLAN on which the subscriber traffic arrives on the appliance. .PARAMETER Secureicaports The Secure ICA ports on the Web server. This allows the system to perform connection off-load for any client request that has a destination port matching one of these configured ports. .PARAMETER Mgmthttpport This allow the configuration of management HTTP port. Maximum value = 65534 .PARAMETER Mgmthttpsport This allows the configuration of management HTTPS port. Maximum value = 65534 .PARAMETER Proxyprotocol Disable/Enable v1 or v2 proxy protocol header for client info insertion. Possible values = ENABLED, DISABLED .PARAMETER Advancedanalyticsstats Disable/Enable advanace analytics stats. Possible values = ENABLED, DISABLED .PARAMETER Ipttl Set the IP Time to Live (TTL) and Hop Limit value for all outgoing packets from Citrix ADC. Maximum value = 255 .EXAMPLE PS C:\>Invoke-NSUnsetNsparam An example how to unset nsparam config Object(s). .NOTES File Name : Invoke-NSUnsetNsparam Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsparam Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Boolean]$ftpportrange, [Boolean]$crportrange, [Boolean]$aftpallowrandomsourceport, [Boolean]$httpport, [Boolean]$maxconn, [Boolean]$maxreq, [Boolean]$cip, [Boolean]$cipheader, [Boolean]$cookieversion, [Boolean]$securecookie, [Boolean]$pmtumin, [Boolean]$pmtutimeout, [Boolean]$timezone, [Boolean]$grantquotamaxclient, [Boolean]$exclusivequotamaxclient, [Boolean]$grantquotaspillover, [Boolean]$exclusivequotaspillover, [Boolean]$useproxyport, [Boolean]$internaluserlogin, [Boolean]$icaports, [Boolean]$tcpcip, [Boolean]$servicepathingressvlan, [Boolean]$secureicaports, [Boolean]$mgmthttpport, [Boolean]$mgmthttpsport, [Boolean]$proxyprotocol, [Boolean]$advancedanalyticsstats, [Boolean]$ipttl ) begin { Write-Verbose "Invoke-NSUnsetNsparam: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('ftpportrange') ) { $payload.Add('ftpportrange', $ftpportrange) } if ( $PSBoundParameters.ContainsKey('crportrange') ) { $payload.Add('crportrange', $crportrange) } if ( $PSBoundParameters.ContainsKey('aftpallowrandomsourceport') ) { $payload.Add('aftpallowrandomsourceport', $aftpallowrandomsourceport) } if ( $PSBoundParameters.ContainsKey('httpport') ) { $payload.Add('httpport', $httpport) } if ( $PSBoundParameters.ContainsKey('maxconn') ) { $payload.Add('maxconn', $maxconn) } if ( $PSBoundParameters.ContainsKey('maxreq') ) { $payload.Add('maxreq', $maxreq) } if ( $PSBoundParameters.ContainsKey('cip') ) { $payload.Add('cip', $cip) } if ( $PSBoundParameters.ContainsKey('cipheader') ) { $payload.Add('cipheader', $cipheader) } if ( $PSBoundParameters.ContainsKey('cookieversion') ) { $payload.Add('cookieversion', $cookieversion) } if ( $PSBoundParameters.ContainsKey('securecookie') ) { $payload.Add('securecookie', $securecookie) } if ( $PSBoundParameters.ContainsKey('pmtumin') ) { $payload.Add('pmtumin', $pmtumin) } if ( $PSBoundParameters.ContainsKey('pmtutimeout') ) { $payload.Add('pmtutimeout', $pmtutimeout) } if ( $PSBoundParameters.ContainsKey('timezone') ) { $payload.Add('timezone', $timezone) } if ( $PSBoundParameters.ContainsKey('grantquotamaxclient') ) { $payload.Add('grantquotamaxclient', $grantquotamaxclient) } if ( $PSBoundParameters.ContainsKey('exclusivequotamaxclient') ) { $payload.Add('exclusivequotamaxclient', $exclusivequotamaxclient) } if ( $PSBoundParameters.ContainsKey('grantquotaspillover') ) { $payload.Add('grantquotaspillover', $grantquotaspillover) } if ( $PSBoundParameters.ContainsKey('exclusivequotaspillover') ) { $payload.Add('exclusivequotaspillover', $exclusivequotaspillover) } if ( $PSBoundParameters.ContainsKey('useproxyport') ) { $payload.Add('useproxyport', $useproxyport) } if ( $PSBoundParameters.ContainsKey('internaluserlogin') ) { $payload.Add('internaluserlogin', $internaluserlogin) } if ( $PSBoundParameters.ContainsKey('icaports') ) { $payload.Add('icaports', $icaports) } if ( $PSBoundParameters.ContainsKey('tcpcip') ) { $payload.Add('tcpcip', $tcpcip) } if ( $PSBoundParameters.ContainsKey('servicepathingressvlan') ) { $payload.Add('servicepathingressvlan', $servicepathingressvlan) } if ( $PSBoundParameters.ContainsKey('secureicaports') ) { $payload.Add('secureicaports', $secureicaports) } if ( $PSBoundParameters.ContainsKey('mgmthttpport') ) { $payload.Add('mgmthttpport', $mgmthttpport) } if ( $PSBoundParameters.ContainsKey('mgmthttpsport') ) { $payload.Add('mgmthttpsport', $mgmthttpsport) } if ( $PSBoundParameters.ContainsKey('proxyprotocol') ) { $payload.Add('proxyprotocol', $proxyprotocol) } if ( $PSBoundParameters.ContainsKey('advancedanalyticsstats') ) { $payload.Add('advancedanalyticsstats', $advancedanalyticsstats) } if ( $PSBoundParameters.ContainsKey('ipttl') ) { $payload.Add('ipttl', $ipttl) } if ( $PSCmdlet.ShouldProcess("nsparam", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nsparam -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNsparam: Finished" } } function Invoke-NSGetNsparam { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for Citrix ADC parameters resource. .PARAMETER GetAll Retrieve all nsparam object(s). .PARAMETER Count If specified, the count of the nsparam object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsparam Get data. .EXAMPLE PS C:\>Invoke-NSGetNsparam -GetAll Get all nsparam data. .EXAMPLE PS C:\>Invoke-NSGetNsparam -name <string> Get nsparam object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsparam -Filter @{ 'name'='<value>' } Get nsparam data with a filter. .NOTES File Name : Invoke-NSGetNsparam Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsparam/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNsparam: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsparam objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsparam -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsparam objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsparam -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsparam objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsparam -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsparam configuration for property ''" } else { Write-Verbose "Retrieving nsparam configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsparam -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsparam: Ended" } } function Invoke-NSAddNspartition { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Configuration for admin partition resource. .PARAMETER Partitionname Name of the Partition. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER Maxbandwidth Maximum bandwidth, in Kbps, that the partition can consume. A zero value indicates the bandwidth is unrestricted on the partition and it can consume up to the system limits. .PARAMETER Minbandwidth Minimum bandwidth, in Kbps, that the partition can consume. A zero value indicates the bandwidth is unrestricted on the partition and it can consume up to the system limits. .PARAMETER Maxconn Maximum number of concurrent connections that can be open in the partition. A zero value indicates no limit on number of open connections. .PARAMETER Maxmemlimit Maximum memory, in megabytes, allocated to the partition. A zero value indicates the memory is unlimited on the partition and it can consume up to the system limits. Maximum value = 1048576 .PARAMETER Partitionmac Special MAC address for the partition which is used for communication over shared vlans in this partition. If not specified, the MAC address is auto-generated. .PARAMETER PassThru Return details about the created nspartition item. .EXAMPLE PS C:\>Invoke-NSAddNspartition -partitionname <string> An example how to add nspartition config Object(s). .NOTES File Name : Invoke-NSAddNspartition Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspartition/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Partitionname, [double]$Maxbandwidth = '10240', [double]$Minbandwidth = '10240', [double]$Maxconn = '1024', [double]$Maxmemlimit = '10', [string]$Partitionmac, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNspartition: Starting" } process { try { $payload = @{ partitionname = $partitionname } if ( $PSBoundParameters.ContainsKey('maxbandwidth') ) { $payload.Add('maxbandwidth', $maxbandwidth) } if ( $PSBoundParameters.ContainsKey('minbandwidth') ) { $payload.Add('minbandwidth', $minbandwidth) } if ( $PSBoundParameters.ContainsKey('maxconn') ) { $payload.Add('maxconn', $maxconn) } if ( $PSBoundParameters.ContainsKey('maxmemlimit') ) { $payload.Add('maxmemlimit', $maxmemlimit) } if ( $PSBoundParameters.ContainsKey('partitionmac') ) { $payload.Add('partitionmac', $partitionmac) } if ( $PSCmdlet.ShouldProcess("nspartition", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nspartition -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNspartition -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNspartition: Finished" } } function Invoke-NSDeleteNspartition { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Configuration for admin partition resource. .PARAMETER Partitionname Name of the Partition. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .EXAMPLE PS C:\>Invoke-NSDeleteNspartition -Partitionname <string> An example how to delete nspartition config Object(s). .NOTES File Name : Invoke-NSDeleteNspartition Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspartition/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Partitionname ) begin { Write-Verbose "Invoke-NSDeleteNspartition: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$partitionname", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nspartition -NitroPath nitro/v1/config -Resource $partitionname -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNspartition: Finished" } } function Invoke-NSUpdateNspartition { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for admin partition resource. .PARAMETER Partitionname Name of the Partition. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER Maxbandwidth Maximum bandwidth, in Kbps, that the partition can consume. A zero value indicates the bandwidth is unrestricted on the partition and it can consume up to the system limits. .PARAMETER Minbandwidth Minimum bandwidth, in Kbps, that the partition can consume. A zero value indicates the bandwidth is unrestricted on the partition and it can consume up to the system limits. .PARAMETER Maxconn Maximum number of concurrent connections that can be open in the partition. A zero value indicates no limit on number of open connections. .PARAMETER Maxmemlimit Maximum memory, in megabytes, allocated to the partition. A zero value indicates the memory is unlimited on the partition and it can consume up to the system limits. Maximum value = 1048576 .PARAMETER Partitionmac Special MAC address for the partition which is used for communication over shared vlans in this partition. If not specified, the MAC address is auto-generated. .PARAMETER PassThru Return details about the created nspartition item. .EXAMPLE PS C:\>Invoke-NSUpdateNspartition -partitionname <string> An example how to update nspartition config Object(s). .NOTES File Name : Invoke-NSUpdateNspartition Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspartition/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Partitionname, [double]$Maxbandwidth, [double]$Minbandwidth, [double]$Maxconn, [double]$Maxmemlimit, [string]$Partitionmac, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateNspartition: Starting" } process { try { $payload = @{ partitionname = $partitionname } if ( $PSBoundParameters.ContainsKey('maxbandwidth') ) { $payload.Add('maxbandwidth', $maxbandwidth) } if ( $PSBoundParameters.ContainsKey('minbandwidth') ) { $payload.Add('minbandwidth', $minbandwidth) } if ( $PSBoundParameters.ContainsKey('maxconn') ) { $payload.Add('maxconn', $maxconn) } if ( $PSBoundParameters.ContainsKey('maxmemlimit') ) { $payload.Add('maxmemlimit', $maxmemlimit) } if ( $PSBoundParameters.ContainsKey('partitionmac') ) { $payload.Add('partitionmac', $partitionmac) } if ( $PSCmdlet.ShouldProcess("nspartition", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nspartition -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNspartition -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNspartition: Finished" } } function Invoke-NSUnsetNspartition { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for admin partition resource. .PARAMETER Partitionname Name of the Partition. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER Maxbandwidth Maximum bandwidth, in Kbps, that the partition can consume. A zero value indicates the bandwidth is unrestricted on the partition and it can consume up to the system limits. .PARAMETER Minbandwidth Minimum bandwidth, in Kbps, that the partition can consume. A zero value indicates the bandwidth is unrestricted on the partition and it can consume up to the system limits. .PARAMETER Maxconn Maximum number of concurrent connections that can be open in the partition. A zero value indicates no limit on number of open connections. .PARAMETER Maxmemlimit Maximum memory, in megabytes, allocated to the partition. A zero value indicates the memory is unlimited on the partition and it can consume up to the system limits. Maximum value = 1048576 .PARAMETER Partitionmac Special MAC address for the partition which is used for communication over shared vlans in this partition. If not specified, the MAC address is auto-generated. .EXAMPLE PS C:\>Invoke-NSUnsetNspartition -partitionname <string> An example how to unset nspartition config Object(s). .NOTES File Name : Invoke-NSUnsetNspartition Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspartition Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Partitionname, [Boolean]$maxbandwidth, [Boolean]$minbandwidth, [Boolean]$maxconn, [Boolean]$maxmemlimit, [Boolean]$partitionmac ) begin { Write-Verbose "Invoke-NSUnsetNspartition: Starting" } process { try { $payload = @{ partitionname = $partitionname } if ( $PSBoundParameters.ContainsKey('maxbandwidth') ) { $payload.Add('maxbandwidth', $maxbandwidth) } if ( $PSBoundParameters.ContainsKey('minbandwidth') ) { $payload.Add('minbandwidth', $minbandwidth) } if ( $PSBoundParameters.ContainsKey('maxconn') ) { $payload.Add('maxconn', $maxconn) } if ( $PSBoundParameters.ContainsKey('maxmemlimit') ) { $payload.Add('maxmemlimit', $maxmemlimit) } if ( $PSBoundParameters.ContainsKey('partitionmac') ) { $payload.Add('partitionmac', $partitionmac) } if ( $PSCmdlet.ShouldProcess("$partitionname", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nspartition -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNspartition: Finished" } } function Invoke-NSSwitchNspartition { <# .SYNOPSIS Switch System/Global level configuration. config Object. .DESCRIPTION Configuration for admin partition resource. .PARAMETER Partitionname Name of the Partition. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER Force Switches to new admin partition without prompt for saving configuration. Configuration will not be saved. .PARAMETER Save Switches to new admin partition without prompt for saving configuration. Configuration will be saved. .PARAMETER PassThru Return details about the created nspartition item. .EXAMPLE PS C:\>Invoke-NSSwitchNspartition -partitionname <string> An example how to switch nspartition config Object(s). .NOTES File Name : Invoke-NSSwitchNspartition Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspartition/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Partitionname, [boolean]$Force, [boolean]$Save, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSSwitchNspartition: Starting" } process { try { $payload = @{ partitionname = $partitionname } if ( $PSBoundParameters.ContainsKey('force') ) { $payload.Add('force', $force) } if ( $PSBoundParameters.ContainsKey('save') ) { $payload.Add('save', $save) } if ( $PSCmdlet.ShouldProcess("nspartition", "Switch System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nspartition -Action switch -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNspartition -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSSwitchNspartition: Finished" } } function Invoke-NSGetNspartition { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for admin partition resource. .PARAMETER Partitionname Name of the Partition. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER GetAll Retrieve all nspartition object(s). .PARAMETER Count If specified, the count of the nspartition object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNspartition Get data. .EXAMPLE PS C:\>Invoke-NSGetNspartition -GetAll Get all nspartition data. .EXAMPLE PS C:\>Invoke-NSGetNspartition -Count Get the number of nspartition objects. .EXAMPLE PS C:\>Invoke-NSGetNspartition -name <string> Get nspartition object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNspartition -Filter @{ 'name'='<value>' } Get nspartition data with a filter. .NOTES File Name : Invoke-NSGetNspartition Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspartition/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Partitionname, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNspartition: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nspartition objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartition -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nspartition objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartition -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nspartition objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartition -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nspartition configuration for property 'partitionname'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartition -NitroPath nitro/v1/config -Resource $partitionname -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nspartition configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartition -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNspartition: Ended" } } function Invoke-NSGetNspartitionBinding { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Binding object which returns the resources bound to nspartition. .PARAMETER Partitionname Name of partition for which to display parameters. .PARAMETER GetAll Retrieve all nspartition_binding object(s). .PARAMETER Count If specified, the count of the nspartition_binding object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNspartitionBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetNspartitionBinding -GetAll Get all nspartition_binding data. .EXAMPLE PS C:\>Invoke-NSGetNspartitionBinding -name <string> Get nspartition_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNspartitionBinding -Filter @{ 'name'='<value>' } Get nspartition_binding data with a filter. .NOTES File Name : Invoke-NSGetNspartitionBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspartition_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateScript({ $_.Length -gt 1 })] [string]$Partitionname, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNspartitionBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all nspartition_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartition_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nspartition_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartition_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nspartition_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartition_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nspartition_binding configuration for property 'partitionname'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartition_binding -NitroPath nitro/v1/config -Resource $partitionname -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nspartition_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartition_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNspartitionBinding: Ended" } } function Invoke-NSAddNspartitionBridgegroupBinding { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Binding object showing the bridgegroup that can be bound to nspartition. .PARAMETER Partitionname Name of the Partition. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER Bridgegroup Identifier of the bridge group that is assigned to this partition. Maximum value = 1000 .PARAMETER PassThru Return details about the created nspartition_bridgegroup_binding item. .EXAMPLE PS C:\>Invoke-NSAddNspartitionBridgegroupBinding -partitionname <string> An example how to add nspartition_bridgegroup_binding config Object(s). .NOTES File Name : Invoke-NSAddNspartitionBridgegroupBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspartition_bridgegroup_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Partitionname, [double]$Bridgegroup, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNspartitionBridgegroupBinding: Starting" } process { try { $payload = @{ partitionname = $partitionname } if ( $PSBoundParameters.ContainsKey('bridgegroup') ) { $payload.Add('bridgegroup', $bridgegroup) } if ( $PSCmdlet.ShouldProcess("nspartition_bridgegroup_binding", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nspartition_bridgegroup_binding -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNspartitionBridgegroupBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNspartitionBridgegroupBinding: Finished" } } function Invoke-NSDeleteNspartitionBridgegroupBinding { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Binding object showing the bridgegroup that can be bound to nspartition. .PARAMETER Partitionname Name of the Partition. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER Bridgegroup Identifier of the bridge group that is assigned to this partition. Maximum value = 1000 .EXAMPLE PS C:\>Invoke-NSDeleteNspartitionBridgegroupBinding -Partitionname <string> An example how to delete nspartition_bridgegroup_binding config Object(s). .NOTES File Name : Invoke-NSDeleteNspartitionBridgegroupBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspartition_bridgegroup_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Partitionname, [double]$Bridgegroup ) begin { Write-Verbose "Invoke-NSDeleteNspartitionBridgegroupBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Bridgegroup') ) { $arguments.Add('bridgegroup', $Bridgegroup) } if ( $PSCmdlet.ShouldProcess("$partitionname", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nspartition_bridgegroup_binding -NitroPath nitro/v1/config -Resource $partitionname -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNspartitionBridgegroupBinding: Finished" } } function Invoke-NSGetNspartitionBridgegroupBinding { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Binding object showing the bridgegroup that can be bound to nspartition. .PARAMETER Partitionname Name of the Partition. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER GetAll Retrieve all nspartition_bridgegroup_binding object(s). .PARAMETER Count If specified, the count of the nspartition_bridgegroup_binding object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNspartitionBridgegroupBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetNspartitionBridgegroupBinding -GetAll Get all nspartition_bridgegroup_binding data. .EXAMPLE PS C:\>Invoke-NSGetNspartitionBridgegroupBinding -Count Get the number of nspartition_bridgegroup_binding objects. .EXAMPLE PS C:\>Invoke-NSGetNspartitionBridgegroupBinding -name <string> Get nspartition_bridgegroup_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNspartitionBridgegroupBinding -Filter @{ 'name'='<value>' } Get nspartition_bridgegroup_binding data with a filter. .NOTES File Name : Invoke-NSGetNspartitionBridgegroupBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspartition_bridgegroup_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Partitionname, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNspartitionBridgegroupBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all nspartition_bridgegroup_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartition_bridgegroup_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nspartition_bridgegroup_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartition_bridgegroup_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nspartition_bridgegroup_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartition_bridgegroup_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nspartition_bridgegroup_binding configuration for property 'partitionname'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartition_bridgegroup_binding -NitroPath nitro/v1/config -Resource $partitionname -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nspartition_bridgegroup_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartition_bridgegroup_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNspartitionBridgegroupBinding: Ended" } } function Invoke-NSAddNspartitionVlanBinding { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Binding object showing the vlan that can be bound to nspartition. .PARAMETER Partitionname Name of the Partition. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER Vlan Identifier of the vlan that is assigned to this partition. Maximum value = 4094 .PARAMETER PassThru Return details about the created nspartition_vlan_binding item. .EXAMPLE PS C:\>Invoke-NSAddNspartitionVlanBinding -partitionname <string> An example how to add nspartition_vlan_binding config Object(s). .NOTES File Name : Invoke-NSAddNspartitionVlanBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspartition_vlan_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Partitionname, [double]$Vlan, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNspartitionVlanBinding: Starting" } process { try { $payload = @{ partitionname = $partitionname } if ( $PSBoundParameters.ContainsKey('vlan') ) { $payload.Add('vlan', $vlan) } if ( $PSCmdlet.ShouldProcess("nspartition_vlan_binding", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nspartition_vlan_binding -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNspartitionVlanBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNspartitionVlanBinding: Finished" } } function Invoke-NSDeleteNspartitionVlanBinding { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Binding object showing the vlan that can be bound to nspartition. .PARAMETER Partitionname Name of the Partition. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER Vlan Identifier of the vlan that is assigned to this partition. Maximum value = 4094 .EXAMPLE PS C:\>Invoke-NSDeleteNspartitionVlanBinding -Partitionname <string> An example how to delete nspartition_vlan_binding config Object(s). .NOTES File Name : Invoke-NSDeleteNspartitionVlanBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspartition_vlan_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Partitionname, [double]$Vlan ) begin { Write-Verbose "Invoke-NSDeleteNspartitionVlanBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Vlan') ) { $arguments.Add('vlan', $Vlan) } if ( $PSCmdlet.ShouldProcess("$partitionname", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nspartition_vlan_binding -NitroPath nitro/v1/config -Resource $partitionname -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNspartitionVlanBinding: Finished" } } function Invoke-NSGetNspartitionVlanBinding { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Binding object showing the vlan that can be bound to nspartition. .PARAMETER Partitionname Name of the Partition. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER GetAll Retrieve all nspartition_vlan_binding object(s). .PARAMETER Count If specified, the count of the nspartition_vlan_binding object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNspartitionVlanBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetNspartitionVlanBinding -GetAll Get all nspartition_vlan_binding data. .EXAMPLE PS C:\>Invoke-NSGetNspartitionVlanBinding -Count Get the number of nspartition_vlan_binding objects. .EXAMPLE PS C:\>Invoke-NSGetNspartitionVlanBinding -name <string> Get nspartition_vlan_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNspartitionVlanBinding -Filter @{ 'name'='<value>' } Get nspartition_vlan_binding data with a filter. .NOTES File Name : Invoke-NSGetNspartitionVlanBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspartition_vlan_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Partitionname, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNspartitionVlanBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all nspartition_vlan_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartition_vlan_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nspartition_vlan_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartition_vlan_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nspartition_vlan_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartition_vlan_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nspartition_vlan_binding configuration for property 'partitionname'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartition_vlan_binding -NitroPath nitro/v1/config -Resource $partitionname -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nspartition_vlan_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartition_vlan_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNspartitionVlanBinding: Ended" } } function Invoke-NSAddNspartitionVxlanBinding { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Binding object showing the vxlan that can be bound to nspartition. .PARAMETER Partitionname Name of the Partition. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER Vxlan Identifier of the vxlan that is assigned to this partition. Maximum value = 16777215 .PARAMETER PassThru Return details about the created nspartition_vxlan_binding item. .EXAMPLE PS C:\>Invoke-NSAddNspartitionVxlanBinding -partitionname <string> An example how to add nspartition_vxlan_binding config Object(s). .NOTES File Name : Invoke-NSAddNspartitionVxlanBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspartition_vxlan_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Partitionname, [double]$Vxlan, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNspartitionVxlanBinding: Starting" } process { try { $payload = @{ partitionname = $partitionname } if ( $PSBoundParameters.ContainsKey('vxlan') ) { $payload.Add('vxlan', $vxlan) } if ( $PSCmdlet.ShouldProcess("nspartition_vxlan_binding", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nspartition_vxlan_binding -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNspartitionVxlanBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNspartitionVxlanBinding: Finished" } } function Invoke-NSDeleteNspartitionVxlanBinding { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Binding object showing the vxlan that can be bound to nspartition. .PARAMETER Partitionname Name of the Partition. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER Vxlan Identifier of the vxlan that is assigned to this partition. Maximum value = 16777215 .EXAMPLE PS C:\>Invoke-NSDeleteNspartitionVxlanBinding -Partitionname <string> An example how to delete nspartition_vxlan_binding config Object(s). .NOTES File Name : Invoke-NSDeleteNspartitionVxlanBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspartition_vxlan_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Partitionname, [double]$Vxlan ) begin { Write-Verbose "Invoke-NSDeleteNspartitionVxlanBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Vxlan') ) { $arguments.Add('vxlan', $Vxlan) } if ( $PSCmdlet.ShouldProcess("$partitionname", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nspartition_vxlan_binding -NitroPath nitro/v1/config -Resource $partitionname -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNspartitionVxlanBinding: Finished" } } function Invoke-NSGetNspartitionVxlanBinding { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Binding object showing the vxlan that can be bound to nspartition. .PARAMETER Partitionname Name of the Partition. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER GetAll Retrieve all nspartition_vxlan_binding object(s). .PARAMETER Count If specified, the count of the nspartition_vxlan_binding object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNspartitionVxlanBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetNspartitionVxlanBinding -GetAll Get all nspartition_vxlan_binding data. .EXAMPLE PS C:\>Invoke-NSGetNspartitionVxlanBinding -Count Get the number of nspartition_vxlan_binding objects. .EXAMPLE PS C:\>Invoke-NSGetNspartitionVxlanBinding -name <string> Get nspartition_vxlan_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNspartitionVxlanBinding -Filter @{ 'name'='<value>' } Get nspartition_vxlan_binding data with a filter. .NOTES File Name : Invoke-NSGetNspartitionVxlanBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspartition_vxlan_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Partitionname, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNspartitionVxlanBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all nspartition_vxlan_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartition_vxlan_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nspartition_vxlan_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartition_vxlan_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nspartition_vxlan_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartition_vxlan_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nspartition_vxlan_binding configuration for property 'partitionname'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartition_vxlan_binding -NitroPath nitro/v1/config -Resource $partitionname -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nspartition_vxlan_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartition_vxlan_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNspartitionVxlanBinding: Ended" } } function Invoke-NSGetNspartitionmac { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for partition MACs resource. .PARAMETER GetAll Retrieve all nspartitionmac object(s). .PARAMETER Count If specified, the count of the nspartitionmac object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNspartitionmac Get data. .EXAMPLE PS C:\>Invoke-NSGetNspartitionmac -GetAll Get all nspartitionmac data. .EXAMPLE PS C:\>Invoke-NSGetNspartitionmac -Count Get the number of nspartitionmac objects. .EXAMPLE PS C:\>Invoke-NSGetNspartitionmac -name <string> Get nspartitionmac object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNspartitionmac -Filter @{ 'name'='<value>' } Get nspartitionmac data with a filter. .NOTES File Name : Invoke-NSGetNspartitionmac Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspartitionmac/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNspartitionmac: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nspartitionmac objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartitionmac -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nspartitionmac objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartitionmac -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nspartitionmac objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartitionmac -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nspartitionmac configuration for property ''" } else { Write-Verbose "Retrieving nspartitionmac configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspartitionmac -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNspartitionmac: Ended" } } function Invoke-NSAddNspbr { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Configuration for Policy Based Routing(PBR) entry resource. .PARAMETER Name Name for the PBR. Must begin with an ASCII alphabetic or underscore \(_\) character, and must contain only ASCII alphanumeric, underscore, hash \(\#\), period \(.\), space, colon \(:\), at \(@\), equals \(=\), and hyphen \(-\) characters. Cannot be changed after the PBR is created. .PARAMETER Action Action to perform on the outgoing IPv4 packets that match the PBR. Available settings function as follows: * ALLOW - The Citrix ADC sends the packet to the designated next-hop router. * DENY - The Citrix ADC applies the routing table for normal destination-based routing. Possible values = ALLOW, DENY .PARAMETER Td Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0. Maximum value = 4094 .PARAMETER Srcip IP address or range of IP addresses to match against the source IP address of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 10.102.29.30-10.102.29.189. .PARAMETER Srcipop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Srcipval IP address or range of IP addresses to match against the source IP address of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 10.102.29.30-10.102.29.189. .PARAMETER Srcport Port number or range of port numbers to match against the source port number of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. Note: The destination port can be specified only for TCP and UDP protocols. .PARAMETER Srcportop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Srcportval Port number or range of port numbers to match against the source port number of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. Note: The destination port can be specified only for TCP and UDP protocols. .PARAMETER Destip IP address or range of IP addresses to match against the destination IP address of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 10.102.29.30-10.102.29.189. .PARAMETER Destipop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Destipval IP address or range of IP addresses to match against the destination IP address of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 10.102.29.30-10.102.29.189. .PARAMETER Destport Port number or range of port numbers to match against the destination port number of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. Note: The destination port can be specified only for TCP and UDP protocols. .PARAMETER Destportop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Destportval Port number or range of port numbers to match against the destination port number of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. Note: The destination port can be specified only for TCP and UDP protocols. .PARAMETER Nexthop IP address of the next hop router or the name of the link load balancing virtual server to which to send matching packets if action is set to ALLOW. If you specify a link load balancing (LLB) virtual server, which can provide a backup if a next hop link fails, first make sure that the next hops bound to the LLB virtual server are actually next hops that are directly connected to the Citrix ADC. Otherwise, the Citrix ADC throws an error when you attempt to create the PBR. The next hop can be null to represent null routes. .PARAMETER Nexthopval The Next Hop IP address or gateway name. .PARAMETER Iptunnel The Tunnel name. .PARAMETER Iptunnelname The iptunnel name where packets need to be forwarded upon. .PARAMETER Vxlanvlanmap The vlan to vxlan mapping to be applied for incoming packets over this pbr tunnel. .PARAMETER Srcmac MAC address to match against the source MAC address of an outgoing IPv4 packet. .PARAMETER Srcmacmask Used to define range of Source MAC address. It takes string of 0 and 1, 0s are for exact match and 1s for wildcard. For matching first 3 bytes of MAC address, srcMacMask value "000000111111". . .PARAMETER Protocol Protocol, identified by protocol name, to match against the protocol of an outgoing IPv4 packet. Possible values = ICMP, IGMP, TCP, EGP, IGP, ARGUS, UDP, RDP, RSVP, EIGRP, L2TP, ISIS, GGP, IPoverIP, ST, CBT, BBN-RCC-M, NVP-II, PUP, EMCON, XNET, CHAOS, MUX, DCN-MEAS, HMP, PRM, XNS-IDP, TRUNK-1, TRUNK-2, LEAF-1, LEAF-2, IRTP, ISO-TP4, NETBLT, MFE-NSP, MERIT-INP, SEP, 3PC, IDPR, XTP, DDP, IDPR-CMTP, TP++, IL, IPv6, SDRP, IPv6-Route, IPv6-Frag, IDRP, GRE, MHRP, BNA, ESP, AH, I-NLSP, SWIPE, NARP, MOBILE, TLSP, SKIP, ICMPV6, IPv6-NoNx, IPv6-Opts, Any-Host-Internal-Protocol, CFTP, Any-Local-Network, SAT-EXPAK, KRYPTOLAN, RVD, IPPC, Any-Distributed-File-System, TFTP, VISA, IPCV, CPNX, CPHB, WSN, PVP, BR-SAT-MO, SUN-ND, WB-MON, WB-EXPAK, ISO-IP, VMTP, SECURE-VM, VINES, TTP, NSFNET-IG, DGP, TCF, OSPFIGP, Sprite-RP, LARP, MTP, AX.25, IPIP, MICP, SCC-SP, ETHERIP, Any-Private-Encryption-Scheme, GMTP, IFMP, PNNI, PIM, ARIS, SCPS, QNX, A/N, IPComp, SNP, Compaq-Pe, IPX-in-IP, VRRP, PGM, Any-0-Hop-Protocol, ENCAP, DDX, IATP, STP, SRP, UTI, SMP, SM, PTP, FIRE, CRTP, CRUDP, SSCOPMCE, IPLT, SPS, PIPE, SCTP, FC, RSVP-E2E-IGNORE, Mobility-Header, UDPLite .PARAMETER Protocolnumber Protocol, identified by protocol number, to match against the protocol of an outgoing IPv4 packet. Maximum value = 255 .PARAMETER Vlan ID of the VLAN. The Citrix ADC compares the PBR only to the outgoing packets on the specified VLAN. If you do not specify any interface ID, the appliance compares the PBR to the outgoing packets on all VLANs. Maximum value = 4094 .PARAMETER Vxlan ID of the VXLAN. The Citrix ADC compares the PBR only to the outgoing packets on the specified VXLAN. If you do not specify any interface ID, the appliance compares the PBR to the outgoing packets on all VXLANs. Maximum value = 16777215 .PARAMETER Interface ID of an interface. The Citrix ADC compares the PBR only to the outgoing packets on the specified interface. If you do not specify any value, the appliance compares the PBR to the outgoing packets on all interfaces. .PARAMETER Priority Priority of the PBR, which determines the order in which it is evaluated relative to the other PBRs. If you do not specify priorities while creating PBRs, the PBRs are evaluated in the order in which they are created. Maximum value = 81920 .PARAMETER Msr Monitor the route specified byte Next Hop parameter. This parameter is not applicable if you specify a link load balancing (LLB) virtual server name with the Next Hop parameter. Possible values = ENABLED, DISABLED .PARAMETER Monitor The name of the monitor.(Can be only of type ping or ARP ). .PARAMETER State Enable or disable the PBR. After you apply the PBRs, the Citrix ADC compares outgoing packets to the enabled PBRs. Possible values = ENABLED, DISABLED .PARAMETER Ownergroup The owner node group in a Cluster for this pbr rule. If ownernode is not specified then the pbr rule is treated as Striped pbr rule. .PARAMETER PassThru Return details about the created nspbr item. .EXAMPLE PS C:\>Invoke-NSAddNspbr -name <string> -action <string> An example how to add nspbr config Object(s). .NOTES File Name : Invoke-NSAddNspbr Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspbr/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [Parameter(Mandatory)] [ValidateSet('ALLOW', 'DENY')] [string]$Action, [double]$Td, [boolean]$Srcip, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Srcipop, [string]$Srcipval, [boolean]$Srcport, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Srcportop, [string]$Srcportval, [boolean]$Destip, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Destipop, [string]$Destipval, [boolean]$Destport, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Destportop, [string]$Destportval, [boolean]$Nexthop, [string]$Nexthopval, [boolean]$Iptunnel, [string]$Iptunnelname, [string]$Vxlanvlanmap, [string]$Srcmac, [string]$Srcmacmask = '"000000000000"', [ValidateSet('ICMP', 'IGMP', 'TCP', 'EGP', 'IGP', 'ARGUS', 'UDP', 'RDP', 'RSVP', 'EIGRP', 'L2TP', 'ISIS', 'GGP', 'IPoverIP', 'ST', 'CBT', 'BBN-RCC-M', 'NVP-II', 'PUP', 'EMCON', 'XNET', 'CHAOS', 'MUX', 'DCN-MEAS', 'HMP', 'PRM', 'XNS-IDP', 'TRUNK-1', 'TRUNK-2', 'LEAF-1', 'LEAF-2', 'IRTP', 'ISO-TP4', 'NETBLT', 'MFE-NSP', 'MERIT-INP', 'SEP', '3PC', 'IDPR', 'XTP', 'DDP', 'IDPR-CMTP', 'TP++', 'IL', 'IPv6', 'SDRP', 'IPv6-Route', 'IPv6-Frag', 'IDRP', 'GRE', 'MHRP', 'BNA', 'ESP', 'AH', 'I-NLSP', 'SWIPE', 'NARP', 'MOBILE', 'TLSP', 'SKIP', 'ICMPV6', 'IPv6-NoNx', 'IPv6-Opts', 'Any-Host-Internal-Protocol', 'CFTP', 'Any-Local-Network', 'SAT-EXPAK', 'KRYPTOLAN', 'RVD', 'IPPC', 'Any-Distributed-File-System', 'TFTP', 'VISA', 'IPCV', 'CPNX', 'CPHB', 'WSN', 'PVP', 'BR-SAT-MO', 'SUN-ND', 'WB-MON', 'WB-EXPAK', 'ISO-IP', 'VMTP', 'SECURE-VM', 'VINES', 'TTP', 'NSFNET-IG', 'DGP', 'TCF', 'OSPFIGP', 'Sprite-RP', 'LARP', 'MTP', 'AX.25', 'IPIP', 'MICP', 'SCC-SP', 'ETHERIP', 'Any-Private-Encryption-Scheme', 'GMTP', 'IFMP', 'PNNI', 'PIM', 'ARIS', 'SCPS', 'QNX', 'A/N', 'IPComp', 'SNP', 'Compaq-Pe', 'IPX-in-IP', 'VRRP', 'PGM', 'Any-0-Hop-Protocol', 'ENCAP', 'DDX', 'IATP', 'STP', 'SRP', 'UTI', 'SMP', 'SM', 'PTP', 'FIRE', 'CRTP', 'CRUDP', 'SSCOPMCE', 'IPLT', 'SPS', 'PIPE', 'SCTP', 'FC', 'RSVP-E2E-IGNORE', 'Mobility-Header', 'UDPLite')] [string]$Protocol, [double]$Protocolnumber, [double]$Vlan, [double]$Vxlan, [string]$Interface, [double]$Priority, [ValidateSet('ENABLED', 'DISABLED')] [string]$Msr = 'DISABLED', [ValidateScript({ $_.Length -gt 1 })] [string]$Monitor, [ValidateSet('ENABLED', 'DISABLED')] [string]$State = 'ENABLED', [ValidateScript({ $_.Length -gt 1 })] [string]$Ownergroup = 'DEFAULT_NG', [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNspbr: Starting" } process { try { $payload = @{ name = $name action = $action } if ( $PSBoundParameters.ContainsKey('td') ) { $payload.Add('td', $td) } if ( $PSBoundParameters.ContainsKey('srcip') ) { $payload.Add('srcip', $srcip) } if ( $PSBoundParameters.ContainsKey('srcipop') ) { $payload.Add('srcipop', $srcipop) } if ( $PSBoundParameters.ContainsKey('srcipval') ) { $payload.Add('srcipval', $srcipval) } if ( $PSBoundParameters.ContainsKey('srcport') ) { $payload.Add('srcport', $srcport) } if ( $PSBoundParameters.ContainsKey('srcportop') ) { $payload.Add('srcportop', $srcportop) } if ( $PSBoundParameters.ContainsKey('srcportval') ) { $payload.Add('srcportval', $srcportval) } if ( $PSBoundParameters.ContainsKey('destip') ) { $payload.Add('destip', $destip) } if ( $PSBoundParameters.ContainsKey('destipop') ) { $payload.Add('destipop', $destipop) } if ( $PSBoundParameters.ContainsKey('destipval') ) { $payload.Add('destipval', $destipval) } if ( $PSBoundParameters.ContainsKey('destport') ) { $payload.Add('destport', $destport) } if ( $PSBoundParameters.ContainsKey('destportop') ) { $payload.Add('destportop', $destportop) } if ( $PSBoundParameters.ContainsKey('destportval') ) { $payload.Add('destportval', $destportval) } if ( $PSBoundParameters.ContainsKey('nexthop') ) { $payload.Add('nexthop', $nexthop) } if ( $PSBoundParameters.ContainsKey('nexthopval') ) { $payload.Add('nexthopval', $nexthopval) } if ( $PSBoundParameters.ContainsKey('iptunnel') ) { $payload.Add('iptunnel', $iptunnel) } if ( $PSBoundParameters.ContainsKey('iptunnelname') ) { $payload.Add('iptunnelname', $iptunnelname) } if ( $PSBoundParameters.ContainsKey('vxlanvlanmap') ) { $payload.Add('vxlanvlanmap', $vxlanvlanmap) } if ( $PSBoundParameters.ContainsKey('srcmac') ) { $payload.Add('srcmac', $srcmac) } if ( $PSBoundParameters.ContainsKey('srcmacmask') ) { $payload.Add('srcmacmask', $srcmacmask) } if ( $PSBoundParameters.ContainsKey('protocol') ) { $payload.Add('protocol', $protocol) } if ( $PSBoundParameters.ContainsKey('protocolnumber') ) { $payload.Add('protocolnumber', $protocolnumber) } if ( $PSBoundParameters.ContainsKey('vlan') ) { $payload.Add('vlan', $vlan) } if ( $PSBoundParameters.ContainsKey('vxlan') ) { $payload.Add('vxlan', $vxlan) } if ( $PSBoundParameters.ContainsKey('Interface') ) { $payload.Add('Interface', $Interface) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('msr') ) { $payload.Add('msr', $msr) } if ( $PSBoundParameters.ContainsKey('monitor') ) { $payload.Add('monitor', $monitor) } if ( $PSBoundParameters.ContainsKey('state') ) { $payload.Add('state', $state) } if ( $PSBoundParameters.ContainsKey('ownergroup') ) { $payload.Add('ownergroup', $ownergroup) } if ( $PSCmdlet.ShouldProcess("nspbr", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nspbr -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNspbr -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNspbr: Finished" } } function Invoke-NSDeleteNspbr { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Configuration for Policy Based Routing(PBR) entry resource. .PARAMETER Name Name for the PBR. Must begin with an ASCII alphabetic or underscore \(_\) character, and must contain only ASCII alphanumeric, underscore, hash \(\#\), period \(.\), space, colon \(:\), at \(@\), equals \(=\), and hyphen \(-\) characters. Cannot be changed after the PBR is created. .EXAMPLE PS C:\>Invoke-NSDeleteNspbr -Name <string> An example how to delete nspbr config Object(s). .NOTES File Name : Invoke-NSDeleteNspbr Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspbr/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Name ) begin { Write-Verbose "Invoke-NSDeleteNspbr: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nspbr -NitroPath nitro/v1/config -Resource $name -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNspbr: Finished" } } function Invoke-NSUpdateNspbr { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for Policy Based Routing(PBR) entry resource. .PARAMETER Name Name for the PBR. Must begin with an ASCII alphabetic or underscore \(_\) character, and must contain only ASCII alphanumeric, underscore, hash \(\#\), period \(.\), space, colon \(:\), at \(@\), equals \(=\), and hyphen \(-\) characters. Cannot be changed after the PBR is created. .PARAMETER Action Action to perform on the outgoing IPv4 packets that match the PBR. Available settings function as follows: * ALLOW - The Citrix ADC sends the packet to the designated next-hop router. * DENY - The Citrix ADC applies the routing table for normal destination-based routing. Possible values = ALLOW, DENY .PARAMETER Srcip IP address or range of IP addresses to match against the source IP address of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 10.102.29.30-10.102.29.189. .PARAMETER Srcipop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Srcipval IP address or range of IP addresses to match against the source IP address of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 10.102.29.30-10.102.29.189. .PARAMETER Srcport Port number or range of port numbers to match against the source port number of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. Note: The destination port can be specified only for TCP and UDP protocols. .PARAMETER Srcportop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Srcportval Port number or range of port numbers to match against the source port number of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. Note: The destination port can be specified only for TCP and UDP protocols. .PARAMETER Destip IP address or range of IP addresses to match against the destination IP address of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 10.102.29.30-10.102.29.189. .PARAMETER Destipop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Destipval IP address or range of IP addresses to match against the destination IP address of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 10.102.29.30-10.102.29.189. .PARAMETER Destport Port number or range of port numbers to match against the destination port number of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. Note: The destination port can be specified only for TCP and UDP protocols. .PARAMETER Destportop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Destportval Port number or range of port numbers to match against the destination port number of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. Note: The destination port can be specified only for TCP and UDP protocols. .PARAMETER Nexthop IP address of the next hop router or the name of the link load balancing virtual server to which to send matching packets if action is set to ALLOW. If you specify a link load balancing (LLB) virtual server, which can provide a backup if a next hop link fails, first make sure that the next hops bound to the LLB virtual server are actually next hops that are directly connected to the Citrix ADC. Otherwise, the Citrix ADC throws an error when you attempt to create the PBR. The next hop can be null to represent null routes. .PARAMETER Nexthopval The Next Hop IP address or gateway name. .PARAMETER Iptunnel The Tunnel name. .PARAMETER Iptunnelname The iptunnel name where packets need to be forwarded upon. .PARAMETER Vxlanvlanmap The vlan to vxlan mapping to be applied for incoming packets over this pbr tunnel. .PARAMETER Srcmac MAC address to match against the source MAC address of an outgoing IPv4 packet. .PARAMETER Srcmacmask Used to define range of Source MAC address. It takes string of 0 and 1, 0s are for exact match and 1s for wildcard. For matching first 3 bytes of MAC address, srcMacMask value "000000111111". . .PARAMETER Protocol Protocol, identified by protocol name, to match against the protocol of an outgoing IPv4 packet. Possible values = ICMP, IGMP, TCP, EGP, IGP, ARGUS, UDP, RDP, RSVP, EIGRP, L2TP, ISIS, GGP, IPoverIP, ST, CBT, BBN-RCC-M, NVP-II, PUP, EMCON, XNET, CHAOS, MUX, DCN-MEAS, HMP, PRM, XNS-IDP, TRUNK-1, TRUNK-2, LEAF-1, LEAF-2, IRTP, ISO-TP4, NETBLT, MFE-NSP, MERIT-INP, SEP, 3PC, IDPR, XTP, DDP, IDPR-CMTP, TP++, IL, IPv6, SDRP, IPv6-Route, IPv6-Frag, IDRP, GRE, MHRP, BNA, ESP, AH, I-NLSP, SWIPE, NARP, MOBILE, TLSP, SKIP, ICMPV6, IPv6-NoNx, IPv6-Opts, Any-Host-Internal-Protocol, CFTP, Any-Local-Network, SAT-EXPAK, KRYPTOLAN, RVD, IPPC, Any-Distributed-File-System, TFTP, VISA, IPCV, CPNX, CPHB, WSN, PVP, BR-SAT-MO, SUN-ND, WB-MON, WB-EXPAK, ISO-IP, VMTP, SECURE-VM, VINES, TTP, NSFNET-IG, DGP, TCF, OSPFIGP, Sprite-RP, LARP, MTP, AX.25, IPIP, MICP, SCC-SP, ETHERIP, Any-Private-Encryption-Scheme, GMTP, IFMP, PNNI, PIM, ARIS, SCPS, QNX, A/N, IPComp, SNP, Compaq-Pe, IPX-in-IP, VRRP, PGM, Any-0-Hop-Protocol, ENCAP, DDX, IATP, STP, SRP, UTI, SMP, SM, PTP, FIRE, CRTP, CRUDP, SSCOPMCE, IPLT, SPS, PIPE, SCTP, FC, RSVP-E2E-IGNORE, Mobility-Header, UDPLite .PARAMETER Protocolnumber Protocol, identified by protocol number, to match against the protocol of an outgoing IPv4 packet. Maximum value = 255 .PARAMETER Vlan ID of the VLAN. The Citrix ADC compares the PBR only to the outgoing packets on the specified VLAN. If you do not specify any interface ID, the appliance compares the PBR to the outgoing packets on all VLANs. Maximum value = 4094 .PARAMETER Vxlan ID of the VXLAN. The Citrix ADC compares the PBR only to the outgoing packets on the specified VXLAN. If you do not specify any interface ID, the appliance compares the PBR to the outgoing packets on all VXLANs. Maximum value = 16777215 .PARAMETER Interface ID of an interface. The Citrix ADC compares the PBR only to the outgoing packets on the specified interface. If you do not specify any value, the appliance compares the PBR to the outgoing packets on all interfaces. .PARAMETER Priority Priority of the PBR, which determines the order in which it is evaluated relative to the other PBRs. If you do not specify priorities while creating PBRs, the PBRs are evaluated in the order in which they are created. Maximum value = 81920 .PARAMETER Msr Monitor the route specified byte Next Hop parameter. This parameter is not applicable if you specify a link load balancing (LLB) virtual server name with the Next Hop parameter. Possible values = ENABLED, DISABLED .PARAMETER Monitor The name of the monitor.(Can be only of type ping or ARP ). .PARAMETER PassThru Return details about the created nspbr item. .EXAMPLE PS C:\>Invoke-NSUpdateNspbr -name <string> An example how to update nspbr config Object(s). .NOTES File Name : Invoke-NSUpdateNspbr Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspbr/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [ValidateSet('ALLOW', 'DENY')] [string]$Action, [boolean]$Srcip, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Srcipop, [string]$Srcipval, [boolean]$Srcport, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Srcportop, [string]$Srcportval, [boolean]$Destip, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Destipop, [string]$Destipval, [boolean]$Destport, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Destportop, [string]$Destportval, [boolean]$Nexthop, [string]$Nexthopval, [boolean]$Iptunnel, [string]$Iptunnelname, [string]$Vxlanvlanmap, [string]$Srcmac, [string]$Srcmacmask, [ValidateSet('ICMP', 'IGMP', 'TCP', 'EGP', 'IGP', 'ARGUS', 'UDP', 'RDP', 'RSVP', 'EIGRP', 'L2TP', 'ISIS', 'GGP', 'IPoverIP', 'ST', 'CBT', 'BBN-RCC-M', 'NVP-II', 'PUP', 'EMCON', 'XNET', 'CHAOS', 'MUX', 'DCN-MEAS', 'HMP', 'PRM', 'XNS-IDP', 'TRUNK-1', 'TRUNK-2', 'LEAF-1', 'LEAF-2', 'IRTP', 'ISO-TP4', 'NETBLT', 'MFE-NSP', 'MERIT-INP', 'SEP', '3PC', 'IDPR', 'XTP', 'DDP', 'IDPR-CMTP', 'TP++', 'IL', 'IPv6', 'SDRP', 'IPv6-Route', 'IPv6-Frag', 'IDRP', 'GRE', 'MHRP', 'BNA', 'ESP', 'AH', 'I-NLSP', 'SWIPE', 'NARP', 'MOBILE', 'TLSP', 'SKIP', 'ICMPV6', 'IPv6-NoNx', 'IPv6-Opts', 'Any-Host-Internal-Protocol', 'CFTP', 'Any-Local-Network', 'SAT-EXPAK', 'KRYPTOLAN', 'RVD', 'IPPC', 'Any-Distributed-File-System', 'TFTP', 'VISA', 'IPCV', 'CPNX', 'CPHB', 'WSN', 'PVP', 'BR-SAT-MO', 'SUN-ND', 'WB-MON', 'WB-EXPAK', 'ISO-IP', 'VMTP', 'SECURE-VM', 'VINES', 'TTP', 'NSFNET-IG', 'DGP', 'TCF', 'OSPFIGP', 'Sprite-RP', 'LARP', 'MTP', 'AX.25', 'IPIP', 'MICP', 'SCC-SP', 'ETHERIP', 'Any-Private-Encryption-Scheme', 'GMTP', 'IFMP', 'PNNI', 'PIM', 'ARIS', 'SCPS', 'QNX', 'A/N', 'IPComp', 'SNP', 'Compaq-Pe', 'IPX-in-IP', 'VRRP', 'PGM', 'Any-0-Hop-Protocol', 'ENCAP', 'DDX', 'IATP', 'STP', 'SRP', 'UTI', 'SMP', 'SM', 'PTP', 'FIRE', 'CRTP', 'CRUDP', 'SSCOPMCE', 'IPLT', 'SPS', 'PIPE', 'SCTP', 'FC', 'RSVP-E2E-IGNORE', 'Mobility-Header', 'UDPLite')] [string]$Protocol, [double]$Protocolnumber, [double]$Vlan, [double]$Vxlan, [string]$Interface, [double]$Priority, [ValidateSet('ENABLED', 'DISABLED')] [string]$Msr, [ValidateScript({ $_.Length -gt 1 })] [string]$Monitor, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateNspbr: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('action') ) { $payload.Add('action', $action) } if ( $PSBoundParameters.ContainsKey('srcip') ) { $payload.Add('srcip', $srcip) } if ( $PSBoundParameters.ContainsKey('srcipop') ) { $payload.Add('srcipop', $srcipop) } if ( $PSBoundParameters.ContainsKey('srcipval') ) { $payload.Add('srcipval', $srcipval) } if ( $PSBoundParameters.ContainsKey('srcport') ) { $payload.Add('srcport', $srcport) } if ( $PSBoundParameters.ContainsKey('srcportop') ) { $payload.Add('srcportop', $srcportop) } if ( $PSBoundParameters.ContainsKey('srcportval') ) { $payload.Add('srcportval', $srcportval) } if ( $PSBoundParameters.ContainsKey('destip') ) { $payload.Add('destip', $destip) } if ( $PSBoundParameters.ContainsKey('destipop') ) { $payload.Add('destipop', $destipop) } if ( $PSBoundParameters.ContainsKey('destipval') ) { $payload.Add('destipval', $destipval) } if ( $PSBoundParameters.ContainsKey('destport') ) { $payload.Add('destport', $destport) } if ( $PSBoundParameters.ContainsKey('destportop') ) { $payload.Add('destportop', $destportop) } if ( $PSBoundParameters.ContainsKey('destportval') ) { $payload.Add('destportval', $destportval) } if ( $PSBoundParameters.ContainsKey('nexthop') ) { $payload.Add('nexthop', $nexthop) } if ( $PSBoundParameters.ContainsKey('nexthopval') ) { $payload.Add('nexthopval', $nexthopval) } if ( $PSBoundParameters.ContainsKey('iptunnel') ) { $payload.Add('iptunnel', $iptunnel) } if ( $PSBoundParameters.ContainsKey('iptunnelname') ) { $payload.Add('iptunnelname', $iptunnelname) } if ( $PSBoundParameters.ContainsKey('vxlanvlanmap') ) { $payload.Add('vxlanvlanmap', $vxlanvlanmap) } if ( $PSBoundParameters.ContainsKey('srcmac') ) { $payload.Add('srcmac', $srcmac) } if ( $PSBoundParameters.ContainsKey('srcmacmask') ) { $payload.Add('srcmacmask', $srcmacmask) } if ( $PSBoundParameters.ContainsKey('protocol') ) { $payload.Add('protocol', $protocol) } if ( $PSBoundParameters.ContainsKey('protocolnumber') ) { $payload.Add('protocolnumber', $protocolnumber) } if ( $PSBoundParameters.ContainsKey('vlan') ) { $payload.Add('vlan', $vlan) } if ( $PSBoundParameters.ContainsKey('vxlan') ) { $payload.Add('vxlan', $vxlan) } if ( $PSBoundParameters.ContainsKey('Interface') ) { $payload.Add('Interface', $Interface) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('msr') ) { $payload.Add('msr', $msr) } if ( $PSBoundParameters.ContainsKey('monitor') ) { $payload.Add('monitor', $monitor) } if ( $PSCmdlet.ShouldProcess("nspbr", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nspbr -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNspbr -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNspbr: Finished" } } function Invoke-NSUnsetNspbr { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for Policy Based Routing(PBR) entry resource. .PARAMETER Name Name for the PBR. Must begin with an ASCII alphabetic or underscore \(_\) character, and must contain only ASCII alphanumeric, underscore, hash \(\#\), period \(.\), space, colon \(:\), at \(@\), equals \(=\), and hyphen \(-\) characters. Cannot be changed after the PBR is created. .PARAMETER Srcip IP address or range of IP addresses to match against the source IP address of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 10.102.29.30-10.102.29.189. .PARAMETER Srcport Port number or range of port numbers to match against the source port number of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. Note: The destination port can be specified only for TCP and UDP protocols. .PARAMETER Destip IP address or range of IP addresses to match against the destination IP address of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 10.102.29.30-10.102.29.189. .PARAMETER Destport Port number or range of port numbers to match against the destination port number of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. Note: The destination port can be specified only for TCP and UDP protocols. .PARAMETER Nexthop IP address of the next hop router or the name of the link load balancing virtual server to which to send matching packets if action is set to ALLOW. If you specify a link load balancing (LLB) virtual server, which can provide a backup if a next hop link fails, first make sure that the next hops bound to the LLB virtual server are actually next hops that are directly connected to the Citrix ADC. Otherwise, the Citrix ADC throws an error when you attempt to create the PBR. The next hop can be null to represent null routes. .PARAMETER Iptunnel The Tunnel name. .PARAMETER Vxlanvlanmap The vlan to vxlan mapping to be applied for incoming packets over this pbr tunnel. .PARAMETER Srcmac MAC address to match against the source MAC address of an outgoing IPv4 packet. .PARAMETER Srcmacmask Used to define range of Source MAC address. It takes string of 0 and 1, 0s are for exact match and 1s for wildcard. For matching first 3 bytes of MAC address, srcMacMask value "000000111111". . .PARAMETER Protocol Protocol, identified by protocol name, to match against the protocol of an outgoing IPv4 packet. Possible values = ICMP, IGMP, TCP, EGP, IGP, ARGUS, UDP, RDP, RSVP, EIGRP, L2TP, ISIS, GGP, IPoverIP, ST, CBT, BBN-RCC-M, NVP-II, PUP, EMCON, XNET, CHAOS, MUX, DCN-MEAS, HMP, PRM, XNS-IDP, TRUNK-1, TRUNK-2, LEAF-1, LEAF-2, IRTP, ISO-TP4, NETBLT, MFE-NSP, MERIT-INP, SEP, 3PC, IDPR, XTP, DDP, IDPR-CMTP, TP++, IL, IPv6, SDRP, IPv6-Route, IPv6-Frag, IDRP, GRE, MHRP, BNA, ESP, AH, I-NLSP, SWIPE, NARP, MOBILE, TLSP, SKIP, ICMPV6, IPv6-NoNx, IPv6-Opts, Any-Host-Internal-Protocol, CFTP, Any-Local-Network, SAT-EXPAK, KRYPTOLAN, RVD, IPPC, Any-Distributed-File-System, TFTP, VISA, IPCV, CPNX, CPHB, WSN, PVP, BR-SAT-MO, SUN-ND, WB-MON, WB-EXPAK, ISO-IP, VMTP, SECURE-VM, VINES, TTP, NSFNET-IG, DGP, TCF, OSPFIGP, Sprite-RP, LARP, MTP, AX.25, IPIP, MICP, SCC-SP, ETHERIP, Any-Private-Encryption-Scheme, GMTP, IFMP, PNNI, PIM, ARIS, SCPS, QNX, A/N, IPComp, SNP, Compaq-Pe, IPX-in-IP, VRRP, PGM, Any-0-Hop-Protocol, ENCAP, DDX, IATP, STP, SRP, UTI, SMP, SM, PTP, FIRE, CRTP, CRUDP, SSCOPMCE, IPLT, SPS, PIPE, SCTP, FC, RSVP-E2E-IGNORE, Mobility-Header, UDPLite .PARAMETER Vlan ID of the VLAN. The Citrix ADC compares the PBR only to the outgoing packets on the specified VLAN. If you do not specify any interface ID, the appliance compares the PBR to the outgoing packets on all VLANs. Maximum value = 4094 .PARAMETER Vxlan ID of the VXLAN. The Citrix ADC compares the PBR only to the outgoing packets on the specified VXLAN. If you do not specify any interface ID, the appliance compares the PBR to the outgoing packets on all VXLANs. Maximum value = 16777215 .PARAMETER Interface ID of an interface. The Citrix ADC compares the PBR only to the outgoing packets on the specified interface. If you do not specify any value, the appliance compares the PBR to the outgoing packets on all interfaces. .PARAMETER Msr Monitor the route specified byte Next Hop parameter. This parameter is not applicable if you specify a link load balancing (LLB) virtual server name with the Next Hop parameter. Possible values = ENABLED, DISABLED .PARAMETER Monitor The name of the monitor.(Can be only of type ping or ARP ). .EXAMPLE PS C:\>Invoke-NSUnsetNspbr -name <string> An example how to unset nspbr config Object(s). .NOTES File Name : Invoke-NSUnsetNspbr Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspbr Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [Boolean]$srcip, [Boolean]$srcport, [Boolean]$destip, [Boolean]$destport, [Boolean]$nexthop, [Boolean]$iptunnel, [Boolean]$vxlanvlanmap, [Boolean]$srcmac, [Boolean]$srcmacmask, [Boolean]$protocol, [Boolean]$vlan, [Boolean]$vxlan, [Boolean]$Interface, [Boolean]$msr, [Boolean]$monitor ) begin { Write-Verbose "Invoke-NSUnsetNspbr: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('srcip') ) { $payload.Add('srcip', $srcip) } if ( $PSBoundParameters.ContainsKey('srcport') ) { $payload.Add('srcport', $srcport) } if ( $PSBoundParameters.ContainsKey('destip') ) { $payload.Add('destip', $destip) } if ( $PSBoundParameters.ContainsKey('destport') ) { $payload.Add('destport', $destport) } if ( $PSBoundParameters.ContainsKey('nexthop') ) { $payload.Add('nexthop', $nexthop) } if ( $PSBoundParameters.ContainsKey('iptunnel') ) { $payload.Add('iptunnel', $iptunnel) } if ( $PSBoundParameters.ContainsKey('vxlanvlanmap') ) { $payload.Add('vxlanvlanmap', $vxlanvlanmap) } if ( $PSBoundParameters.ContainsKey('srcmac') ) { $payload.Add('srcmac', $srcmac) } if ( $PSBoundParameters.ContainsKey('srcmacmask') ) { $payload.Add('srcmacmask', $srcmacmask) } if ( $PSBoundParameters.ContainsKey('protocol') ) { $payload.Add('protocol', $protocol) } if ( $PSBoundParameters.ContainsKey('vlan') ) { $payload.Add('vlan', $vlan) } if ( $PSBoundParameters.ContainsKey('vxlan') ) { $payload.Add('vxlan', $vxlan) } if ( $PSBoundParameters.ContainsKey('Interface') ) { $payload.Add('Interface', $Interface) } if ( $PSBoundParameters.ContainsKey('msr') ) { $payload.Add('msr', $msr) } if ( $PSBoundParameters.ContainsKey('monitor') ) { $payload.Add('monitor', $monitor) } if ( $PSCmdlet.ShouldProcess("$name", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nspbr -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNspbr: Finished" } } function Invoke-NSEnableNspbr { <# .SYNOPSIS Enable System/Global level configuration. config Object. .DESCRIPTION Configuration for Policy Based Routing(PBR) entry resource. .PARAMETER Name Name for the PBR. Must begin with an ASCII alphabetic or underscore \(_\) character, and must contain only ASCII alphanumeric, underscore, hash \(\#\), period \(.\), space, colon \(:\), at \(@\), equals \(=\), and hyphen \(-\) characters. Cannot be changed after the PBR is created. .EXAMPLE PS C:\>Invoke-NSEnableNspbr -name <string> An example how to enable nspbr config Object(s). .NOTES File Name : Invoke-NSEnableNspbr Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspbr/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Name ) begin { Write-Verbose "Invoke-NSEnableNspbr: Starting" } process { try { $payload = @{ name = $name } if ( $PSCmdlet.ShouldProcess($Name, "Enable System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nspbr -Action enable -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSEnableNspbr: Finished" } } function Invoke-NSDisableNspbr { <# .SYNOPSIS Disable System/Global level configuration. config Object. .DESCRIPTION Configuration for Policy Based Routing(PBR) entry resource. .PARAMETER Name Name for the PBR. Must begin with an ASCII alphabetic or underscore \(_\) character, and must contain only ASCII alphanumeric, underscore, hash \(\#\), period \(.\), space, colon \(:\), at \(@\), equals \(=\), and hyphen \(-\) characters. Cannot be changed after the PBR is created. .EXAMPLE PS C:\>Invoke-NSDisableNspbr -name <string> An example how to disable nspbr config Object(s). .NOTES File Name : Invoke-NSDisableNspbr Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspbr/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Name ) begin { Write-Verbose "Invoke-NSDisableNspbr: Starting" } process { try { $payload = @{ name = $name } if ( $PSCmdlet.ShouldProcess($Name, "Disable System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nspbr -Action disable -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDisableNspbr: Finished" } } function Invoke-NSGetNspbr { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for Policy Based Routing(PBR) entry resource. .PARAMETER Name Name for the PBR. Must begin with an ASCII alphabetic or underscore \(_\) character, and must contain only ASCII alphanumeric, underscore, hash \(\#\), period \(.\), space, colon \(:\), at \(@\), equals \(=\), and hyphen \(-\) characters. Cannot be changed after the PBR is created. .PARAMETER GetAll Retrieve all nspbr object(s). .PARAMETER Count If specified, the count of the nspbr object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNspbr Get data. .EXAMPLE PS C:\>Invoke-NSGetNspbr -GetAll Get all nspbr data. .EXAMPLE PS C:\>Invoke-NSGetNspbr -Count Get the number of nspbr objects. .EXAMPLE PS C:\>Invoke-NSGetNspbr -name <string> Get nspbr object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNspbr -Filter @{ 'name'='<value>' } Get nspbr data with a filter. .NOTES File Name : Invoke-NSGetNspbr Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspbr/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNspbr: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nspbr objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspbr -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nspbr objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspbr -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nspbr objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspbr -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nspbr configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspbr -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nspbr configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspbr -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNspbr: Ended" } } function Invoke-NSAddNspbr6 { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Configuration for PBR6 entry resource. .PARAMETER Name Name for the PBR6. Must begin with an ASCII alphabetic or underscore \(_\) character, and must contain only ASCII alphanumeric, underscore, hash \(\#\), period \(.\), space, colon \(:\), at \(@\), equals \(=\), and hyphen \(-\) characters. Cannot be changed after the PBR6 is created. .PARAMETER Td Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0. Maximum value = 4094 .PARAMETER Action Action to perform on the outgoing IPv6 packets that match the PBR6. Available settings function as follows: * ALLOW - The Citrix ADC sends the packet to the designated next-hop router. * DENY - The Citrix ADC applies the routing table for normal destination-based routing. Possible values = ALLOW, DENY .PARAMETER Srcipv6 IP address or range of IP addresses to match against the source IP address of an outgoing IPv6 packet. In the command line interface, separate the range with a hyphen. .PARAMETER Srcipop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Srcipv6val IP address or range of IP addresses to match against the source IP address of an outgoing IPv6 packet. In the command line interface, separate the range with a hyphen. .PARAMETER Srcport Port number or range of port numbers to match against the source port number of an outgoing IPv6 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. .PARAMETER Srcportop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Srcportval Source port (range). .PARAMETER Destipv6 IP address or range of IP addresses to match against the destination IP address of an outgoing IPv6 packet. In the command line interface, separate the range with a hyphen. .PARAMETER Destipop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Destipv6val IP address or range of IP addresses to match against the destination IP address of an outgoing IPv6 packet. In the command line interface, separate the range with a hyphen. .PARAMETER Destport Port number or range of port numbers to match against the destination port number of an outgoing IPv6 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. Note: The destination port can be specified only for TCP and UDP protocols. .PARAMETER Destportop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Destportval Destination port (range). .PARAMETER Srcmac MAC address to match against the source MAC address of an outgoing IPv6 packet. .PARAMETER Srcmacmask Used to define range of Source MAC address. It takes string of 0 and 1, 0s are for exact match and 1s for wildcard. For matching first 3 bytes of MAC address, srcMacMask value "000000111111". . .PARAMETER Protocol Protocol, identified by protocol name, to match against the protocol of an outgoing IPv6 packet. Possible values = ICMPV6, TCP, UDP, ICMP, IGMP, EGP, IGP, ARGUS, RDP, RSVP, EIGRP, L2TP, ISIS, GGP, IPoverIP, ST, CBT, BBN-RCC-M, NVP-II, PUP, EMCON, XNET, CHAOS, MUX, DCN-MEAS, HMP, PRM, XNS-IDP, TRUNK-1, TRUNK-2, LEAF-1, LEAF-2, IRTP, ISO-TP4, NETBLT, MFE-NSP, MERIT-INP, SEP, 3PC, IDPR, XTP, DDP, IDPR-CMTP, TP++, IL, IPv6, SDRP, IPv6-Route, IPv6-Frag, IDRP, GRE, MHRP, BNA, ESP, AH, I-NLSP, SWIPE, NARP, MOBILE, TLSP, SKIP, IPv6-NoNx, IPv6-Opts, Any-Host-Internal-Protocol, CFTP, Any-Local-Network, SAT-EXPAK, KRYPTOLAN, RVD, IPPC, Any-Distributed-File-System, TFTP, VISA, IPCV, CPNX, CPHB, WSN, PVP, BR-SAT-MO, SUN-ND, WB-MON, WB-EXPAK, ISO-IP, VMTP, SECURE-VM, VINES, TTP, NSFNET-IG, DGP, TCF, OSPFIGP, Sprite-RP, LARP, MTP, AX.25, IPIP, MICP, SCC-SP, ETHERIP, Any-Private-Encryption-Scheme, GMTP, IFMP, PNNI, PIM, ARIS, SCPS, QNX, A/N, IPComp, SNP, Compaq-Pe, IPX-in-IP, VRRP, PGM, Any-0-Hop-Protocol, ENCAP, DDX, IATP, STP, SRP, UTI, SMP, SM, PTP, FIRE, CRTP, CRUDP, SSCOPMCE, IPLT, SPS, PIPE, SCTP, FC, RSVP-E2E-IGNORE, Mobility-Header, UDPLite .PARAMETER Protocolnumber Protocol, identified by protocol number, to match against the protocol of an outgoing IPv6 packet. Maximum value = 255 .PARAMETER Vlan ID of the VLAN. The Citrix ADC compares the PBR6 only to the outgoing packets on the specified VLAN. If you do not specify an interface ID, the appliance compares the PBR6 to the outgoing packets on all VLANs. Maximum value = 4094 .PARAMETER Vxlan ID of the VXLAN. The Citrix ADC compares the PBR6 only to the outgoing packets on the specified VXLAN. If you do not specify an interface ID, the appliance compares the PBR6 to the outgoing packets on all VXLANs. Maximum value = 16777215 .PARAMETER Interface ID of an interface. The Citrix ADC compares the PBR6 only to the outgoing packets on the specified interface. If you do not specify a value, the appliance compares the PBR6 to the outgoing packets on all interfaces. .PARAMETER Priority Priority of the PBR6, which determines the order in which it is evaluated relative to the other PBR6s. If you do not specify priorities while creating PBR6s, the PBR6s are evaluated in the order in which they are created. Maximum value = 81920 .PARAMETER State Enable or disable the PBR6. After you apply the PBR6s, the Citrix ADC compares outgoing packets to the enabled PBR6s. Possible values = ENABLED, DISABLED .PARAMETER Msr Monitor the route specified by the Next Hop parameter. Possible values = ENABLED, DISABLED .PARAMETER Monitor The name of the monitor.(Can be only of type ping or ARP ). .PARAMETER Nexthop IP address of the next hop router to which to send matching packets if action is set to ALLOW. This next hop should be directly reachable from the appliance. .PARAMETER Nexthopval The Next Hop IPv6 address. .PARAMETER Iptunnel The iptunnel name where packets need to be forwarded upon. .PARAMETER Vxlanvlanmap The vlan to vxlan mapping to be applied for incoming packets over this pbr tunnel. .PARAMETER Nexthopvlan VLAN number to be used for link local nexthop . Maximum value = 4094 .PARAMETER Ownergroup The owner node group in a Cluster for this pbr rule. If owner node group is not specified then the pbr rule is treated as Striped pbr rule. .PARAMETER PassThru Return details about the created nspbr6 item. .EXAMPLE PS C:\>Invoke-NSAddNspbr6 -name <string> -action <string> An example how to add nspbr6 config Object(s). .NOTES File Name : Invoke-NSAddNspbr6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspbr6/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [double]$Td, [Parameter(Mandatory)] [ValidateSet('ALLOW', 'DENY')] [string]$Action, [boolean]$Srcipv6, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Srcipop, [string]$Srcipv6val, [boolean]$Srcport, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Srcportop, [string]$Srcportval, [boolean]$Destipv6, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Destipop, [string]$Destipv6val, [boolean]$Destport, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Destportop, [string]$Destportval, [string]$Srcmac, [string]$Srcmacmask = '"000000000000"', [ValidateSet('ICMPV6', 'TCP', 'UDP', 'ICMP', 'IGMP', 'EGP', 'IGP', 'ARGUS', 'RDP', 'RSVP', 'EIGRP', 'L2TP', 'ISIS', 'GGP', 'IPoverIP', 'ST', 'CBT', 'BBN-RCC-M', 'NVP-II', 'PUP', 'EMCON', 'XNET', 'CHAOS', 'MUX', 'DCN-MEAS', 'HMP', 'PRM', 'XNS-IDP', 'TRUNK-1', 'TRUNK-2', 'LEAF-1', 'LEAF-2', 'IRTP', 'ISO-TP4', 'NETBLT', 'MFE-NSP', 'MERIT-INP', 'SEP', '3PC', 'IDPR', 'XTP', 'DDP', 'IDPR-CMTP', 'TP++', 'IL', 'IPv6', 'SDRP', 'IPv6-Route', 'IPv6-Frag', 'IDRP', 'GRE', 'MHRP', 'BNA', 'ESP', 'AH', 'I-NLSP', 'SWIPE', 'NARP', 'MOBILE', 'TLSP', 'SKIP', 'IPv6-NoNx', 'IPv6-Opts', 'Any-Host-Internal-Protocol', 'CFTP', 'Any-Local-Network', 'SAT-EXPAK', 'KRYPTOLAN', 'RVD', 'IPPC', 'Any-Distributed-File-System', 'TFTP', 'VISA', 'IPCV', 'CPNX', 'CPHB', 'WSN', 'PVP', 'BR-SAT-MO', 'SUN-ND', 'WB-MON', 'WB-EXPAK', 'ISO-IP', 'VMTP', 'SECURE-VM', 'VINES', 'TTP', 'NSFNET-IG', 'DGP', 'TCF', 'OSPFIGP', 'Sprite-RP', 'LARP', 'MTP', 'AX.25', 'IPIP', 'MICP', 'SCC-SP', 'ETHERIP', 'Any-Private-Encryption-Scheme', 'GMTP', 'IFMP', 'PNNI', 'PIM', 'ARIS', 'SCPS', 'QNX', 'A/N', 'IPComp', 'SNP', 'Compaq-Pe', 'IPX-in-IP', 'VRRP', 'PGM', 'Any-0-Hop-Protocol', 'ENCAP', 'DDX', 'IATP', 'STP', 'SRP', 'UTI', 'SMP', 'SM', 'PTP', 'FIRE', 'CRTP', 'CRUDP', 'SSCOPMCE', 'IPLT', 'SPS', 'PIPE', 'SCTP', 'FC', 'RSVP-E2E-IGNORE', 'Mobility-Header', 'UDPLite')] [string]$Protocol, [double]$Protocolnumber, [double]$Vlan, [double]$Vxlan, [string]$Interface, [double]$Priority, [ValidateSet('ENABLED', 'DISABLED')] [string]$State = 'ENABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Msr = 'DISABLED', [ValidateScript({ $_.Length -gt 1 })] [string]$Monitor, [boolean]$Nexthop, [string]$Nexthopval, [string]$Iptunnel, [string]$Vxlanvlanmap, [double]$Nexthopvlan, [ValidateScript({ $_.Length -gt 1 })] [string]$Ownergroup = 'DEFAULT_NG', [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNspbr6: Starting" } process { try { $payload = @{ name = $name action = $action } if ( $PSBoundParameters.ContainsKey('td') ) { $payload.Add('td', $td) } if ( $PSBoundParameters.ContainsKey('srcipv6') ) { $payload.Add('srcipv6', $srcipv6) } if ( $PSBoundParameters.ContainsKey('srcipop') ) { $payload.Add('srcipop', $srcipop) } if ( $PSBoundParameters.ContainsKey('srcipv6val') ) { $payload.Add('srcipv6val', $srcipv6val) } if ( $PSBoundParameters.ContainsKey('srcport') ) { $payload.Add('srcport', $srcport) } if ( $PSBoundParameters.ContainsKey('srcportop') ) { $payload.Add('srcportop', $srcportop) } if ( $PSBoundParameters.ContainsKey('srcportval') ) { $payload.Add('srcportval', $srcportval) } if ( $PSBoundParameters.ContainsKey('destipv6') ) { $payload.Add('destipv6', $destipv6) } if ( $PSBoundParameters.ContainsKey('destipop') ) { $payload.Add('destipop', $destipop) } if ( $PSBoundParameters.ContainsKey('destipv6val') ) { $payload.Add('destipv6val', $destipv6val) } if ( $PSBoundParameters.ContainsKey('destport') ) { $payload.Add('destport', $destport) } if ( $PSBoundParameters.ContainsKey('destportop') ) { $payload.Add('destportop', $destportop) } if ( $PSBoundParameters.ContainsKey('destportval') ) { $payload.Add('destportval', $destportval) } if ( $PSBoundParameters.ContainsKey('srcmac') ) { $payload.Add('srcmac', $srcmac) } if ( $PSBoundParameters.ContainsKey('srcmacmask') ) { $payload.Add('srcmacmask', $srcmacmask) } if ( $PSBoundParameters.ContainsKey('protocol') ) { $payload.Add('protocol', $protocol) } if ( $PSBoundParameters.ContainsKey('protocolnumber') ) { $payload.Add('protocolnumber', $protocolnumber) } if ( $PSBoundParameters.ContainsKey('vlan') ) { $payload.Add('vlan', $vlan) } if ( $PSBoundParameters.ContainsKey('vxlan') ) { $payload.Add('vxlan', $vxlan) } if ( $PSBoundParameters.ContainsKey('Interface') ) { $payload.Add('Interface', $Interface) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('state') ) { $payload.Add('state', $state) } if ( $PSBoundParameters.ContainsKey('msr') ) { $payload.Add('msr', $msr) } if ( $PSBoundParameters.ContainsKey('monitor') ) { $payload.Add('monitor', $monitor) } if ( $PSBoundParameters.ContainsKey('nexthop') ) { $payload.Add('nexthop', $nexthop) } if ( $PSBoundParameters.ContainsKey('nexthopval') ) { $payload.Add('nexthopval', $nexthopval) } if ( $PSBoundParameters.ContainsKey('iptunnel') ) { $payload.Add('iptunnel', $iptunnel) } if ( $PSBoundParameters.ContainsKey('vxlanvlanmap') ) { $payload.Add('vxlanvlanmap', $vxlanvlanmap) } if ( $PSBoundParameters.ContainsKey('nexthopvlan') ) { $payload.Add('nexthopvlan', $nexthopvlan) } if ( $PSBoundParameters.ContainsKey('ownergroup') ) { $payload.Add('ownergroup', $ownergroup) } if ( $PSCmdlet.ShouldProcess("nspbr6", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nspbr6 -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNspbr6 -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNspbr6: Finished" } } function Invoke-NSRenumberNspbr6 { <# .SYNOPSIS Renumber System/Global level configuration. config Object. .DESCRIPTION Configuration for PBR6 entry resource. .EXAMPLE PS C:\>Invoke-NSRenumberNspbr6 An example how to renumber nspbr6 config Object(s). .NOTES File Name : Invoke-NSRenumberNspbr6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspbr6/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession) ) begin { Write-Verbose "Invoke-NSRenumberNspbr6: Starting" } process { try { $payload = @{ } if ( $PSCmdlet.ShouldProcess($Name, "Renumber System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nspbr6 -Action renumber -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSRenumberNspbr6: Finished" } } function Invoke-NSDeleteNspbr6 { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Configuration for PBR6 entry resource. .PARAMETER Name Name for the PBR6. Must begin with an ASCII alphabetic or underscore \(_\) character, and must contain only ASCII alphanumeric, underscore, hash \(\#\), period \(.\), space, colon \(:\), at \(@\), equals \(=\), and hyphen \(-\) characters. Cannot be changed after the PBR6 is created. .EXAMPLE PS C:\>Invoke-NSDeleteNspbr6 -Name <string> An example how to delete nspbr6 config Object(s). .NOTES File Name : Invoke-NSDeleteNspbr6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspbr6/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Name ) begin { Write-Verbose "Invoke-NSDeleteNspbr6: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nspbr6 -NitroPath nitro/v1/config -Resource $name -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNspbr6: Finished" } } function Invoke-NSUpdateNspbr6 { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for PBR6 entry resource. .PARAMETER Name Name for the PBR6. Must begin with an ASCII alphabetic or underscore \(_\) character, and must contain only ASCII alphanumeric, underscore, hash \(\#\), period \(.\), space, colon \(:\), at \(@\), equals \(=\), and hyphen \(-\) characters. Cannot be changed after the PBR6 is created. .PARAMETER Action Action to perform on the outgoing IPv6 packets that match the PBR6. Available settings function as follows: * ALLOW - The Citrix ADC sends the packet to the designated next-hop router. * DENY - The Citrix ADC applies the routing table for normal destination-based routing. Possible values = ALLOW, DENY .PARAMETER Srcipv6 IP address or range of IP addresses to match against the source IP address of an outgoing IPv6 packet. In the command line interface, separate the range with a hyphen. .PARAMETER Srcipop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Srcipv6val IP address or range of IP addresses to match against the source IP address of an outgoing IPv6 packet. In the command line interface, separate the range with a hyphen. .PARAMETER Srcport Port number or range of port numbers to match against the source port number of an outgoing IPv6 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. .PARAMETER Srcportop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Srcportval Source port (range). .PARAMETER Destipv6 IP address or range of IP addresses to match against the destination IP address of an outgoing IPv6 packet. In the command line interface, separate the range with a hyphen. .PARAMETER Destipop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Destipv6val IP address or range of IP addresses to match against the destination IP address of an outgoing IPv6 packet. In the command line interface, separate the range with a hyphen. .PARAMETER Destport Port number or range of port numbers to match against the destination port number of an outgoing IPv6 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. Note: The destination port can be specified only for TCP and UDP protocols. .PARAMETER Destportop Either the equals (=) or does not equal (!=) logical operator. Possible values = =, !=, EQ, NEQ .PARAMETER Destportval Destination port (range). .PARAMETER Srcmac MAC address to match against the source MAC address of an outgoing IPv6 packet. .PARAMETER Srcmacmask Used to define range of Source MAC address. It takes string of 0 and 1, 0s are for exact match and 1s for wildcard. For matching first 3 bytes of MAC address, srcMacMask value "000000111111". . .PARAMETER Protocol Protocol, identified by protocol name, to match against the protocol of an outgoing IPv6 packet. Possible values = ICMPV6, TCP, UDP, ICMP, IGMP, EGP, IGP, ARGUS, RDP, RSVP, EIGRP, L2TP, ISIS, GGP, IPoverIP, ST, CBT, BBN-RCC-M, NVP-II, PUP, EMCON, XNET, CHAOS, MUX, DCN-MEAS, HMP, PRM, XNS-IDP, TRUNK-1, TRUNK-2, LEAF-1, LEAF-2, IRTP, ISO-TP4, NETBLT, MFE-NSP, MERIT-INP, SEP, 3PC, IDPR, XTP, DDP, IDPR-CMTP, TP++, IL, IPv6, SDRP, IPv6-Route, IPv6-Frag, IDRP, GRE, MHRP, BNA, ESP, AH, I-NLSP, SWIPE, NARP, MOBILE, TLSP, SKIP, IPv6-NoNx, IPv6-Opts, Any-Host-Internal-Protocol, CFTP, Any-Local-Network, SAT-EXPAK, KRYPTOLAN, RVD, IPPC, Any-Distributed-File-System, TFTP, VISA, IPCV, CPNX, CPHB, WSN, PVP, BR-SAT-MO, SUN-ND, WB-MON, WB-EXPAK, ISO-IP, VMTP, SECURE-VM, VINES, TTP, NSFNET-IG, DGP, TCF, OSPFIGP, Sprite-RP, LARP, MTP, AX.25, IPIP, MICP, SCC-SP, ETHERIP, Any-Private-Encryption-Scheme, GMTP, IFMP, PNNI, PIM, ARIS, SCPS, QNX, A/N, IPComp, SNP, Compaq-Pe, IPX-in-IP, VRRP, PGM, Any-0-Hop-Protocol, ENCAP, DDX, IATP, STP, SRP, UTI, SMP, SM, PTP, FIRE, CRTP, CRUDP, SSCOPMCE, IPLT, SPS, PIPE, SCTP, FC, RSVP-E2E-IGNORE, Mobility-Header, UDPLite .PARAMETER Protocolnumber Protocol, identified by protocol number, to match against the protocol of an outgoing IPv6 packet. Maximum value = 255 .PARAMETER Vlan ID of the VLAN. The Citrix ADC compares the PBR6 only to the outgoing packets on the specified VLAN. If you do not specify an interface ID, the appliance compares the PBR6 to the outgoing packets on all VLANs. Maximum value = 4094 .PARAMETER Vxlan ID of the VXLAN. The Citrix ADC compares the PBR6 only to the outgoing packets on the specified VXLAN. If you do not specify an interface ID, the appliance compares the PBR6 to the outgoing packets on all VXLANs. Maximum value = 16777215 .PARAMETER Interface ID of an interface. The Citrix ADC compares the PBR6 only to the outgoing packets on the specified interface. If you do not specify a value, the appliance compares the PBR6 to the outgoing packets on all interfaces. .PARAMETER Priority Priority of the PBR6, which determines the order in which it is evaluated relative to the other PBR6s. If you do not specify priorities while creating PBR6s, the PBR6s are evaluated in the order in which they are created. Maximum value = 81920 .PARAMETER Msr Monitor the route specified by the Next Hop parameter. Possible values = ENABLED, DISABLED .PARAMETER Monitor The name of the monitor.(Can be only of type ping or ARP ). .PARAMETER Nexthop IP address of the next hop router to which to send matching packets if action is set to ALLOW. This next hop should be directly reachable from the appliance. .PARAMETER Nexthopval The Next Hop IPv6 address. .PARAMETER Iptunnel The iptunnel name where packets need to be forwarded upon. .PARAMETER Vxlanvlanmap The vlan to vxlan mapping to be applied for incoming packets over this pbr tunnel. .PARAMETER Nexthopvlan VLAN number to be used for link local nexthop . Maximum value = 4094 .PARAMETER PassThru Return details about the created nspbr6 item. .EXAMPLE PS C:\>Invoke-NSUpdateNspbr6 -name <string> An example how to update nspbr6 config Object(s). .NOTES File Name : Invoke-NSUpdateNspbr6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspbr6/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [ValidateSet('ALLOW', 'DENY')] [string]$Action, [boolean]$Srcipv6, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Srcipop, [string]$Srcipv6val, [boolean]$Srcport, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Srcportop, [string]$Srcportval, [boolean]$Destipv6, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Destipop, [string]$Destipv6val, [boolean]$Destport, [ValidateSet('=', '!=', 'EQ', 'NEQ')] [string]$Destportop, [string]$Destportval, [string]$Srcmac, [string]$Srcmacmask, [ValidateSet('ICMPV6', 'TCP', 'UDP', 'ICMP', 'IGMP', 'EGP', 'IGP', 'ARGUS', 'RDP', 'RSVP', 'EIGRP', 'L2TP', 'ISIS', 'GGP', 'IPoverIP', 'ST', 'CBT', 'BBN-RCC-M', 'NVP-II', 'PUP', 'EMCON', 'XNET', 'CHAOS', 'MUX', 'DCN-MEAS', 'HMP', 'PRM', 'XNS-IDP', 'TRUNK-1', 'TRUNK-2', 'LEAF-1', 'LEAF-2', 'IRTP', 'ISO-TP4', 'NETBLT', 'MFE-NSP', 'MERIT-INP', 'SEP', '3PC', 'IDPR', 'XTP', 'DDP', 'IDPR-CMTP', 'TP++', 'IL', 'IPv6', 'SDRP', 'IPv6-Route', 'IPv6-Frag', 'IDRP', 'GRE', 'MHRP', 'BNA', 'ESP', 'AH', 'I-NLSP', 'SWIPE', 'NARP', 'MOBILE', 'TLSP', 'SKIP', 'IPv6-NoNx', 'IPv6-Opts', 'Any-Host-Internal-Protocol', 'CFTP', 'Any-Local-Network', 'SAT-EXPAK', 'KRYPTOLAN', 'RVD', 'IPPC', 'Any-Distributed-File-System', 'TFTP', 'VISA', 'IPCV', 'CPNX', 'CPHB', 'WSN', 'PVP', 'BR-SAT-MO', 'SUN-ND', 'WB-MON', 'WB-EXPAK', 'ISO-IP', 'VMTP', 'SECURE-VM', 'VINES', 'TTP', 'NSFNET-IG', 'DGP', 'TCF', 'OSPFIGP', 'Sprite-RP', 'LARP', 'MTP', 'AX.25', 'IPIP', 'MICP', 'SCC-SP', 'ETHERIP', 'Any-Private-Encryption-Scheme', 'GMTP', 'IFMP', 'PNNI', 'PIM', 'ARIS', 'SCPS', 'QNX', 'A/N', 'IPComp', 'SNP', 'Compaq-Pe', 'IPX-in-IP', 'VRRP', 'PGM', 'Any-0-Hop-Protocol', 'ENCAP', 'DDX', 'IATP', 'STP', 'SRP', 'UTI', 'SMP', 'SM', 'PTP', 'FIRE', 'CRTP', 'CRUDP', 'SSCOPMCE', 'IPLT', 'SPS', 'PIPE', 'SCTP', 'FC', 'RSVP-E2E-IGNORE', 'Mobility-Header', 'UDPLite')] [string]$Protocol, [double]$Protocolnumber, [double]$Vlan, [double]$Vxlan, [string]$Interface, [double]$Priority, [ValidateSet('ENABLED', 'DISABLED')] [string]$Msr, [ValidateScript({ $_.Length -gt 1 })] [string]$Monitor, [boolean]$Nexthop, [string]$Nexthopval, [string]$Iptunnel, [string]$Vxlanvlanmap, [double]$Nexthopvlan, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateNspbr6: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('action') ) { $payload.Add('action', $action) } if ( $PSBoundParameters.ContainsKey('srcipv6') ) { $payload.Add('srcipv6', $srcipv6) } if ( $PSBoundParameters.ContainsKey('srcipop') ) { $payload.Add('srcipop', $srcipop) } if ( $PSBoundParameters.ContainsKey('srcipv6val') ) { $payload.Add('srcipv6val', $srcipv6val) } if ( $PSBoundParameters.ContainsKey('srcport') ) { $payload.Add('srcport', $srcport) } if ( $PSBoundParameters.ContainsKey('srcportop') ) { $payload.Add('srcportop', $srcportop) } if ( $PSBoundParameters.ContainsKey('srcportval') ) { $payload.Add('srcportval', $srcportval) } if ( $PSBoundParameters.ContainsKey('destipv6') ) { $payload.Add('destipv6', $destipv6) } if ( $PSBoundParameters.ContainsKey('destipop') ) { $payload.Add('destipop', $destipop) } if ( $PSBoundParameters.ContainsKey('destipv6val') ) { $payload.Add('destipv6val', $destipv6val) } if ( $PSBoundParameters.ContainsKey('destport') ) { $payload.Add('destport', $destport) } if ( $PSBoundParameters.ContainsKey('destportop') ) { $payload.Add('destportop', $destportop) } if ( $PSBoundParameters.ContainsKey('destportval') ) { $payload.Add('destportval', $destportval) } if ( $PSBoundParameters.ContainsKey('srcmac') ) { $payload.Add('srcmac', $srcmac) } if ( $PSBoundParameters.ContainsKey('srcmacmask') ) { $payload.Add('srcmacmask', $srcmacmask) } if ( $PSBoundParameters.ContainsKey('protocol') ) { $payload.Add('protocol', $protocol) } if ( $PSBoundParameters.ContainsKey('protocolnumber') ) { $payload.Add('protocolnumber', $protocolnumber) } if ( $PSBoundParameters.ContainsKey('vlan') ) { $payload.Add('vlan', $vlan) } if ( $PSBoundParameters.ContainsKey('vxlan') ) { $payload.Add('vxlan', $vxlan) } if ( $PSBoundParameters.ContainsKey('Interface') ) { $payload.Add('Interface', $Interface) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('msr') ) { $payload.Add('msr', $msr) } if ( $PSBoundParameters.ContainsKey('monitor') ) { $payload.Add('monitor', $monitor) } if ( $PSBoundParameters.ContainsKey('nexthop') ) { $payload.Add('nexthop', $nexthop) } if ( $PSBoundParameters.ContainsKey('nexthopval') ) { $payload.Add('nexthopval', $nexthopval) } if ( $PSBoundParameters.ContainsKey('iptunnel') ) { $payload.Add('iptunnel', $iptunnel) } if ( $PSBoundParameters.ContainsKey('vxlanvlanmap') ) { $payload.Add('vxlanvlanmap', $vxlanvlanmap) } if ( $PSBoundParameters.ContainsKey('nexthopvlan') ) { $payload.Add('nexthopvlan', $nexthopvlan) } if ( $PSCmdlet.ShouldProcess("nspbr6", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nspbr6 -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNspbr6 -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNspbr6: Finished" } } function Invoke-NSUnsetNspbr6 { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for PBR6 entry resource. .PARAMETER Name Name for the PBR6. Must begin with an ASCII alphabetic or underscore \(_\) character, and must contain only ASCII alphanumeric, underscore, hash \(\#\), period \(.\), space, colon \(:\), at \(@\), equals \(=\), and hyphen \(-\) characters. Cannot be changed after the PBR6 is created. .PARAMETER Srcipv6 IP address or range of IP addresses to match against the source IP address of an outgoing IPv6 packet. In the command line interface, separate the range with a hyphen. .PARAMETER Srcport Port number or range of port numbers to match against the source port number of an outgoing IPv6 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. .PARAMETER Destipv6 IP address or range of IP addresses to match against the destination IP address of an outgoing IPv6 packet. In the command line interface, separate the range with a hyphen. .PARAMETER Destport Port number or range of port numbers to match against the destination port number of an outgoing IPv6 packet. In the command line interface, separate the range with a hyphen. For example: 40-90. Note: The destination port can be specified only for TCP and UDP protocols. .PARAMETER Srcmac MAC address to match against the source MAC address of an outgoing IPv6 packet. .PARAMETER Srcmacmask Used to define range of Source MAC address. It takes string of 0 and 1, 0s are for exact match and 1s for wildcard. For matching first 3 bytes of MAC address, srcMacMask value "000000111111". . .PARAMETER Protocol Protocol, identified by protocol name, to match against the protocol of an outgoing IPv6 packet. Possible values = ICMPV6, TCP, UDP, ICMP, IGMP, EGP, IGP, ARGUS, RDP, RSVP, EIGRP, L2TP, ISIS, GGP, IPoverIP, ST, CBT, BBN-RCC-M, NVP-II, PUP, EMCON, XNET, CHAOS, MUX, DCN-MEAS, HMP, PRM, XNS-IDP, TRUNK-1, TRUNK-2, LEAF-1, LEAF-2, IRTP, ISO-TP4, NETBLT, MFE-NSP, MERIT-INP, SEP, 3PC, IDPR, XTP, DDP, IDPR-CMTP, TP++, IL, IPv6, SDRP, IPv6-Route, IPv6-Frag, IDRP, GRE, MHRP, BNA, ESP, AH, I-NLSP, SWIPE, NARP, MOBILE, TLSP, SKIP, IPv6-NoNx, IPv6-Opts, Any-Host-Internal-Protocol, CFTP, Any-Local-Network, SAT-EXPAK, KRYPTOLAN, RVD, IPPC, Any-Distributed-File-System, TFTP, VISA, IPCV, CPNX, CPHB, WSN, PVP, BR-SAT-MO, SUN-ND, WB-MON, WB-EXPAK, ISO-IP, VMTP, SECURE-VM, VINES, TTP, NSFNET-IG, DGP, TCF, OSPFIGP, Sprite-RP, LARP, MTP, AX.25, IPIP, MICP, SCC-SP, ETHERIP, Any-Private-Encryption-Scheme, GMTP, IFMP, PNNI, PIM, ARIS, SCPS, QNX, A/N, IPComp, SNP, Compaq-Pe, IPX-in-IP, VRRP, PGM, Any-0-Hop-Protocol, ENCAP, DDX, IATP, STP, SRP, UTI, SMP, SM, PTP, FIRE, CRTP, CRUDP, SSCOPMCE, IPLT, SPS, PIPE, SCTP, FC, RSVP-E2E-IGNORE, Mobility-Header, UDPLite .PARAMETER Interface ID of an interface. The Citrix ADC compares the PBR6 only to the outgoing packets on the specified interface. If you do not specify a value, the appliance compares the PBR6 to the outgoing packets on all interfaces. .PARAMETER Vlan ID of the VLAN. The Citrix ADC compares the PBR6 only to the outgoing packets on the specified VLAN. If you do not specify an interface ID, the appliance compares the PBR6 to the outgoing packets on all VLANs. Maximum value = 4094 .PARAMETER Vxlan ID of the VXLAN. The Citrix ADC compares the PBR6 only to the outgoing packets on the specified VXLAN. If you do not specify an interface ID, the appliance compares the PBR6 to the outgoing packets on all VXLANs. Maximum value = 16777215 .PARAMETER Msr Monitor the route specified by the Next Hop parameter. Possible values = ENABLED, DISABLED .PARAMETER Monitor The name of the monitor.(Can be only of type ping or ARP ). .PARAMETER Nexthop IP address of the next hop router to which to send matching packets if action is set to ALLOW. This next hop should be directly reachable from the appliance. .PARAMETER Iptunnel The iptunnel name where packets need to be forwarded upon. .PARAMETER Nexthopvlan VLAN number to be used for link local nexthop . Maximum value = 4094 .PARAMETER Vxlanvlanmap The vlan to vxlan mapping to be applied for incoming packets over this pbr tunnel. .EXAMPLE PS C:\>Invoke-NSUnsetNspbr6 -name <string> An example how to unset nspbr6 config Object(s). .NOTES File Name : Invoke-NSUnsetNspbr6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspbr6 Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [Boolean]$srcipv6, [Boolean]$srcport, [Boolean]$destipv6, [Boolean]$destport, [Boolean]$srcmac, [Boolean]$srcmacmask, [Boolean]$protocol, [Boolean]$Interface, [Boolean]$vlan, [Boolean]$vxlan, [Boolean]$msr, [Boolean]$monitor, [Boolean]$nexthop, [Boolean]$iptunnel, [Boolean]$nexthopvlan, [Boolean]$vxlanvlanmap ) begin { Write-Verbose "Invoke-NSUnsetNspbr6: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('srcipv6') ) { $payload.Add('srcipv6', $srcipv6) } if ( $PSBoundParameters.ContainsKey('srcport') ) { $payload.Add('srcport', $srcport) } if ( $PSBoundParameters.ContainsKey('destipv6') ) { $payload.Add('destipv6', $destipv6) } if ( $PSBoundParameters.ContainsKey('destport') ) { $payload.Add('destport', $destport) } if ( $PSBoundParameters.ContainsKey('srcmac') ) { $payload.Add('srcmac', $srcmac) } if ( $PSBoundParameters.ContainsKey('srcmacmask') ) { $payload.Add('srcmacmask', $srcmacmask) } if ( $PSBoundParameters.ContainsKey('protocol') ) { $payload.Add('protocol', $protocol) } if ( $PSBoundParameters.ContainsKey('Interface') ) { $payload.Add('Interface', $Interface) } if ( $PSBoundParameters.ContainsKey('vlan') ) { $payload.Add('vlan', $vlan) } if ( $PSBoundParameters.ContainsKey('vxlan') ) { $payload.Add('vxlan', $vxlan) } if ( $PSBoundParameters.ContainsKey('msr') ) { $payload.Add('msr', $msr) } if ( $PSBoundParameters.ContainsKey('monitor') ) { $payload.Add('monitor', $monitor) } if ( $PSBoundParameters.ContainsKey('nexthop') ) { $payload.Add('nexthop', $nexthop) } if ( $PSBoundParameters.ContainsKey('iptunnel') ) { $payload.Add('iptunnel', $iptunnel) } if ( $PSBoundParameters.ContainsKey('nexthopvlan') ) { $payload.Add('nexthopvlan', $nexthopvlan) } if ( $PSBoundParameters.ContainsKey('vxlanvlanmap') ) { $payload.Add('vxlanvlanmap', $vxlanvlanmap) } if ( $PSCmdlet.ShouldProcess("$name", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nspbr6 -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNspbr6: Finished" } } function Invoke-NSEnableNspbr6 { <# .SYNOPSIS Enable System/Global level configuration. config Object. .DESCRIPTION Configuration for PBR6 entry resource. .PARAMETER Name Name for the PBR6. Must begin with an ASCII alphabetic or underscore \(_\) character, and must contain only ASCII alphanumeric, underscore, hash \(\#\), period \(.\), space, colon \(:\), at \(@\), equals \(=\), and hyphen \(-\) characters. Cannot be changed after the PBR6 is created. .EXAMPLE PS C:\>Invoke-NSEnableNspbr6 -name <string> An example how to enable nspbr6 config Object(s). .NOTES File Name : Invoke-NSEnableNspbr6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspbr6/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Name ) begin { Write-Verbose "Invoke-NSEnableNspbr6: Starting" } process { try { $payload = @{ name = $name } if ( $PSCmdlet.ShouldProcess($Name, "Enable System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nspbr6 -Action enable -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSEnableNspbr6: Finished" } } function Invoke-NSDisableNspbr6 { <# .SYNOPSIS Disable System/Global level configuration. config Object. .DESCRIPTION Configuration for PBR6 entry resource. .PARAMETER Name Name for the PBR6. Must begin with an ASCII alphabetic or underscore \(_\) character, and must contain only ASCII alphanumeric, underscore, hash \(\#\), period \(.\), space, colon \(:\), at \(@\), equals \(=\), and hyphen \(-\) characters. Cannot be changed after the PBR6 is created. .EXAMPLE PS C:\>Invoke-NSDisableNspbr6 -name <string> An example how to disable nspbr6 config Object(s). .NOTES File Name : Invoke-NSDisableNspbr6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspbr6/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Name ) begin { Write-Verbose "Invoke-NSDisableNspbr6: Starting" } process { try { $payload = @{ name = $name } if ( $PSCmdlet.ShouldProcess($Name, "Disable System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nspbr6 -Action disable -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDisableNspbr6: Finished" } } function Invoke-NSClearNspbr6 { <# .SYNOPSIS Clear System/Global level configuration. config Object. .DESCRIPTION Configuration for PBR6 entry resource. .EXAMPLE PS C:\>Invoke-NSClearNspbr6 An example how to clear nspbr6 config Object(s). .NOTES File Name : Invoke-NSClearNspbr6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspbr6/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession) ) begin { Write-Verbose "Invoke-NSClearNspbr6: Starting" } process { try { $payload = @{ } if ( $PSCmdlet.ShouldProcess($Name, "Clear System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nspbr6 -Action clear -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSClearNspbr6: Finished" } } function Invoke-NSApplyNspbr6 { <# .SYNOPSIS Apply System/Global level configuration. config Object. .DESCRIPTION Configuration for PBR6 entry resource. .EXAMPLE PS C:\>Invoke-NSApplyNspbr6 An example how to apply nspbr6 config Object(s). .NOTES File Name : Invoke-NSApplyNspbr6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspbr6/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession) ) begin { Write-Verbose "Invoke-NSApplyNspbr6: Starting" } process { try { $payload = @{ } if ( $PSCmdlet.ShouldProcess($Name, "Apply System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nspbr6 -Action apply -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSApplyNspbr6: Finished" } } function Invoke-NSGetNspbr6 { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for PBR6 entry resource. .PARAMETER Name Name for the PBR6. Must begin with an ASCII alphabetic or underscore \(_\) character, and must contain only ASCII alphanumeric, underscore, hash \(\#\), period \(.\), space, colon \(:\), at \(@\), equals \(=\), and hyphen \(-\) characters. Cannot be changed after the PBR6 is created. .PARAMETER GetAll Retrieve all nspbr6 object(s). .PARAMETER Count If specified, the count of the nspbr6 object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNspbr6 Get data. .EXAMPLE PS C:\>Invoke-NSGetNspbr6 -GetAll Get all nspbr6 data. .EXAMPLE PS C:\>Invoke-NSGetNspbr6 -Count Get the number of nspbr6 objects. .EXAMPLE PS C:\>Invoke-NSGetNspbr6 -name <string> Get nspbr6 object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNspbr6 -Filter @{ 'name'='<value>' } Get nspbr6 data with a filter. .NOTES File Name : Invoke-NSGetNspbr6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspbr6/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNspbr6: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nspbr6 objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspbr6 -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nspbr6 objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspbr6 -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nspbr6 objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspbr6 -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nspbr6 configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspbr6 -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nspbr6 configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nspbr6 -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNspbr6: Ended" } } function Invoke-NSRenumberNspbrs { <# .SYNOPSIS Renumber System/Global level configuration. config Object. .DESCRIPTION Configuration for Policy based routing resource. .EXAMPLE PS C:\>Invoke-NSRenumberNspbrs An example how to renumber nspbrs config Object(s). .NOTES File Name : Invoke-NSRenumberNspbrs Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspbrs/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession) ) begin { Write-Verbose "Invoke-NSRenumberNspbrs: Starting" } process { try { $payload = @{ } if ( $PSCmdlet.ShouldProcess($Name, "Renumber System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nspbrs -Action renumber -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSRenumberNspbrs: Finished" } } function Invoke-NSClearNspbrs { <# .SYNOPSIS Clear System/Global level configuration. config Object. .DESCRIPTION Configuration for Policy based routing resource. .EXAMPLE PS C:\>Invoke-NSClearNspbrs An example how to clear nspbrs config Object(s). .NOTES File Name : Invoke-NSClearNspbrs Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspbrs/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession) ) begin { Write-Verbose "Invoke-NSClearNspbrs: Starting" } process { try { $payload = @{ } if ( $PSCmdlet.ShouldProcess($Name, "Clear System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nspbrs -Action clear -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSClearNspbrs: Finished" } } function Invoke-NSApplyNspbrs { <# .SYNOPSIS Apply System/Global level configuration. config Object. .DESCRIPTION Configuration for Policy based routing resource. .EXAMPLE PS C:\>Invoke-NSApplyNspbrs An example how to apply nspbrs config Object(s). .NOTES File Name : Invoke-NSApplyNspbrs Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nspbrs/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession) ) begin { Write-Verbose "Invoke-NSApplyNspbrs: Starting" } process { try { $payload = @{ } if ( $PSCmdlet.ShouldProcess($Name, "Apply System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nspbrs -Action apply -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSApplyNspbrs: Finished" } } function Invoke-NSUpdateNsratecontrol { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for rate control resource. .PARAMETER Tcpthreshold Number of SYNs permitted per 10 milliseconds. .PARAMETER Udpthreshold Number of UDP packets permitted per 10 milliseconds. .PARAMETER Icmpthreshold Number of ICMP packets permitted per 10 milliseconds. .PARAMETER Tcprstthreshold The number of TCP RST packets permitted per 10 milli second. zero means rate control is disabled and 0xffffffff means every thing is rate controlled. .EXAMPLE PS C:\>Invoke-NSUpdateNsratecontrol An example how to update nsratecontrol config Object(s). .NOTES File Name : Invoke-NSUpdateNsratecontrol Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsratecontrol/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [double]$Tcpthreshold, [double]$Udpthreshold, [double]$Icmpthreshold, [double]$Tcprstthreshold ) begin { Write-Verbose "Invoke-NSUpdateNsratecontrol: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('tcpthreshold') ) { $payload.Add('tcpthreshold', $tcpthreshold) } if ( $PSBoundParameters.ContainsKey('udpthreshold') ) { $payload.Add('udpthreshold', $udpthreshold) } if ( $PSBoundParameters.ContainsKey('icmpthreshold') ) { $payload.Add('icmpthreshold', $icmpthreshold) } if ( $PSBoundParameters.ContainsKey('tcprstthreshold') ) { $payload.Add('tcprstthreshold', $tcprstthreshold) } if ( $PSCmdlet.ShouldProcess("nsratecontrol", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nsratecontrol -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNsratecontrol: Finished" } } function Invoke-NSUnsetNsratecontrol { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for rate control resource. .PARAMETER Tcpthreshold Number of SYNs permitted per 10 milliseconds. .PARAMETER Udpthreshold Number of UDP packets permitted per 10 milliseconds. .PARAMETER Icmpthreshold Number of ICMP packets permitted per 10 milliseconds. .PARAMETER Tcprstthreshold The number of TCP RST packets permitted per 10 milli second. zero means rate control is disabled and 0xffffffff means every thing is rate controlled. .EXAMPLE PS C:\>Invoke-NSUnsetNsratecontrol An example how to unset nsratecontrol config Object(s). .NOTES File Name : Invoke-NSUnsetNsratecontrol Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsratecontrol Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Boolean]$tcpthreshold, [Boolean]$udpthreshold, [Boolean]$icmpthreshold, [Boolean]$tcprstthreshold ) begin { Write-Verbose "Invoke-NSUnsetNsratecontrol: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('tcpthreshold') ) { $payload.Add('tcpthreshold', $tcpthreshold) } if ( $PSBoundParameters.ContainsKey('udpthreshold') ) { $payload.Add('udpthreshold', $udpthreshold) } if ( $PSBoundParameters.ContainsKey('icmpthreshold') ) { $payload.Add('icmpthreshold', $icmpthreshold) } if ( $PSBoundParameters.ContainsKey('tcprstthreshold') ) { $payload.Add('tcprstthreshold', $tcprstthreshold) } if ( $PSCmdlet.ShouldProcess("nsratecontrol", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nsratecontrol -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNsratecontrol: Finished" } } function Invoke-NSGetNsratecontrol { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for rate control resource. .PARAMETER GetAll Retrieve all nsratecontrol object(s). .PARAMETER Count If specified, the count of the nsratecontrol object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsratecontrol Get data. .EXAMPLE PS C:\>Invoke-NSGetNsratecontrol -GetAll Get all nsratecontrol data. .EXAMPLE PS C:\>Invoke-NSGetNsratecontrol -name <string> Get nsratecontrol object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsratecontrol -Filter @{ 'name'='<value>' } Get nsratecontrol data with a filter. .NOTES File Name : Invoke-NSGetNsratecontrol Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsratecontrol/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNsratecontrol: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsratecontrol objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsratecontrol -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsratecontrol objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsratecontrol -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsratecontrol objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsratecontrol -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsratecontrol configuration for property ''" } else { Write-Verbose "Retrieving nsratecontrol configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsratecontrol -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsratecontrol: Ended" } } function Invoke-NSGetNsrollbackcmd { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for Generate rollback commands resource. .PARAMETER Filename File that contains the commands for which the rollback commands must be generated. Specify the full path of the file name. .PARAMETER Outtype Format in which the rollback commands must be generated. Possible values = cli, xml .PARAMETER GetAll Retrieve all nsrollbackcmd object(s). .PARAMETER Count If specified, the count of the nsrollbackcmd object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsrollbackcmd Get data. .EXAMPLE PS C:\>Invoke-NSGetNsrollbackcmd -GetAll Get all nsrollbackcmd data. .EXAMPLE PS C:\>Invoke-NSGetNsrollbackcmd -name <string> Get nsrollbackcmd object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsrollbackcmd -Filter @{ 'name'='<value>' } Get nsrollbackcmd data with a filter. .NOTES File Name : Invoke-NSGetNsrollbackcmd Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsrollbackcmd/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByArgument')] [string]$Filename, [Parameter(ParameterSetName = 'GetByArgument')] [ValidateSet('cli', 'xml')] [string]$Outtype, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNsrollbackcmd: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsrollbackcmd objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsrollbackcmd -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsrollbackcmd objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsrollbackcmd -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsrollbackcmd objects by arguments" $arguments = @{ } if ( $PSBoundParameters.ContainsKey('filename') ) { $arguments.Add('filename', $filename) } if ( $PSBoundParameters.ContainsKey('outtype') ) { $arguments.Add('outtype', $outtype) } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsrollbackcmd -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsrollbackcmd configuration for property ''" } else { Write-Verbose "Retrieving nsrollbackcmd configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsrollbackcmd -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsrollbackcmd: Ended" } } function Invoke-NSUpdateNsrpcnode { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for rpc node resource. .PARAMETER Ipaddress IP address of the node. This has to be in the same subnet as the NSIP address. .PARAMETER Password Password to be used in authentication with the peer system node. .PARAMETER Srcip Source IP address to be used to communicate with the peer system node. The default value is 0, which means that the appliance uses the NSIP address as the source IP address. .PARAMETER Secure State of the channel when talking to the node. Possible values = YES, NO .PARAMETER Validatecert validate the server certificate for secure SSL connections. Possible values = YES, NO .PARAMETER PassThru Return details about the created nsrpcnode item. .EXAMPLE PS C:\>Invoke-NSUpdateNsrpcnode -ipaddress <string> An example how to update nsrpcnode config Object(s). .NOTES File Name : Invoke-NSUpdateNsrpcnode Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsrpcnode/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Ipaddress, [ValidateScript({ $_.Length -gt 1 })] [string]$Password, [string]$Srcip, [ValidateSet('YES', 'NO')] [string]$Secure, [ValidateSet('YES', 'NO')] [string]$Validatecert, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateNsrpcnode: Starting" } process { try { $payload = @{ ipaddress = $ipaddress } if ( $PSBoundParameters.ContainsKey('password') ) { $payload.Add('password', $password) } if ( $PSBoundParameters.ContainsKey('srcip') ) { $payload.Add('srcip', $srcip) } if ( $PSBoundParameters.ContainsKey('secure') ) { $payload.Add('secure', $secure) } if ( $PSBoundParameters.ContainsKey('validatecert') ) { $payload.Add('validatecert', $validatecert) } if ( $PSCmdlet.ShouldProcess("nsrpcnode", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nsrpcnode -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNsrpcnode -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNsrpcnode: Finished" } } function Invoke-NSUnsetNsrpcnode { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for rpc node resource. .PARAMETER Ipaddress IP address of the node. This has to be in the same subnet as the NSIP address. .PARAMETER Password Password to be used in authentication with the peer system node. .PARAMETER Srcip Source IP address to be used to communicate with the peer system node. The default value is 0, which means that the appliance uses the NSIP address as the source IP address. .PARAMETER Secure State of the channel when talking to the node. Possible values = YES, NO .PARAMETER Validatecert validate the server certificate for secure SSL connections. Possible values = YES, NO .EXAMPLE PS C:\>Invoke-NSUnsetNsrpcnode -ipaddress <string> An example how to unset nsrpcnode config Object(s). .NOTES File Name : Invoke-NSUnsetNsrpcnode Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsrpcnode Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateScript({ $_.Length -gt 1 })] [string]$Ipaddress, [Boolean]$password, [Boolean]$srcip, [Boolean]$secure, [Boolean]$validatecert ) begin { Write-Verbose "Invoke-NSUnsetNsrpcnode: Starting" } process { try { $payload = @{ ipaddress = $ipaddress } if ( $PSBoundParameters.ContainsKey('password') ) { $payload.Add('password', $password) } if ( $PSBoundParameters.ContainsKey('srcip') ) { $payload.Add('srcip', $srcip) } if ( $PSBoundParameters.ContainsKey('secure') ) { $payload.Add('secure', $secure) } if ( $PSBoundParameters.ContainsKey('validatecert') ) { $payload.Add('validatecert', $validatecert) } if ( $PSCmdlet.ShouldProcess("$ipaddress", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nsrpcnode -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNsrpcnode: Finished" } } function Invoke-NSGetNsrpcnode { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for rpc node resource. .PARAMETER Ipaddress IP address of the node. This has to be in the same subnet as the NSIP address. .PARAMETER GetAll Retrieve all nsrpcnode object(s). .PARAMETER Count If specified, the count of the nsrpcnode object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsrpcnode Get data. .EXAMPLE PS C:\>Invoke-NSGetNsrpcnode -GetAll Get all nsrpcnode data. .EXAMPLE PS C:\>Invoke-NSGetNsrpcnode -Count Get the number of nsrpcnode objects. .EXAMPLE PS C:\>Invoke-NSGetNsrpcnode -name <string> Get nsrpcnode object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsrpcnode -Filter @{ 'name'='<value>' } Get nsrpcnode data with a filter. .NOTES File Name : Invoke-NSGetNsrpcnode Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsrpcnode/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateScript({ $_.Length -gt 1 })] [string]$Ipaddress, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNsrpcnode: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsrpcnode objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsrpcnode -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsrpcnode objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsrpcnode -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsrpcnode objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsrpcnode -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsrpcnode configuration for property 'ipaddress'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsrpcnode -NitroPath nitro/v1/config -Resource $ipaddress -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nsrpcnode configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsrpcnode -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsrpcnode: Ended" } } function Invoke-NSGetNsrunningconfig { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for running configuration resource. .PARAMETER Withdefaults Include default values of parameters that have not been explicitly configured. If this argument is disabled, such parameters are not included. .PARAMETER GetAll Retrieve all nsrunningconfig object(s). .PARAMETER Count If specified, the count of the nsrunningconfig object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsrunningconfig Get data. .EXAMPLE PS C:\>Invoke-NSGetNsrunningconfig -GetAll Get all nsrunningconfig data. .EXAMPLE PS C:\>Invoke-NSGetNsrunningconfig -name <string> Get nsrunningconfig object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsrunningconfig -Filter @{ 'name'='<value>' } Get nsrunningconfig data with a filter. .NOTES File Name : Invoke-NSGetNsrunningconfig Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsrunningconfig/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByArgument')] [boolean]$Withdefaults, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNsrunningconfig: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsrunningconfig objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsrunningconfig -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsrunningconfig objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsrunningconfig -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsrunningconfig objects by arguments" $arguments = @{ } if ( $PSBoundParameters.ContainsKey('withdefaults') ) { $arguments.Add('withdefaults', $withdefaults) } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsrunningconfig -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsrunningconfig configuration for property ''" } else { Write-Verbose "Retrieving nsrunningconfig configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsrunningconfig -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsrunningconfig: Ended" } } function Invoke-NSGetNssavedconfig { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for last saved configuration resource. .PARAMETER GetAll Retrieve all nssavedconfig object(s). .PARAMETER Count If specified, the count of the nssavedconfig object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNssavedconfig Get data. .EXAMPLE PS C:\>Invoke-NSGetNssavedconfig -GetAll Get all nssavedconfig data. .EXAMPLE PS C:\>Invoke-NSGetNssavedconfig -name <string> Get nssavedconfig object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNssavedconfig -Filter @{ 'name'='<value>' } Get nssavedconfig data with a filter. .NOTES File Name : Invoke-NSGetNssavedconfig Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nssavedconfig/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNssavedconfig: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nssavedconfig objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nssavedconfig -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nssavedconfig objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nssavedconfig -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nssavedconfig objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nssavedconfig -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nssavedconfig configuration for property ''" } else { Write-Verbose "Retrieving nssavedconfig configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nssavedconfig -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNssavedconfig: Ended" } } function Invoke-NSAddNsservicefunction { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Configuration for service Function resource. .PARAMETER Servicefunctionname Name of the service function to be created. Leading character must be a number or letter. Other characters allowed, after the first character, are @ _ - . (period) : (colon) # and space ( ). .PARAMETER Ingressvlan VLAN ID on which the traffic from service function reaches Citrix ADC. Maximum value = 4094 .PARAMETER PassThru Return details about the created nsservicefunction item. .EXAMPLE PS C:\>Invoke-NSAddNsservicefunction -servicefunctionname <string> -ingressvlan <double> An example how to add nsservicefunction config Object(s). .NOTES File Name : Invoke-NSAddNsservicefunction Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsservicefunction/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Servicefunctionname, [Parameter(Mandatory)] [double]$Ingressvlan, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNsservicefunction: Starting" } process { try { $payload = @{ servicefunctionname = $servicefunctionname ingressvlan = $ingressvlan } if ( $PSCmdlet.ShouldProcess("nsservicefunction", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsservicefunction -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNsservicefunction -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNsservicefunction: Finished" } } function Invoke-NSUpdateNsservicefunction { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for service Function resource. .PARAMETER Servicefunctionname Name of the service function to be created. Leading character must be a number or letter. Other characters allowed, after the first character, are @ _ - . (period) : (colon) # and space ( ). .PARAMETER Ingressvlan VLAN ID on which the traffic from service function reaches Citrix ADC. Maximum value = 4094 .PARAMETER PassThru Return details about the created nsservicefunction item. .EXAMPLE PS C:\>Invoke-NSUpdateNsservicefunction -servicefunctionname <string> An example how to update nsservicefunction config Object(s). .NOTES File Name : Invoke-NSUpdateNsservicefunction Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsservicefunction/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Servicefunctionname, [double]$Ingressvlan, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateNsservicefunction: Starting" } process { try { $payload = @{ servicefunctionname = $servicefunctionname } if ( $PSBoundParameters.ContainsKey('ingressvlan') ) { $payload.Add('ingressvlan', $ingressvlan) } if ( $PSCmdlet.ShouldProcess("nsservicefunction", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nsservicefunction -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNsservicefunction -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNsservicefunction: Finished" } } function Invoke-NSDeleteNsservicefunction { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Configuration for service Function resource. .PARAMETER Servicefunctionname Name of the service function to be created. Leading character must be a number or letter. Other characters allowed, after the first character, are @ _ - . (period) : (colon) # and space ( ). .EXAMPLE PS C:\>Invoke-NSDeleteNsservicefunction -Servicefunctionname <string> An example how to delete nsservicefunction config Object(s). .NOTES File Name : Invoke-NSDeleteNsservicefunction Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsservicefunction/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Servicefunctionname ) begin { Write-Verbose "Invoke-NSDeleteNsservicefunction: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$servicefunctionname", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nsservicefunction -NitroPath nitro/v1/config -Resource $servicefunctionname -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNsservicefunction: Finished" } } function Invoke-NSGetNsservicefunction { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for service Function resource. .PARAMETER Servicefunctionname Name of the service function to be created. Leading character must be a number or letter. Other characters allowed, after the first character, are @ _ - . (period) : (colon) # and space ( ). .PARAMETER GetAll Retrieve all nsservicefunction object(s). .PARAMETER Count If specified, the count of the nsservicefunction object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsservicefunction Get data. .EXAMPLE PS C:\>Invoke-NSGetNsservicefunction -GetAll Get all nsservicefunction data. .EXAMPLE PS C:\>Invoke-NSGetNsservicefunction -Count Get the number of nsservicefunction objects. .EXAMPLE PS C:\>Invoke-NSGetNsservicefunction -name <string> Get nsservicefunction object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsservicefunction -Filter @{ 'name'='<value>' } Get nsservicefunction data with a filter. .NOTES File Name : Invoke-NSGetNsservicefunction Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsservicefunction/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateScript({ $_.Length -gt 1 })] [string]$Servicefunctionname, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNsservicefunction: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsservicefunction objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsservicefunction -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsservicefunction objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsservicefunction -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsservicefunction objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsservicefunction -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsservicefunction configuration for property 'servicefunctionname'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsservicefunction -NitroPath nitro/v1/config -Resource $servicefunctionname -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nsservicefunction configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsservicefunction -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsservicefunction: Ended" } } function Invoke-NSAddNsservicepath { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Configuration for service Chain resource. .PARAMETER Servicepathname Name for the Service path. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER PassThru Return details about the created nsservicepath item. .EXAMPLE PS C:\>Invoke-NSAddNsservicepath -servicepathname <string> An example how to add nsservicepath config Object(s). .NOTES File Name : Invoke-NSAddNsservicepath Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsservicepath/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Servicepathname, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNsservicepath: Starting" } process { try { $payload = @{ servicepathname = $servicepathname } if ( $PSCmdlet.ShouldProcess("nsservicepath", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsservicepath -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNsservicepath -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNsservicepath: Finished" } } function Invoke-NSDeleteNsservicepath { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Configuration for service Chain resource. .PARAMETER Servicepathname Name for the Service path. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .EXAMPLE PS C:\>Invoke-NSDeleteNsservicepath -Servicepathname <string> An example how to delete nsservicepath config Object(s). .NOTES File Name : Invoke-NSDeleteNsservicepath Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsservicepath/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Servicepathname ) begin { Write-Verbose "Invoke-NSDeleteNsservicepath: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$servicepathname", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nsservicepath -NitroPath nitro/v1/config -Resource $servicepathname -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNsservicepath: Finished" } } function Invoke-NSGetNsservicepath { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for service Chain resource. .PARAMETER Servicepathname Name for the Service path. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER GetAll Retrieve all nsservicepath object(s). .PARAMETER Count If specified, the count of the nsservicepath object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsservicepath Get data. .EXAMPLE PS C:\>Invoke-NSGetNsservicepath -GetAll Get all nsservicepath data. .EXAMPLE PS C:\>Invoke-NSGetNsservicepath -Count Get the number of nsservicepath objects. .EXAMPLE PS C:\>Invoke-NSGetNsservicepath -name <string> Get nsservicepath object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsservicepath -Filter @{ 'name'='<value>' } Get nsservicepath data with a filter. .NOTES File Name : Invoke-NSGetNsservicepath Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsservicepath/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateScript({ $_.Length -gt 1 })] [string]$Servicepathname, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNsservicepath: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsservicepath objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsservicepath -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsservicepath objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsservicepath -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsservicepath objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsservicepath -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsservicepath configuration for property 'servicepathname'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsservicepath -NitroPath nitro/v1/config -Resource $servicepathname -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nsservicepath configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsservicepath -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsservicepath: Ended" } } function Invoke-NSGetNsservicepathBinding { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Binding object which returns the resources bound to nsservicepath. .PARAMETER Servicepathname Name for the Service path. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER GetAll Retrieve all nsservicepath_binding object(s). .PARAMETER Count If specified, the count of the nsservicepath_binding object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsservicepathBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetNsservicepathBinding -GetAll Get all nsservicepath_binding data. .EXAMPLE PS C:\>Invoke-NSGetNsservicepathBinding -name <string> Get nsservicepath_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsservicepathBinding -Filter @{ 'name'='<value>' } Get nsservicepath_binding data with a filter. .NOTES File Name : Invoke-NSGetNsservicepathBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsservicepath_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateScript({ $_.Length -gt 1 })] [string]$Servicepathname, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNsservicepathBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all nsservicepath_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsservicepath_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsservicepath_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsservicepath_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsservicepath_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsservicepath_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsservicepath_binding configuration for property 'servicepathname'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsservicepath_binding -NitroPath nitro/v1/config -Resource $servicepathname -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nsservicepath_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsservicepath_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsservicepathBinding: Ended" } } function Invoke-NSAddNsservicepathNsservicefunctionBinding { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Binding object showing the nsservicefunction that can be bound to nsservicepath. .PARAMETER Servicepathname Name for the Service path. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER Servicefunction List of service functions constituting the chain. .PARAMETER Index The serviceindex of each servicefunction in path. .PARAMETER PassThru Return details about the created nsservicepath_nsservicefunction_binding item. .EXAMPLE PS C:\>Invoke-NSAddNsservicepathNsservicefunctionBinding -servicepathname <string> -servicefunction <string> -index <double> An example how to add nsservicepath_nsservicefunction_binding config Object(s). .NOTES File Name : Invoke-NSAddNsservicepathNsservicefunctionBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsservicepath_nsservicefunction_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Servicepathname, [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Servicefunction, [Parameter(Mandatory)] [double]$Index, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNsservicepathNsservicefunctionBinding: Starting" } process { try { $payload = @{ servicepathname = $servicepathname servicefunction = $servicefunction index = $index } if ( $PSCmdlet.ShouldProcess("nsservicepath_nsservicefunction_binding", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nsservicepath_nsservicefunction_binding -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNsservicepathNsservicefunctionBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNsservicepathNsservicefunctionBinding: Finished" } } function Invoke-NSDeleteNsservicepathNsservicefunctionBinding { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Binding object showing the nsservicefunction that can be bound to nsservicepath. .PARAMETER Servicepathname Name for the Service path. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER Servicefunction List of service functions constituting the chain. .EXAMPLE PS C:\>Invoke-NSDeleteNsservicepathNsservicefunctionBinding -Servicepathname <string> An example how to delete nsservicepath_nsservicefunction_binding config Object(s). .NOTES File Name : Invoke-NSDeleteNsservicepathNsservicefunctionBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsservicepath_nsservicefunction_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Servicepathname, [string]$Servicefunction ) begin { Write-Verbose "Invoke-NSDeleteNsservicepathNsservicefunctionBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Servicefunction') ) { $arguments.Add('servicefunction', $Servicefunction) } if ( $PSCmdlet.ShouldProcess("$servicepathname", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nsservicepath_nsservicefunction_binding -NitroPath nitro/v1/config -Resource $servicepathname -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNsservicepathNsservicefunctionBinding: Finished" } } function Invoke-NSGetNsservicepathNsservicefunctionBinding { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Binding object showing the nsservicefunction that can be bound to nsservicepath. .PARAMETER Servicepathname Name for the Service path. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. .PARAMETER GetAll Retrieve all nsservicepath_nsservicefunction_binding object(s). .PARAMETER Count If specified, the count of the nsservicepath_nsservicefunction_binding object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsservicepathNsservicefunctionBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetNsservicepathNsservicefunctionBinding -GetAll Get all nsservicepath_nsservicefunction_binding data. .EXAMPLE PS C:\>Invoke-NSGetNsservicepathNsservicefunctionBinding -Count Get the number of nsservicepath_nsservicefunction_binding objects. .EXAMPLE PS C:\>Invoke-NSGetNsservicepathNsservicefunctionBinding -name <string> Get nsservicepath_nsservicefunction_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsservicepathNsservicefunctionBinding -Filter @{ 'name'='<value>' } Get nsservicepath_nsservicefunction_binding data with a filter. .NOTES File Name : Invoke-NSGetNsservicepathNsservicefunctionBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsservicepath_nsservicefunction_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Servicepathname, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNsservicepathNsservicefunctionBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all nsservicepath_nsservicefunction_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsservicepath_nsservicefunction_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsservicepath_nsservicefunction_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsservicepath_nsservicefunction_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsservicepath_nsservicefunction_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsservicepath_nsservicefunction_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsservicepath_nsservicefunction_binding configuration for property 'servicepathname'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsservicepath_nsservicefunction_binding -NitroPath nitro/v1/config -Resource $servicepathname -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nsservicepath_nsservicefunction_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsservicepath_nsservicefunction_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsservicepathNsservicefunctionBinding: Ended" } } function Invoke-NSAddNssimpleacl { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Configuration for simple ACL resource. .PARAMETER Aclname Name for the simple ACL rule. Must begin with an ASCII alphabetic or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the simple ACL rule is created. .PARAMETER Aclaction Drop incoming IPv4 packets that match the simple ACL rule. Possible values = DENY .PARAMETER Td Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0. Maximum value = 4094 .PARAMETER Srcip IP address to match against the source IP address of an incoming IPv4 packet. .PARAMETER Destport Port number to match against the destination port number of an incoming IPv4 packet. DestPort is mandatory while setting Protocol. Omitting the port number and protocol creates an all-ports and all protocols simple ACL rule, which matches any port and any protocol. In that case, you cannot create another simple ACL rule specifying a specific port and the same source IPv4 address. Maximum value = 65535 .PARAMETER Protocol Protocol to match against the protocol of an incoming IPv4 packet. You must set this parameter if you have set the Destination Port parameter. Possible values = TCP, UDP .PARAMETER Ttl Number of seconds, in multiples of four, after which the simple ACL rule expires. If you do not want the simple ACL rule to expire, do not specify a TTL value. Maximum value = 2147483647 .PARAMETER PassThru Return details about the created nssimpleacl item. .EXAMPLE PS C:\>Invoke-NSAddNssimpleacl -aclname <string> -aclaction <string> -srcip <string> An example how to add nssimpleacl config Object(s). .NOTES File Name : Invoke-NSAddNssimpleacl Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nssimpleacl/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Aclname, [Parameter(Mandatory)] [ValidateSet('DENY')] [string]$Aclaction, [double]$Td, [Parameter(Mandatory)] [string]$Srcip, [int]$Destport, [ValidateSet('TCP', 'UDP')] [string]$Protocol, [double]$Ttl, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNssimpleacl: Starting" } process { try { $payload = @{ aclname = $aclname aclaction = $aclaction srcip = $srcip } if ( $PSBoundParameters.ContainsKey('td') ) { $payload.Add('td', $td) } if ( $PSBoundParameters.ContainsKey('destport') ) { $payload.Add('destport', $destport) } if ( $PSBoundParameters.ContainsKey('protocol') ) { $payload.Add('protocol', $protocol) } if ( $PSBoundParameters.ContainsKey('ttl') ) { $payload.Add('ttl', $ttl) } if ( $PSCmdlet.ShouldProcess("nssimpleacl", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nssimpleacl -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNssimpleacl -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNssimpleacl: Finished" } } function Invoke-NSClearNssimpleacl { <# .SYNOPSIS Clear System/Global level configuration. config Object. .DESCRIPTION Configuration for simple ACL resource. .EXAMPLE PS C:\>Invoke-NSClearNssimpleacl An example how to clear nssimpleacl config Object(s). .NOTES File Name : Invoke-NSClearNssimpleacl Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nssimpleacl/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession) ) begin { Write-Verbose "Invoke-NSClearNssimpleacl: Starting" } process { try { $payload = @{ } if ( $PSCmdlet.ShouldProcess($Name, "Clear System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nssimpleacl -Action clear -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSClearNssimpleacl: Finished" } } function Invoke-NSDeleteNssimpleacl { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Configuration for simple ACL resource. .PARAMETER Aclname Name for the simple ACL rule. Must begin with an ASCII alphabetic or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the simple ACL rule is created. .EXAMPLE PS C:\>Invoke-NSDeleteNssimpleacl -Aclname <string> An example how to delete nssimpleacl config Object(s). .NOTES File Name : Invoke-NSDeleteNssimpleacl Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nssimpleacl/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Aclname ) begin { Write-Verbose "Invoke-NSDeleteNssimpleacl: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$aclname", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nssimpleacl -NitroPath nitro/v1/config -Resource $aclname -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNssimpleacl: Finished" } } function Invoke-NSFlushNssimpleacl { <# .SYNOPSIS Flush System/Global level configuration. config Object. .DESCRIPTION Configuration for simple ACL resource. .PARAMETER Estsessions . .EXAMPLE PS C:\>Invoke-NSFlushNssimpleacl -estsessions <boolean> An example how to flush nssimpleacl config Object(s). .NOTES File Name : Invoke-NSFlushNssimpleacl Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nssimpleacl/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [boolean]$Estsessions ) begin { Write-Verbose "Invoke-NSFlushNssimpleacl: Starting" } process { try { $payload = @{ estsessions = $estsessions } if ( $PSCmdlet.ShouldProcess($Name, "Flush System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nssimpleacl -Action flush -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSFlushNssimpleacl: Finished" } } function Invoke-NSGetNssimpleacl { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for simple ACL resource. .PARAMETER Aclname Name for the simple ACL rule. Must begin with an ASCII alphabetic or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the simple ACL rule is created. .PARAMETER GetAll Retrieve all nssimpleacl object(s). .PARAMETER Count If specified, the count of the nssimpleacl object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNssimpleacl Get data. .EXAMPLE PS C:\>Invoke-NSGetNssimpleacl -GetAll Get all nssimpleacl data. .EXAMPLE PS C:\>Invoke-NSGetNssimpleacl -Count Get the number of nssimpleacl objects. .EXAMPLE PS C:\>Invoke-NSGetNssimpleacl -name <string> Get nssimpleacl object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNssimpleacl -Filter @{ 'name'='<value>' } Get nssimpleacl data with a filter. .NOTES File Name : Invoke-NSGetNssimpleacl Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nssimpleacl/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Aclname, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNssimpleacl: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nssimpleacl objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nssimpleacl -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nssimpleacl objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nssimpleacl -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nssimpleacl objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nssimpleacl -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nssimpleacl configuration for property 'aclname'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nssimpleacl -NitroPath nitro/v1/config -Resource $aclname -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nssimpleacl configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nssimpleacl -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNssimpleacl: Ended" } } function Invoke-NSAddNssimpleacl6 { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Configuration for simple ACL6 resource. .PARAMETER Aclname Name for the simple ACL6 rule. Must begin with an ASCII alphabetic or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the simple ACL6 rule is created. .PARAMETER Td Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0. Maximum value = 4094 .PARAMETER Aclaction Drop incoming IPv6 packets that match the simple ACL6 rule. Possible values = DENY .PARAMETER Srcipv6 IP address to match against the source IP address of an incoming IPv6 packet. .PARAMETER Destport Port number to match against the destination port number of an incoming IPv6 packet. DestPort is mandatory while setting Protocol. Omitting the port number and protocol creates an all-ports and all protocol simple ACL6 rule, which matches any port and any protocol. In that case, you cannot create another simple ACL6 rule specifying a specific port and the same source IPv6 address. Maximum value = 65535 .PARAMETER Protocol Protocol to match against the protocol of an incoming IPv6 packet. You must set this parameter if you set the Destination Port parameter. Possible values = TCP, UDP .PARAMETER Ttl Number of seconds, in multiples of four, after which the simple ACL6 rule expires. If you do not want the simple ACL6 rule to expire, do not specify a TTL value. Maximum value = 2147483647 .PARAMETER PassThru Return details about the created nssimpleacl6 item. .EXAMPLE PS C:\>Invoke-NSAddNssimpleacl6 -aclname <string> -aclaction <string> -srcipv6 <string> An example how to add nssimpleacl6 config Object(s). .NOTES File Name : Invoke-NSAddNssimpleacl6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nssimpleacl6/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Aclname, [double]$Td, [Parameter(Mandatory)] [ValidateSet('DENY')] [string]$Aclaction, [Parameter(Mandatory)] [string]$Srcipv6, [int]$Destport, [ValidateSet('TCP', 'UDP')] [string]$Protocol, [double]$Ttl, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNssimpleacl6: Starting" } process { try { $payload = @{ aclname = $aclname aclaction = $aclaction srcipv6 = $srcipv6 } if ( $PSBoundParameters.ContainsKey('td') ) { $payload.Add('td', $td) } if ( $PSBoundParameters.ContainsKey('destport') ) { $payload.Add('destport', $destport) } if ( $PSBoundParameters.ContainsKey('protocol') ) { $payload.Add('protocol', $protocol) } if ( $PSBoundParameters.ContainsKey('ttl') ) { $payload.Add('ttl', $ttl) } if ( $PSCmdlet.ShouldProcess("nssimpleacl6", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nssimpleacl6 -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNssimpleacl6 -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNssimpleacl6: Finished" } } function Invoke-NSClearNssimpleacl6 { <# .SYNOPSIS Clear System/Global level configuration. config Object. .DESCRIPTION Configuration for simple ACL6 resource. .EXAMPLE PS C:\>Invoke-NSClearNssimpleacl6 An example how to clear nssimpleacl6 config Object(s). .NOTES File Name : Invoke-NSClearNssimpleacl6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nssimpleacl6/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession) ) begin { Write-Verbose "Invoke-NSClearNssimpleacl6: Starting" } process { try { $payload = @{ } if ( $PSCmdlet.ShouldProcess($Name, "Clear System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nssimpleacl6 -Action clear -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSClearNssimpleacl6: Finished" } } function Invoke-NSFlushNssimpleacl6 { <# .SYNOPSIS Flush System/Global level configuration. config Object. .DESCRIPTION Configuration for simple ACL6 resource. .PARAMETER Estsessions . .EXAMPLE PS C:\>Invoke-NSFlushNssimpleacl6 -estsessions <boolean> An example how to flush nssimpleacl6 config Object(s). .NOTES File Name : Invoke-NSFlushNssimpleacl6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nssimpleacl6/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [boolean]$Estsessions ) begin { Write-Verbose "Invoke-NSFlushNssimpleacl6: Starting" } process { try { $payload = @{ estsessions = $estsessions } if ( $PSCmdlet.ShouldProcess($Name, "Flush System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nssimpleacl6 -Action flush -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSFlushNssimpleacl6: Finished" } } function Invoke-NSDeleteNssimpleacl6 { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Configuration for simple ACL6 resource. .PARAMETER Aclname Name for the simple ACL6 rule. Must begin with an ASCII alphabetic or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the simple ACL6 rule is created. .EXAMPLE PS C:\>Invoke-NSDeleteNssimpleacl6 -Aclname <string> An example how to delete nssimpleacl6 config Object(s). .NOTES File Name : Invoke-NSDeleteNssimpleacl6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nssimpleacl6/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Aclname ) begin { Write-Verbose "Invoke-NSDeleteNssimpleacl6: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$aclname", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nssimpleacl6 -NitroPath nitro/v1/config -Resource $aclname -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNssimpleacl6: Finished" } } function Invoke-NSGetNssimpleacl6 { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for simple ACL6 resource. .PARAMETER Aclname Name for the simple ACL6 rule. Must begin with an ASCII alphabetic or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the simple ACL6 rule is created. .PARAMETER GetAll Retrieve all nssimpleacl6 object(s). .PARAMETER Count If specified, the count of the nssimpleacl6 object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNssimpleacl6 Get data. .EXAMPLE PS C:\>Invoke-NSGetNssimpleacl6 -GetAll Get all nssimpleacl6 data. .EXAMPLE PS C:\>Invoke-NSGetNssimpleacl6 -Count Get the number of nssimpleacl6 objects. .EXAMPLE PS C:\>Invoke-NSGetNssimpleacl6 -name <string> Get nssimpleacl6 object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNssimpleacl6 -Filter @{ 'name'='<value>' } Get nssimpleacl6 data with a filter. .NOTES File Name : Invoke-NSGetNssimpleacl6 Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nssimpleacl6/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Aclname, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNssimpleacl6: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nssimpleacl6 objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nssimpleacl6 -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nssimpleacl6 objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nssimpleacl6 -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nssimpleacl6 objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nssimpleacl6 -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nssimpleacl6 configuration for property 'aclname'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nssimpleacl6 -NitroPath nitro/v1/config -Resource $aclname -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nssimpleacl6 configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nssimpleacl6 -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNssimpleacl6: Ended" } } function Invoke-NSFlushNssourceroutecachetable { <# .SYNOPSIS Flush System/Global level configuration. config Object. .DESCRIPTION Configuration for Source IP Mac Cache Table. resource. .EXAMPLE PS C:\>Invoke-NSFlushNssourceroutecachetable An example how to flush nssourceroutecachetable config Object(s). .NOTES File Name : Invoke-NSFlushNssourceroutecachetable Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nssourceroutecachetable/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession) ) begin { Write-Verbose "Invoke-NSFlushNssourceroutecachetable: Starting" } process { try { $payload = @{ } if ( $PSCmdlet.ShouldProcess($Name, "Flush System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nssourceroutecachetable -Action flush -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSFlushNssourceroutecachetable: Finished" } } function Invoke-NSGetNssourceroutecachetable { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for Source IP Mac Cache Table. resource. .PARAMETER GetAll Retrieve all nssourceroutecachetable object(s). .PARAMETER Count If specified, the count of the nssourceroutecachetable object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNssourceroutecachetable Get data. .EXAMPLE PS C:\>Invoke-NSGetNssourceroutecachetable -GetAll Get all nssourceroutecachetable data. .EXAMPLE PS C:\>Invoke-NSGetNssourceroutecachetable -Count Get the number of nssourceroutecachetable objects. .EXAMPLE PS C:\>Invoke-NSGetNssourceroutecachetable -name <string> Get nssourceroutecachetable object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNssourceroutecachetable -Filter @{ 'name'='<value>' } Get nssourceroutecachetable data with a filter. .NOTES File Name : Invoke-NSGetNssourceroutecachetable Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nssourceroutecachetable/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNssourceroutecachetable: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nssourceroutecachetable objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nssourceroutecachetable -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nssourceroutecachetable objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nssourceroutecachetable -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nssourceroutecachetable objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nssourceroutecachetable -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nssourceroutecachetable configuration for property ''" } else { Write-Verbose "Retrieving nssourceroutecachetable configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nssourceroutecachetable -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNssourceroutecachetable: Ended" } } function Invoke-NSUpdateNsspparams { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for Surge Protection parameter resource. .PARAMETER Basethreshold Maximum number of server connections that can be opened before surge protection is activated. Maximum value = 32767 .PARAMETER Throttle Rate at which the system opens connections to the server. Possible values = Aggressive, Normal, Relaxed .EXAMPLE PS C:\>Invoke-NSUpdateNsspparams An example how to update nsspparams config Object(s). .NOTES File Name : Invoke-NSUpdateNsspparams Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsspparams/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [int]$Basethreshold, [ValidateSet('Aggressive', 'Normal', 'Relaxed')] [string]$Throttle ) begin { Write-Verbose "Invoke-NSUpdateNsspparams: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('basethreshold') ) { $payload.Add('basethreshold', $basethreshold) } if ( $PSBoundParameters.ContainsKey('throttle') ) { $payload.Add('throttle', $throttle) } if ( $PSCmdlet.ShouldProcess("nsspparams", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nsspparams -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNsspparams: Finished" } } function Invoke-NSUnsetNsspparams { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for Surge Protection parameter resource. .PARAMETER Basethreshold Maximum number of server connections that can be opened before surge protection is activated. Maximum value = 32767 .PARAMETER Throttle Rate at which the system opens connections to the server. Possible values = Aggressive, Normal, Relaxed .EXAMPLE PS C:\>Invoke-NSUnsetNsspparams An example how to unset nsspparams config Object(s). .NOTES File Name : Invoke-NSUnsetNsspparams Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsspparams Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Boolean]$basethreshold, [Boolean]$throttle ) begin { Write-Verbose "Invoke-NSUnsetNsspparams: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('basethreshold') ) { $payload.Add('basethreshold', $basethreshold) } if ( $PSBoundParameters.ContainsKey('throttle') ) { $payload.Add('throttle', $throttle) } if ( $PSCmdlet.ShouldProcess("nsspparams", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nsspparams -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNsspparams: Finished" } } function Invoke-NSGetNsspparams { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for Surge Protection parameter resource. .PARAMETER GetAll Retrieve all nsspparams object(s). .PARAMETER Count If specified, the count of the nsspparams object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsspparams Get data. .EXAMPLE PS C:\>Invoke-NSGetNsspparams -GetAll Get all nsspparams data. .EXAMPLE PS C:\>Invoke-NSGetNsspparams -name <string> Get nsspparams object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsspparams -Filter @{ 'name'='<value>' } Get nsspparams data with a filter. .NOTES File Name : Invoke-NSGetNsspparams Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsspparams/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNsspparams: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsspparams objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsspparams -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsspparams objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsspparams -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsspparams objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsspparams -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsspparams configuration for property ''" } else { Write-Verbose "Retrieving nsspparams configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsspparams -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsspparams: Ended" } } function Invoke-NSClearNsstats { <# .SYNOPSIS Clear System/Global level configuration. config Object. .DESCRIPTION Configuration for stats resource. .PARAMETER Cleanuplevel The level of stats to be cleared. 'global' option will clear global counters only, 'all' option will clear all device counters also along with global counters. For both the cases only 'ever incrementing counters' i.e. total counters will be cleared. Possible values = global, all .EXAMPLE PS C:\>Invoke-NSClearNsstats -cleanuplevel <string> An example how to clear nsstats config Object(s). .NOTES File Name : Invoke-NSClearNsstats Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsstats/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateSet('global', 'all')] [string]$Cleanuplevel ) begin { Write-Verbose "Invoke-NSClearNsstats: Starting" } process { try { $payload = @{ cleanuplevel = $cleanuplevel } if ( $PSCmdlet.ShouldProcess($Name, "Clear System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsstats -Action clear -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSClearNsstats: Finished" } } function Invoke-NSFlushNssurgeq { <# .SYNOPSIS Flush System/Global level configuration. config Object. .DESCRIPTION Configuration for surge queue resource. .PARAMETER Name Name of a virtual server, service or service group for which the SurgeQ must be flushed. .PARAMETER Servername Name of a service group member. This argument is needed when you want to flush the SurgeQ of a service group. .PARAMETER Port port on which server is bound to the entity(Servicegroup). .EXAMPLE PS C:\>Invoke-NSFlushNssurgeq An example how to flush nssurgeq config Object(s). .NOTES File Name : Invoke-NSFlushNssurgeq Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nssurgeq/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [string]$Name, [string]$Servername, [ValidateRange(1, 65535)] [int]$Port ) begin { Write-Verbose "Invoke-NSFlushNssurgeq: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('name') ) { $payload.Add('name', $name) } if ( $PSBoundParameters.ContainsKey('servername') ) { $payload.Add('servername', $servername) } if ( $PSBoundParameters.ContainsKey('port') ) { $payload.Add('port', $port) } if ( $PSCmdlet.ShouldProcess($Name, "Flush System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nssurgeq -Action flush -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSFlushNssurgeq: Finished" } } function Invoke-NSUpdateNstcpbufparam { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for tcp buffer parameter resource. .PARAMETER Size TCP buffering size per connection, in kilobytes. Maximum value = 20480 .PARAMETER Memlimit Maximum memory, in megabytes, that can be used for buffering. .EXAMPLE PS C:\>Invoke-NSUpdateNstcpbufparam An example how to update nstcpbufparam config Object(s). .NOTES File Name : Invoke-NSUpdateNstcpbufparam Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstcpbufparam/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [double]$Size, [double]$Memlimit ) begin { Write-Verbose "Invoke-NSUpdateNstcpbufparam: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('size') ) { $payload.Add('size', $size) } if ( $PSBoundParameters.ContainsKey('memlimit') ) { $payload.Add('memlimit', $memlimit) } if ( $PSCmdlet.ShouldProcess("nstcpbufparam", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nstcpbufparam -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNstcpbufparam: Finished" } } function Invoke-NSUnsetNstcpbufparam { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for tcp buffer parameter resource. .PARAMETER Size TCP buffering size per connection, in kilobytes. Maximum value = 20480 .PARAMETER Memlimit Maximum memory, in megabytes, that can be used for buffering. .EXAMPLE PS C:\>Invoke-NSUnsetNstcpbufparam An example how to unset nstcpbufparam config Object(s). .NOTES File Name : Invoke-NSUnsetNstcpbufparam Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstcpbufparam Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Boolean]$size, [Boolean]$memlimit ) begin { Write-Verbose "Invoke-NSUnsetNstcpbufparam: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('size') ) { $payload.Add('size', $size) } if ( $PSBoundParameters.ContainsKey('memlimit') ) { $payload.Add('memlimit', $memlimit) } if ( $PSCmdlet.ShouldProcess("nstcpbufparam", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nstcpbufparam -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNstcpbufparam: Finished" } } function Invoke-NSGetNstcpbufparam { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for tcp buffer parameter resource. .PARAMETER GetAll Retrieve all nstcpbufparam object(s). .PARAMETER Count If specified, the count of the nstcpbufparam object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNstcpbufparam Get data. .EXAMPLE PS C:\>Invoke-NSGetNstcpbufparam -GetAll Get all nstcpbufparam data. .EXAMPLE PS C:\>Invoke-NSGetNstcpbufparam -name <string> Get nstcpbufparam object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNstcpbufparam -Filter @{ 'name'='<value>' } Get nstcpbufparam data with a filter. .NOTES File Name : Invoke-NSGetNstcpbufparam Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstcpbufparam/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNstcpbufparam: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nstcpbufparam objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstcpbufparam -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nstcpbufparam objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstcpbufparam -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nstcpbufparam objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstcpbufparam -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nstcpbufparam configuration for property ''" } else { Write-Verbose "Retrieving nstcpbufparam configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstcpbufparam -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNstcpbufparam: Ended" } } function Invoke-NSUpdateNstcpparam { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for tcp parameters resource. .PARAMETER Ws Enable or disable window scaling. Possible values = ENABLED, DISABLED .PARAMETER Wsval Factor used to calculate the new window size. This argument is needed only when the window scaling is enabled. Maximum value = 14 .PARAMETER Sack Enable or disable Selective ACKnowledgement (SACK). Possible values = ENABLED, DISABLED .PARAMETER Learnvsvrmss Enable or disable maximum segment size (MSS) learning for virtual servers. Possible values = ENABLED, DISABLED .PARAMETER Maxburst Maximum number of TCP segments allowed in a burst. Maximum value = 255 .PARAMETER Initialcwnd Initial maximum upper limit on the number of TCP packets that can be outstanding on the TCP link to the server. Maximum value = 44 .PARAMETER Recvbuffsize TCP Receive buffer size. Maximum value = 20971520 .PARAMETER Delayedack Timeout for TCP delayed ACK, in milliseconds. Maximum value = 300 .PARAMETER Downstaterst Flag to switch on RST on down services. Possible values = ENABLED, DISABLED .PARAMETER Nagle Enable or disable the Nagle algorithm on TCP connections. Possible values = ENABLED, DISABLED .PARAMETER Limitedpersist Limit the number of persist (zero window) probes. Possible values = ENABLED, DISABLED .PARAMETER Oooqsize Maximum size of out-of-order packets queue. A value of 0 means no limit. Maximum value = 65535 .PARAMETER Ackonpush Send immediate positive acknowledgement (ACK) on receipt of TCP packets with PUSH flag. Possible values = ENABLED, DISABLED .PARAMETER Maxpktpermss Maximum number of TCP packets allowed per maximum segment size (MSS). Maximum value = 1460 .PARAMETER Pktperretx Maximum limit on the number of packets that should be retransmitted on receiving a partial ACK. Maximum value = 100 .PARAMETER Minrto Minimum retransmission timeout, in milliseconds, specified in 10-millisecond increments (value must yield a whole number if divided by 10). Maximum value = 64000 .PARAMETER Slowstartincr Multiplier that determines the rate at which slow start increases the size of the TCP transmission window after each acknowledgement of successful transmission. Maximum value = 100 .PARAMETER Maxdynserverprobes Maximum number of probes that Citrix ADC can send out in 10 milliseconds, to dynamically learn a service. Citrix ADC probes for the existence of the origin in case of wildcard virtual server or services. Maximum value = 65535 .PARAMETER Synholdfastgiveup Maximum threshold. After crossing this threshold number of outstanding probes for origin, the Citrix ADC reduces the number of connection retries for probe connections. Maximum value = 65535 .PARAMETER Maxsynholdperprobe Limit the number of client connections (SYN) waiting for status of single probe. Any new SYN packets will be dropped. Maximum value = 255 .PARAMETER Maxsynhold Limit the number of client connections (SYN) waiting for status of probe system wide. Any new SYN packets will be dropped. Maximum value = 65535 .PARAMETER Msslearninterval Duration, in seconds, to sample the Maximum Segment Size (MSS) of the services. The Citrix ADC determines the best MSS to set for the virtual server based on this sampling. The argument to enable maximum segment size (MSS) for virtual servers must be enabled. Maximum value = 1048576 .PARAMETER Msslearndelay Frequency, in seconds, at which the virtual servers learn the Maximum segment size (MSS) from the services. The argument to enable maximum segment size (MSS) for virtual servers must be enabled. Maximum value = 1048576 .PARAMETER Maxtimewaitconn Maximum number of connections to hold in the TCP TIME_WAIT state on a packet engine. New connections entering TIME_WAIT state are proactively cleaned up. .PARAMETER Kaprobeupdatelastactivity Update last activity for KA probes. Possible values = ENABLED, DISABLED .PARAMETER Maxsynackretx When 'syncookie' is disabled in the TCP profile that is bound to the virtual server or service, and the number of TCP SYN+ACK retransmission by Citrix ADC for that virtual server or service crosses this threshold, the Citrix ADC responds by using the TCP SYN-Cookie mechanism. Maximum value = 1048576 .PARAMETER Synattackdetection Detect TCP SYN packet flood and send an SNMP trap. Possible values = ENABLED, DISABLED .PARAMETER Connflushifnomem Flush an existing connection if no memory can be obtained for new connection. HALF_CLOSED_AND_IDLE: Flush a connection that is closed by us but not by peer, or failing that, a connection that is past configured idle time. New connection fails if no such connection can be found. FIFO: If no half-closed or idle connection can be found, flush the oldest non-management connection, even if it is active. New connection fails if the oldest few connections are management connections. Note: If you enable this setting, you should also consider lowering the zombie timeout and half-close timeout, while setting the Citrix ADC timeout. See Also: connFlushThres argument below. Possible values = NONE, HALFCLOSED_AND_IDLE, FIFO .PARAMETER Connflushthres Flush an existing connection (as configured through -connFlushIfNoMem FIFO) if the system has more than specified number of connections, and a new connection is to be established. Note: This value may be rounded down to be a whole multiple of the number of packet engines running. .PARAMETER Mptcpconcloseonpassivesf Accept DATA_FIN/FAST_CLOSE on passive subflow. Possible values = ENABLED, DISABLED .PARAMETER Mptcpchecksum Use MPTCP DSS checksum. Possible values = ENABLED, DISABLED .PARAMETER Mptcpsftimeout The timeout value in seconds for idle mptcp subflows. If this timeout is not set, idle subflows are cleared after cltTimeout of vserver. Maximum value = 31536000 .PARAMETER Mptcpsfreplacetimeout The minimum idle time value in seconds for idle mptcp subflows after which the sublow is replaced by new incoming subflow if maximum subflow limit is reached. The priority for replacement is given to those subflow without any transaction. Maximum value = 31536000 .PARAMETER Mptcpmaxsf Maximum number of subflow connections supported in established state per mptcp connection. Maximum value = 6 .PARAMETER Mptcpmaxpendingsf Maximum number of subflow connections supported in pending join state per mptcp connection. Maximum value = 4 .PARAMETER Mptcppendingjointhreshold Maximum system level pending join connections allowed. Maximum value = 4294967294 .PARAMETER Mptcprtostoswitchsf Number of RTO's at subflow level, after which MPCTP should start using other subflow. Maximum value = 6 .PARAMETER Mptcpusebackupondss When enabled, if NS receives a DSS on a backup subflow, NS will start using that subflow to send data. And if disabled, NS will continue to transmit on current chosen subflow. In case there is some error on a subflow (like RTO's/RST etc.) then NS can choose a backup subflow irrespective of this tunable. Possible values = ENABLED, DISABLED .PARAMETER Tcpmaxretries Number of RTO's after which a connection should be freed. Maximum value = 7 .PARAMETER Mptcpimmediatesfcloseonfin Allow subflows to close immediately on FIN before the DATA_FIN exchange is completed at mptcp level. Possible values = ENABLED, DISABLED .PARAMETER Mptcpclosemptcpsessiononlastsfclose Allow to send DATA FIN or FAST CLOSE on mptcp connection while sending FIN or RST on the last subflow. Possible values = ENABLED, DISABLED .PARAMETER Mptcpsendsfresetoption Allow MPTCP subflows to send TCP RST Reason (MP_TCPRST) Option while sending TCP RST. Possible values = ENABLED, DISABLED .PARAMETER Mptcpfastcloseoption Allow to select option ACK or RESET to force the closure of an MPTCP connection abruptly. Possible values = ACK, RESET .PARAMETER Mptcpreliableaddaddr If enabled, Citrix ADC retransmits MPTCP ADD-ADDR option if echo response is not received within the timeout interval. The retransmission is attempted only once. Possible values = ENABLED, DISABLED .PARAMETER Tcpfastopencookietimeout Timeout in seconds after which a new TFO Key is computed for generating TFO Cookie. If zero, the same key is used always. If timeout is less than 120seconds, NS defaults to 120seconds timeout. Maximum value = 31536000 .PARAMETER Autosyncookietimeout Timeout for the server to function in syncookie mode after the synattack. This is valid if TCP syncookie is disabled on the profile and server acts in non syncookie mode by default. Maximum value = 65535 .PARAMETER Tcpfintimeout The amount of time in seconds, after which a TCP connnection in the TCP TIME-WAIT state is flushed. Maximum value = 240 .PARAMETER Compacttcpoptionnoop If enabled, non-negotiated TCP options are removed from the received packet while proxying it. By default, non-negotiated TCP options would be replaced by NOPs in the proxied packets. This option is not applicable for Citrix ADC generated packets. Possible values = ENABLED, DISABLED .PARAMETER Delinkclientserveronrst If enabled, Delink client and server connection, when there is outstanding data to be sent to the other side. Possible values = ENABLED, DISABLED .PARAMETER Rfc5961chlgacklimit Limits number of Challenge ACK sent per second, as recommended in RFC 5961(Improving TCP's Robustness to Blind In-Window Attacks). Maximum value = 2147483647 .EXAMPLE PS C:\>Invoke-NSUpdateNstcpparam An example how to update nstcpparam config Object(s). .NOTES File Name : Invoke-NSUpdateNstcpparam Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstcpparam/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateSet('ENABLED', 'DISABLED')] [string]$Ws, [double]$Wsval, [ValidateSet('ENABLED', 'DISABLED')] [string]$Sack, [ValidateSet('ENABLED', 'DISABLED')] [string]$Learnvsvrmss, [double]$Maxburst, [double]$Initialcwnd, [double]$Recvbuffsize, [double]$Delayedack, [ValidateSet('ENABLED', 'DISABLED')] [string]$Downstaterst, [ValidateSet('ENABLED', 'DISABLED')] [string]$Nagle, [ValidateSet('ENABLED', 'DISABLED')] [string]$Limitedpersist, [double]$Oooqsize, [ValidateSet('ENABLED', 'DISABLED')] [string]$Ackonpush, [double]$Maxpktpermss, [int]$Pktperretx, [int]$Minrto, [int]$Slowstartincr, [double]$Maxdynserverprobes, [double]$Synholdfastgiveup, [double]$Maxsynholdperprobe, [double]$Maxsynhold, [double]$Msslearninterval, [double]$Msslearndelay, [double]$Maxtimewaitconn, [ValidateSet('ENABLED', 'DISABLED')] [string]$Kaprobeupdatelastactivity, [double]$Maxsynackretx, [ValidateSet('ENABLED', 'DISABLED')] [string]$Synattackdetection, [ValidateSet('NONE', 'HALFCLOSED_AND_IDLE', 'FIFO')] [string]$Connflushifnomem, [double]$Connflushthres, [ValidateSet('ENABLED', 'DISABLED')] [string]$Mptcpconcloseonpassivesf, [ValidateSet('ENABLED', 'DISABLED')] [string]$Mptcpchecksum, [double]$Mptcpsftimeout, [double]$Mptcpsfreplacetimeout, [double]$Mptcpmaxsf, [double]$Mptcpmaxpendingsf, [double]$Mptcppendingjointhreshold, [double]$Mptcprtostoswitchsf, [ValidateSet('ENABLED', 'DISABLED')] [string]$Mptcpusebackupondss, [double]$Tcpmaxretries, [ValidateSet('ENABLED', 'DISABLED')] [string]$Mptcpimmediatesfcloseonfin, [ValidateSet('ENABLED', 'DISABLED')] [string]$Mptcpclosemptcpsessiononlastsfclose, [ValidateSet('ENABLED', 'DISABLED')] [string]$Mptcpsendsfresetoption, [ValidateSet('ACK', 'RESET')] [string]$Mptcpfastcloseoption, [ValidateSet('ENABLED', 'DISABLED')] [string]$Mptcpreliableaddaddr, [double]$Tcpfastopencookietimeout, [double]$Autosyncookietimeout, [double]$Tcpfintimeout, [ValidateSet('ENABLED', 'DISABLED')] [string]$Compacttcpoptionnoop, [ValidateSet('ENABLED', 'DISABLED')] [string]$Delinkclientserveronrst, [double]$Rfc5961chlgacklimit ) begin { Write-Verbose "Invoke-NSUpdateNstcpparam: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('ws') ) { $payload.Add('ws', $ws) } if ( $PSBoundParameters.ContainsKey('wsval') ) { $payload.Add('wsval', $wsval) } if ( $PSBoundParameters.ContainsKey('sack') ) { $payload.Add('sack', $sack) } if ( $PSBoundParameters.ContainsKey('learnvsvrmss') ) { $payload.Add('learnvsvrmss', $learnvsvrmss) } if ( $PSBoundParameters.ContainsKey('maxburst') ) { $payload.Add('maxburst', $maxburst) } if ( $PSBoundParameters.ContainsKey('initialcwnd') ) { $payload.Add('initialcwnd', $initialcwnd) } if ( $PSBoundParameters.ContainsKey('recvbuffsize') ) { $payload.Add('recvbuffsize', $recvbuffsize) } if ( $PSBoundParameters.ContainsKey('delayedack') ) { $payload.Add('delayedack', $delayedack) } if ( $PSBoundParameters.ContainsKey('downstaterst') ) { $payload.Add('downstaterst', $downstaterst) } if ( $PSBoundParameters.ContainsKey('nagle') ) { $payload.Add('nagle', $nagle) } if ( $PSBoundParameters.ContainsKey('limitedpersist') ) { $payload.Add('limitedpersist', $limitedpersist) } if ( $PSBoundParameters.ContainsKey('oooqsize') ) { $payload.Add('oooqsize', $oooqsize) } if ( $PSBoundParameters.ContainsKey('ackonpush') ) { $payload.Add('ackonpush', $ackonpush) } if ( $PSBoundParameters.ContainsKey('maxpktpermss') ) { $payload.Add('maxpktpermss', $maxpktpermss) } if ( $PSBoundParameters.ContainsKey('pktperretx') ) { $payload.Add('pktperretx', $pktperretx) } if ( $PSBoundParameters.ContainsKey('minrto') ) { $payload.Add('minrto', $minrto) } if ( $PSBoundParameters.ContainsKey('slowstartincr') ) { $payload.Add('slowstartincr', $slowstartincr) } if ( $PSBoundParameters.ContainsKey('maxdynserverprobes') ) { $payload.Add('maxdynserverprobes', $maxdynserverprobes) } if ( $PSBoundParameters.ContainsKey('synholdfastgiveup') ) { $payload.Add('synholdfastgiveup', $synholdfastgiveup) } if ( $PSBoundParameters.ContainsKey('maxsynholdperprobe') ) { $payload.Add('maxsynholdperprobe', $maxsynholdperprobe) } if ( $PSBoundParameters.ContainsKey('maxsynhold') ) { $payload.Add('maxsynhold', $maxsynhold) } if ( $PSBoundParameters.ContainsKey('msslearninterval') ) { $payload.Add('msslearninterval', $msslearninterval) } if ( $PSBoundParameters.ContainsKey('msslearndelay') ) { $payload.Add('msslearndelay', $msslearndelay) } if ( $PSBoundParameters.ContainsKey('maxtimewaitconn') ) { $payload.Add('maxtimewaitconn', $maxtimewaitconn) } if ( $PSBoundParameters.ContainsKey('kaprobeupdatelastactivity') ) { $payload.Add('kaprobeupdatelastactivity', $kaprobeupdatelastactivity) } if ( $PSBoundParameters.ContainsKey('maxsynackretx') ) { $payload.Add('maxsynackretx', $maxsynackretx) } if ( $PSBoundParameters.ContainsKey('synattackdetection') ) { $payload.Add('synattackdetection', $synattackdetection) } if ( $PSBoundParameters.ContainsKey('connflushifnomem') ) { $payload.Add('connflushifnomem', $connflushifnomem) } if ( $PSBoundParameters.ContainsKey('connflushthres') ) { $payload.Add('connflushthres', $connflushthres) } if ( $PSBoundParameters.ContainsKey('mptcpconcloseonpassivesf') ) { $payload.Add('mptcpconcloseonpassivesf', $mptcpconcloseonpassivesf) } if ( $PSBoundParameters.ContainsKey('mptcpchecksum') ) { $payload.Add('mptcpchecksum', $mptcpchecksum) } if ( $PSBoundParameters.ContainsKey('mptcpsftimeout') ) { $payload.Add('mptcpsftimeout', $mptcpsftimeout) } if ( $PSBoundParameters.ContainsKey('mptcpsfreplacetimeout') ) { $payload.Add('mptcpsfreplacetimeout', $mptcpsfreplacetimeout) } if ( $PSBoundParameters.ContainsKey('mptcpmaxsf') ) { $payload.Add('mptcpmaxsf', $mptcpmaxsf) } if ( $PSBoundParameters.ContainsKey('mptcpmaxpendingsf') ) { $payload.Add('mptcpmaxpendingsf', $mptcpmaxpendingsf) } if ( $PSBoundParameters.ContainsKey('mptcppendingjointhreshold') ) { $payload.Add('mptcppendingjointhreshold', $mptcppendingjointhreshold) } if ( $PSBoundParameters.ContainsKey('mptcprtostoswitchsf') ) { $payload.Add('mptcprtostoswitchsf', $mptcprtostoswitchsf) } if ( $PSBoundParameters.ContainsKey('mptcpusebackupondss') ) { $payload.Add('mptcpusebackupondss', $mptcpusebackupondss) } if ( $PSBoundParameters.ContainsKey('tcpmaxretries') ) { $payload.Add('tcpmaxretries', $tcpmaxretries) } if ( $PSBoundParameters.ContainsKey('mptcpimmediatesfcloseonfin') ) { $payload.Add('mptcpimmediatesfcloseonfin', $mptcpimmediatesfcloseonfin) } if ( $PSBoundParameters.ContainsKey('mptcpclosemptcpsessiononlastsfclose') ) { $payload.Add('mptcpclosemptcpsessiononlastsfclose', $mptcpclosemptcpsessiononlastsfclose) } if ( $PSBoundParameters.ContainsKey('mptcpsendsfresetoption') ) { $payload.Add('mptcpsendsfresetoption', $mptcpsendsfresetoption) } if ( $PSBoundParameters.ContainsKey('mptcpfastcloseoption') ) { $payload.Add('mptcpfastcloseoption', $mptcpfastcloseoption) } if ( $PSBoundParameters.ContainsKey('mptcpreliableaddaddr') ) { $payload.Add('mptcpreliableaddaddr', $mptcpreliableaddaddr) } if ( $PSBoundParameters.ContainsKey('tcpfastopencookietimeout') ) { $payload.Add('tcpfastopencookietimeout', $tcpfastopencookietimeout) } if ( $PSBoundParameters.ContainsKey('autosyncookietimeout') ) { $payload.Add('autosyncookietimeout', $autosyncookietimeout) } if ( $PSBoundParameters.ContainsKey('tcpfintimeout') ) { $payload.Add('tcpfintimeout', $tcpfintimeout) } if ( $PSBoundParameters.ContainsKey('compacttcpoptionnoop') ) { $payload.Add('compacttcpoptionnoop', $compacttcpoptionnoop) } if ( $PSBoundParameters.ContainsKey('delinkclientserveronrst') ) { $payload.Add('delinkclientserveronrst', $delinkclientserveronrst) } if ( $PSBoundParameters.ContainsKey('rfc5961chlgacklimit') ) { $payload.Add('rfc5961chlgacklimit', $rfc5961chlgacklimit) } if ( $PSCmdlet.ShouldProcess("nstcpparam", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nstcpparam -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNstcpparam: Finished" } } function Invoke-NSUnsetNstcpparam { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for tcp parameters resource. .PARAMETER Ws Enable or disable window scaling. Possible values = ENABLED, DISABLED .PARAMETER Wsval Factor used to calculate the new window size. This argument is needed only when the window scaling is enabled. Maximum value = 14 .PARAMETER Sack Enable or disable Selective ACKnowledgement (SACK). Possible values = ENABLED, DISABLED .PARAMETER Learnvsvrmss Enable or disable maximum segment size (MSS) learning for virtual servers. Possible values = ENABLED, DISABLED .PARAMETER Maxburst Maximum number of TCP segments allowed in a burst. Maximum value = 255 .PARAMETER Initialcwnd Initial maximum upper limit on the number of TCP packets that can be outstanding on the TCP link to the server. Maximum value = 44 .PARAMETER Recvbuffsize TCP Receive buffer size. Maximum value = 20971520 .PARAMETER Delayedack Timeout for TCP delayed ACK, in milliseconds. Maximum value = 300 .PARAMETER Downstaterst Flag to switch on RST on down services. Possible values = ENABLED, DISABLED .PARAMETER Nagle Enable or disable the Nagle algorithm on TCP connections. Possible values = ENABLED, DISABLED .PARAMETER Limitedpersist Limit the number of persist (zero window) probes. Possible values = ENABLED, DISABLED .PARAMETER Oooqsize Maximum size of out-of-order packets queue. A value of 0 means no limit. Maximum value = 65535 .PARAMETER Ackonpush Send immediate positive acknowledgement (ACK) on receipt of TCP packets with PUSH flag. Possible values = ENABLED, DISABLED .PARAMETER Maxpktpermss Maximum number of TCP packets allowed per maximum segment size (MSS). Maximum value = 1460 .PARAMETER Pktperretx Maximum limit on the number of packets that should be retransmitted on receiving a partial ACK. Maximum value = 100 .PARAMETER Minrto Minimum retransmission timeout, in milliseconds, specified in 10-millisecond increments (value must yield a whole number if divided by 10). Maximum value = 64000 .PARAMETER Slowstartincr Multiplier that determines the rate at which slow start increases the size of the TCP transmission window after each acknowledgement of successful transmission. Maximum value = 100 .PARAMETER Maxdynserverprobes Maximum number of probes that Citrix ADC can send out in 10 milliseconds, to dynamically learn a service. Citrix ADC probes for the existence of the origin in case of wildcard virtual server or services. Maximum value = 65535 .PARAMETER Synholdfastgiveup Maximum threshold. After crossing this threshold number of outstanding probes for origin, the Citrix ADC reduces the number of connection retries for probe connections. Maximum value = 65535 .PARAMETER Maxsynholdperprobe Limit the number of client connections (SYN) waiting for status of single probe. Any new SYN packets will be dropped. Maximum value = 255 .PARAMETER Maxsynhold Limit the number of client connections (SYN) waiting for status of probe system wide. Any new SYN packets will be dropped. Maximum value = 65535 .PARAMETER Msslearninterval Duration, in seconds, to sample the Maximum Segment Size (MSS) of the services. The Citrix ADC determines the best MSS to set for the virtual server based on this sampling. The argument to enable maximum segment size (MSS) for virtual servers must be enabled. Maximum value = 1048576 .PARAMETER Msslearndelay Frequency, in seconds, at which the virtual servers learn the Maximum segment size (MSS) from the services. The argument to enable maximum segment size (MSS) for virtual servers must be enabled. Maximum value = 1048576 .PARAMETER Maxtimewaitconn Maximum number of connections to hold in the TCP TIME_WAIT state on a packet engine. New connections entering TIME_WAIT state are proactively cleaned up. .PARAMETER Kaprobeupdatelastactivity Update last activity for KA probes. Possible values = ENABLED, DISABLED .PARAMETER Maxsynackretx When 'syncookie' is disabled in the TCP profile that is bound to the virtual server or service, and the number of TCP SYN+ACK retransmission by Citrix ADC for that virtual server or service crosses this threshold, the Citrix ADC responds by using the TCP SYN-Cookie mechanism. Maximum value = 1048576 .PARAMETER Synattackdetection Detect TCP SYN packet flood and send an SNMP trap. Possible values = ENABLED, DISABLED .PARAMETER Connflushifnomem Flush an existing connection if no memory can be obtained for new connection. HALF_CLOSED_AND_IDLE: Flush a connection that is closed by us but not by peer, or failing that, a connection that is past configured idle time. New connection fails if no such connection can be found. FIFO: If no half-closed or idle connection can be found, flush the oldest non-management connection, even if it is active. New connection fails if the oldest few connections are management connections. Note: If you enable this setting, you should also consider lowering the zombie timeout and half-close timeout, while setting the Citrix ADC timeout. See Also: connFlushThres argument below. Possible values = NONE, HALFCLOSED_AND_IDLE, FIFO .PARAMETER Connflushthres Flush an existing connection (as configured through -connFlushIfNoMem FIFO) if the system has more than specified number of connections, and a new connection is to be established. Note: This value may be rounded down to be a whole multiple of the number of packet engines running. .PARAMETER Mptcpconcloseonpassivesf Accept DATA_FIN/FAST_CLOSE on passive subflow. Possible values = ENABLED, DISABLED .PARAMETER Mptcpchecksum Use MPTCP DSS checksum. Possible values = ENABLED, DISABLED .PARAMETER Mptcpsftimeout The timeout value in seconds for idle mptcp subflows. If this timeout is not set, idle subflows are cleared after cltTimeout of vserver. Maximum value = 31536000 .PARAMETER Mptcpsfreplacetimeout The minimum idle time value in seconds for idle mptcp subflows after which the sublow is replaced by new incoming subflow if maximum subflow limit is reached. The priority for replacement is given to those subflow without any transaction. Maximum value = 31536000 .PARAMETER Mptcpmaxsf Maximum number of subflow connections supported in established state per mptcp connection. Maximum value = 6 .PARAMETER Mptcpmaxpendingsf Maximum number of subflow connections supported in pending join state per mptcp connection. Maximum value = 4 .PARAMETER Mptcppendingjointhreshold Maximum system level pending join connections allowed. Maximum value = 4294967294 .PARAMETER Mptcprtostoswitchsf Number of RTO's at subflow level, after which MPCTP should start using other subflow. Maximum value = 6 .PARAMETER Mptcpusebackupondss When enabled, if NS receives a DSS on a backup subflow, NS will start using that subflow to send data. And if disabled, NS will continue to transmit on current chosen subflow. In case there is some error on a subflow (like RTO's/RST etc.) then NS can choose a backup subflow irrespective of this tunable. Possible values = ENABLED, DISABLED .PARAMETER Tcpmaxretries Number of RTO's after which a connection should be freed. Maximum value = 7 .PARAMETER Mptcpimmediatesfcloseonfin Allow subflows to close immediately on FIN before the DATA_FIN exchange is completed at mptcp level. Possible values = ENABLED, DISABLED .PARAMETER Mptcpclosemptcpsessiononlastsfclose Allow to send DATA FIN or FAST CLOSE on mptcp connection while sending FIN or RST on the last subflow. Possible values = ENABLED, DISABLED .PARAMETER Mptcpsendsfresetoption Allow MPTCP subflows to send TCP RST Reason (MP_TCPRST) Option while sending TCP RST. Possible values = ENABLED, DISABLED .PARAMETER Mptcpfastcloseoption Allow to select option ACK or RESET to force the closure of an MPTCP connection abruptly. Possible values = ACK, RESET .PARAMETER Mptcpreliableaddaddr If enabled, Citrix ADC retransmits MPTCP ADD-ADDR option if echo response is not received within the timeout interval. The retransmission is attempted only once. Possible values = ENABLED, DISABLED .PARAMETER Tcpfastopencookietimeout Timeout in seconds after which a new TFO Key is computed for generating TFO Cookie. If zero, the same key is used always. If timeout is less than 120seconds, NS defaults to 120seconds timeout. Maximum value = 31536000 .PARAMETER Autosyncookietimeout Timeout for the server to function in syncookie mode after the synattack. This is valid if TCP syncookie is disabled on the profile and server acts in non syncookie mode by default. Maximum value = 65535 .PARAMETER Tcpfintimeout The amount of time in seconds, after which a TCP connnection in the TCP TIME-WAIT state is flushed. Maximum value = 240 .PARAMETER Compacttcpoptionnoop If enabled, non-negotiated TCP options are removed from the received packet while proxying it. By default, non-negotiated TCP options would be replaced by NOPs in the proxied packets. This option is not applicable for Citrix ADC generated packets. Possible values = ENABLED, DISABLED .PARAMETER Delinkclientserveronrst If enabled, Delink client and server connection, when there is outstanding data to be sent to the other side. Possible values = ENABLED, DISABLED .PARAMETER Rfc5961chlgacklimit Limits number of Challenge ACK sent per second, as recommended in RFC 5961(Improving TCP's Robustness to Blind In-Window Attacks). Maximum value = 2147483647 .EXAMPLE PS C:\>Invoke-NSUnsetNstcpparam An example how to unset nstcpparam config Object(s). .NOTES File Name : Invoke-NSUnsetNstcpparam Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstcpparam Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Boolean]$ws, [Boolean]$wsval, [Boolean]$sack, [Boolean]$learnvsvrmss, [Boolean]$maxburst, [Boolean]$initialcwnd, [Boolean]$recvbuffsize, [Boolean]$delayedack, [Boolean]$downstaterst, [Boolean]$nagle, [Boolean]$limitedpersist, [Boolean]$oooqsize, [Boolean]$ackonpush, [Boolean]$maxpktpermss, [Boolean]$pktperretx, [Boolean]$minrto, [Boolean]$slowstartincr, [Boolean]$maxdynserverprobes, [Boolean]$synholdfastgiveup, [Boolean]$maxsynholdperprobe, [Boolean]$maxsynhold, [Boolean]$msslearninterval, [Boolean]$msslearndelay, [Boolean]$maxtimewaitconn, [Boolean]$kaprobeupdatelastactivity, [Boolean]$maxsynackretx, [Boolean]$synattackdetection, [Boolean]$connflushifnomem, [Boolean]$connflushthres, [Boolean]$mptcpconcloseonpassivesf, [Boolean]$mptcpchecksum, [Boolean]$mptcpsftimeout, [Boolean]$mptcpsfreplacetimeout, [Boolean]$mptcpmaxsf, [Boolean]$mptcpmaxpendingsf, [Boolean]$mptcppendingjointhreshold, [Boolean]$mptcprtostoswitchsf, [Boolean]$mptcpusebackupondss, [Boolean]$tcpmaxretries, [Boolean]$mptcpimmediatesfcloseonfin, [Boolean]$mptcpclosemptcpsessiononlastsfclose, [Boolean]$mptcpsendsfresetoption, [Boolean]$mptcpfastcloseoption, [Boolean]$mptcpreliableaddaddr, [Boolean]$tcpfastopencookietimeout, [Boolean]$autosyncookietimeout, [Boolean]$tcpfintimeout, [Boolean]$compacttcpoptionnoop, [Boolean]$delinkclientserveronrst, [Boolean]$rfc5961chlgacklimit ) begin { Write-Verbose "Invoke-NSUnsetNstcpparam: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('ws') ) { $payload.Add('ws', $ws) } if ( $PSBoundParameters.ContainsKey('wsval') ) { $payload.Add('wsval', $wsval) } if ( $PSBoundParameters.ContainsKey('sack') ) { $payload.Add('sack', $sack) } if ( $PSBoundParameters.ContainsKey('learnvsvrmss') ) { $payload.Add('learnvsvrmss', $learnvsvrmss) } if ( $PSBoundParameters.ContainsKey('maxburst') ) { $payload.Add('maxburst', $maxburst) } if ( $PSBoundParameters.ContainsKey('initialcwnd') ) { $payload.Add('initialcwnd', $initialcwnd) } if ( $PSBoundParameters.ContainsKey('recvbuffsize') ) { $payload.Add('recvbuffsize', $recvbuffsize) } if ( $PSBoundParameters.ContainsKey('delayedack') ) { $payload.Add('delayedack', $delayedack) } if ( $PSBoundParameters.ContainsKey('downstaterst') ) { $payload.Add('downstaterst', $downstaterst) } if ( $PSBoundParameters.ContainsKey('nagle') ) { $payload.Add('nagle', $nagle) } if ( $PSBoundParameters.ContainsKey('limitedpersist') ) { $payload.Add('limitedpersist', $limitedpersist) } if ( $PSBoundParameters.ContainsKey('oooqsize') ) { $payload.Add('oooqsize', $oooqsize) } if ( $PSBoundParameters.ContainsKey('ackonpush') ) { $payload.Add('ackonpush', $ackonpush) } if ( $PSBoundParameters.ContainsKey('maxpktpermss') ) { $payload.Add('maxpktpermss', $maxpktpermss) } if ( $PSBoundParameters.ContainsKey('pktperretx') ) { $payload.Add('pktperretx', $pktperretx) } if ( $PSBoundParameters.ContainsKey('minrto') ) { $payload.Add('minrto', $minrto) } if ( $PSBoundParameters.ContainsKey('slowstartincr') ) { $payload.Add('slowstartincr', $slowstartincr) } if ( $PSBoundParameters.ContainsKey('maxdynserverprobes') ) { $payload.Add('maxdynserverprobes', $maxdynserverprobes) } if ( $PSBoundParameters.ContainsKey('synholdfastgiveup') ) { $payload.Add('synholdfastgiveup', $synholdfastgiveup) } if ( $PSBoundParameters.ContainsKey('maxsynholdperprobe') ) { $payload.Add('maxsynholdperprobe', $maxsynholdperprobe) } if ( $PSBoundParameters.ContainsKey('maxsynhold') ) { $payload.Add('maxsynhold', $maxsynhold) } if ( $PSBoundParameters.ContainsKey('msslearninterval') ) { $payload.Add('msslearninterval', $msslearninterval) } if ( $PSBoundParameters.ContainsKey('msslearndelay') ) { $payload.Add('msslearndelay', $msslearndelay) } if ( $PSBoundParameters.ContainsKey('maxtimewaitconn') ) { $payload.Add('maxtimewaitconn', $maxtimewaitconn) } if ( $PSBoundParameters.ContainsKey('kaprobeupdatelastactivity') ) { $payload.Add('kaprobeupdatelastactivity', $kaprobeupdatelastactivity) } if ( $PSBoundParameters.ContainsKey('maxsynackretx') ) { $payload.Add('maxsynackretx', $maxsynackretx) } if ( $PSBoundParameters.ContainsKey('synattackdetection') ) { $payload.Add('synattackdetection', $synattackdetection) } if ( $PSBoundParameters.ContainsKey('connflushifnomem') ) { $payload.Add('connflushifnomem', $connflushifnomem) } if ( $PSBoundParameters.ContainsKey('connflushthres') ) { $payload.Add('connflushthres', $connflushthres) } if ( $PSBoundParameters.ContainsKey('mptcpconcloseonpassivesf') ) { $payload.Add('mptcpconcloseonpassivesf', $mptcpconcloseonpassivesf) } if ( $PSBoundParameters.ContainsKey('mptcpchecksum') ) { $payload.Add('mptcpchecksum', $mptcpchecksum) } if ( $PSBoundParameters.ContainsKey('mptcpsftimeout') ) { $payload.Add('mptcpsftimeout', $mptcpsftimeout) } if ( $PSBoundParameters.ContainsKey('mptcpsfreplacetimeout') ) { $payload.Add('mptcpsfreplacetimeout', $mptcpsfreplacetimeout) } if ( $PSBoundParameters.ContainsKey('mptcpmaxsf') ) { $payload.Add('mptcpmaxsf', $mptcpmaxsf) } if ( $PSBoundParameters.ContainsKey('mptcpmaxpendingsf') ) { $payload.Add('mptcpmaxpendingsf', $mptcpmaxpendingsf) } if ( $PSBoundParameters.ContainsKey('mptcppendingjointhreshold') ) { $payload.Add('mptcppendingjointhreshold', $mptcppendingjointhreshold) } if ( $PSBoundParameters.ContainsKey('mptcprtostoswitchsf') ) { $payload.Add('mptcprtostoswitchsf', $mptcprtostoswitchsf) } if ( $PSBoundParameters.ContainsKey('mptcpusebackupondss') ) { $payload.Add('mptcpusebackupondss', $mptcpusebackupondss) } if ( $PSBoundParameters.ContainsKey('tcpmaxretries') ) { $payload.Add('tcpmaxretries', $tcpmaxretries) } if ( $PSBoundParameters.ContainsKey('mptcpimmediatesfcloseonfin') ) { $payload.Add('mptcpimmediatesfcloseonfin', $mptcpimmediatesfcloseonfin) } if ( $PSBoundParameters.ContainsKey('mptcpclosemptcpsessiononlastsfclose') ) { $payload.Add('mptcpclosemptcpsessiononlastsfclose', $mptcpclosemptcpsessiononlastsfclose) } if ( $PSBoundParameters.ContainsKey('mptcpsendsfresetoption') ) { $payload.Add('mptcpsendsfresetoption', $mptcpsendsfresetoption) } if ( $PSBoundParameters.ContainsKey('mptcpfastcloseoption') ) { $payload.Add('mptcpfastcloseoption', $mptcpfastcloseoption) } if ( $PSBoundParameters.ContainsKey('mptcpreliableaddaddr') ) { $payload.Add('mptcpreliableaddaddr', $mptcpreliableaddaddr) } if ( $PSBoundParameters.ContainsKey('tcpfastopencookietimeout') ) { $payload.Add('tcpfastopencookietimeout', $tcpfastopencookietimeout) } if ( $PSBoundParameters.ContainsKey('autosyncookietimeout') ) { $payload.Add('autosyncookietimeout', $autosyncookietimeout) } if ( $PSBoundParameters.ContainsKey('tcpfintimeout') ) { $payload.Add('tcpfintimeout', $tcpfintimeout) } if ( $PSBoundParameters.ContainsKey('compacttcpoptionnoop') ) { $payload.Add('compacttcpoptionnoop', $compacttcpoptionnoop) } if ( $PSBoundParameters.ContainsKey('delinkclientserveronrst') ) { $payload.Add('delinkclientserveronrst', $delinkclientserveronrst) } if ( $PSBoundParameters.ContainsKey('rfc5961chlgacklimit') ) { $payload.Add('rfc5961chlgacklimit', $rfc5961chlgacklimit) } if ( $PSCmdlet.ShouldProcess("nstcpparam", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nstcpparam -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNstcpparam: Finished" } } function Invoke-NSGetNstcpparam { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for tcp parameters resource. .PARAMETER GetAll Retrieve all nstcpparam object(s). .PARAMETER Count If specified, the count of the nstcpparam object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNstcpparam Get data. .EXAMPLE PS C:\>Invoke-NSGetNstcpparam -GetAll Get all nstcpparam data. .EXAMPLE PS C:\>Invoke-NSGetNstcpparam -name <string> Get nstcpparam object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNstcpparam -Filter @{ 'name'='<value>' } Get nstcpparam data with a filter. .NOTES File Name : Invoke-NSGetNstcpparam Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstcpparam/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNstcpparam: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nstcpparam objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstcpparam -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nstcpparam objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstcpparam -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nstcpparam objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstcpparam -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nstcpparam configuration for property ''" } else { Write-Verbose "Retrieving nstcpparam configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstcpparam -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNstcpparam: Ended" } } function Invoke-NSAddNstcpprofile { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Configuration for TCP profile resource. .PARAMETER Name Name for a TCP profile. Must begin with a letter, number, or the underscore \(_\) character. Other characters allowed, after the first character, are the hyphen \(-\), period \(.\), hash \(\#\), space \( \), at \(@\), colon \(:\), and equal \(=\) characters. The name of a TCP profile cannot be changed after it is created. CLI Users: If the name includes one or more spaces, enclose the name in double or single quotation marks \(for example, "my tcp profile" or 'my tcp profile'\). .PARAMETER Ws Enable or disable window scaling. Possible values = ENABLED, DISABLED .PARAMETER Sack Enable or disable Selective ACKnowledgement (SACK). Possible values = ENABLED, DISABLED .PARAMETER Wsval Factor used to calculate the new window size. This argument is needed only when window scaling is enabled. Maximum value = 14 .PARAMETER Nagle Enable or disable the Nagle algorithm on TCP connections. Possible values = ENABLED, DISABLED .PARAMETER Ackonpush Send immediate positive acknowledgement (ACK) on receipt of TCP packets with PUSH flag. Possible values = ENABLED, DISABLED .PARAMETER Mss Maximum number of octets to allow in a TCP data segment. Maximum value = 9176 .PARAMETER Maxburst Maximum number of TCP segments allowed in a burst. Maximum value = 255 .PARAMETER Initialcwnd Initial maximum upper limit on the number of TCP packets that can be outstanding on the TCP link to the server. Maximum value = 44 .PARAMETER Delayedack Timeout for TCP delayed ACK, in milliseconds. Maximum value = 300 .PARAMETER Oooqsize Maximum size of out-of-order packets queue. A value of 0 means no limit. Maximum value = 65535 .PARAMETER Maxpktpermss Maximum number of TCP packets allowed per maximum segment size (MSS). Maximum value = 1460 .PARAMETER Pktperretx Maximum limit on the number of packets that should be retransmitted on receiving a partial ACK. Maximum value = 512 .PARAMETER Minrto Minimum retransmission timeout, in milliseconds, specified in 10-millisecond increments (value must yield a whole number if divided by 10). Maximum value = 64000 .PARAMETER Slowstartincr Multiplier that determines the rate at which slow start increases the size of the TCP transmission window after each acknowledgement of successful transmission. Maximum value = 100 .PARAMETER Buffersize TCP buffering size, in bytes. Maximum value = 20971520 .PARAMETER Syncookie Enable or disable the SYNCOOKIE mechanism for TCP handshake with clients. Disabling SYNCOOKIE prevents SYN attack protection on the Citrix ADC. Possible values = ENABLED, DISABLED .PARAMETER Kaprobeupdatelastactivity Update last activity for the connection after receiving keep-alive (KA) probes. Possible values = ENABLED, DISABLED .PARAMETER Flavor Set TCP congestion control algorithm. Possible values = Default, Westwood, BIC, CUBIC, Nile .PARAMETER Dynamicreceivebuffering Enable or disable dynamic receive buffering. When enabled, allows the receive buffer to be adjusted dynamically based on memory and network conditions. Note: The buffer size argument must be set for dynamic adjustments to take place. Possible values = ENABLED, DISABLED .PARAMETER Ka Send periodic TCP keep-alive (KA) probes to check if peer is still up. Possible values = ENABLED, DISABLED .PARAMETER Kaconnidletime Duration, in seconds, for the connection to be idle, before sending a keep-alive (KA) probe. Maximum value = 4095 .PARAMETER Kamaxprobes Number of keep-alive (KA) probes to be sent when not acknowledged, before assuming the peer to be down. Maximum value = 254 .PARAMETER Kaprobeinterval Time interval, in seconds, before the next keep-alive (KA) probe, if the peer does not respond. Maximum value = 4095 .PARAMETER Sendbuffsize TCP Send Buffer Size. Maximum value = 20971520 .PARAMETER Mptcp Enable or disable Multipath TCP. Possible values = ENABLED, DISABLED .PARAMETER Establishclientconn Establishing Client Client connection on First data/ Final-ACK / Automatic. Possible values = AUTOMATIC, CONN_ESTABLISHED, ON_FIRST_DATA .PARAMETER Tcpsegoffload Offload TCP segmentation to the NIC. If set to AUTOMATIC, TCP segmentation will be offloaded to the NIC, if the NIC supports it. Possible values = AUTOMATIC, DISABLED .PARAMETER Rfc5961compliance Enable or disable RFC 5961 compliance to protect against tcp spoofing(RST/SYN/Data). When enabled, will be compliant with RFC 5961. Possible values = ENABLED, DISABLED .PARAMETER Rstwindowattenuate Enable or disable RST window attenuation to protect against spoofing. When enabled, will reply with corrective ACK when a sequence number is invalid. Possible values = ENABLED, DISABLED .PARAMETER Rstmaxack Enable or disable acceptance of RST that is out of window yet echoes highest ACK sequence number. Useful only in proxy mode. Possible values = ENABLED, DISABLED .PARAMETER Spoofsyndrop Enable or disable drop of invalid SYN packets to protect against spoofing. When disabled, established connections will be reset when a SYN packet is received. Possible values = ENABLED, DISABLED .PARAMETER Ecn Enable or disable TCP Explicit Congestion Notification. Possible values = ENABLED, DISABLED .PARAMETER Mptcpdropdataonpreestsf Enable or disable silently dropping the data on Pre-Established subflow. When enabled, DSS data packets are dropped silently instead of dropping the connection when data is received on pre established subflow. Possible values = ENABLED, DISABLED .PARAMETER Mptcpfastopen Enable or disable Multipath TCP fastopen. When enabled, DSS data packets are accepted before receiving the third ack of SYN handshake. Possible values = ENABLED, DISABLED .PARAMETER Mptcpsessiontimeout MPTCP session timeout in seconds. If this value is not set, idle MPTCP sessions are flushed after vserver's client idle timeout. Maximum value = 86400 .PARAMETER Timestamp Enable or Disable TCP Timestamp option (RFC 1323). Possible values = ENABLED, DISABLED .PARAMETER Dsack Enable or disable DSACK. Possible values = ENABLED, DISABLED .PARAMETER Ackaggregation Enable or disable ACK Aggregation. Possible values = ENABLED, DISABLED .PARAMETER Frto Enable or disable FRTO (Forward RTO-Recovery). Possible values = ENABLED, DISABLED .PARAMETER Maxcwnd TCP Maximum Congestion Window. Maximum value = 20971520 .PARAMETER Fack Enable or disable FACK (Forward ACK). Possible values = ENABLED, DISABLED .PARAMETER Tcpmode TCP Optimization modes TRANSPARENT / ENDPOINT. Possible values = TRANSPARENT, ENDPOINT .PARAMETER Tcpfastopen Enable or disable TCP Fastopen. When enabled, NS can receive or send Data in SYN or SYN-ACK packets. Possible values = ENABLED, DISABLED .PARAMETER Hystart Enable or disable CUBIC Hystart. Possible values = ENABLED, DISABLED .PARAMETER Dupackthresh TCP dupack threshold. Maximum value = 15 .PARAMETER Burstratecontrol TCP Burst Rate Control DISABLED/FIXED/DYNAMIC. FIXED requires a TCP rate to be set. Possible values = DISABLED, FIXED, DYNAMIC .PARAMETER Tcprate TCP connection payload send rate in Kb/s. Maximum value = 10000000 .PARAMETER Rateqmax Maximum connection queue size in bytes, when BurstRateControl is used. Maximum value = 1000000000 .PARAMETER Drophalfclosedconnontimeout Silently drop tcp half closed connections on idle timeout. Possible values = ENABLED, DISABLED .PARAMETER Dropestconnontimeout Silently drop tcp established connections on idle timeout. Possible values = ENABLED, DISABLED .PARAMETER Applyadaptivetcp Apply Adaptive TCP optimizations. Possible values = ENABLED, DISABLED .PARAMETER Tcpfastopencookiesize TCP FastOpen Cookie size. This accepts only even numbers. Odd number is trimmed down to nearest even number. Maximum value = 16 .PARAMETER Taillossprobe TCP tail loss probe optimizations. Possible values = ENABLED, DISABLED .PARAMETER Clientiptcpoption Client IP in TCP options. Possible values = ENABLED, DISABLED .PARAMETER Clientiptcpoptionnumber ClientIP TCP Option number. Maximum value = 254 .PARAMETER Mpcapablecbit Set C bit in MP-CAPABLE Syn-Ack sent by Citrix ADC. Possible values = ENABLED, DISABLED .PARAMETER Sendclientportintcpoption Send Client Port number along with Client IP in TCP-Options. ClientIpTcpOption must be ENABLED. Possible values = ENABLED, DISABLED .PARAMETER Slowstartthreshold TCP Slow Start Threhsold Value. Maximum value = 20971520 .PARAMETER PassThru Return details about the created nstcpprofile item. .EXAMPLE PS C:\>Invoke-NSAddNstcpprofile -name <string> An example how to add nstcpprofile config Object(s). .NOTES File Name : Invoke-NSAddNstcpprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstcpprofile/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateLength(1, 127)] [string]$Name, [ValidateSet('ENABLED', 'DISABLED')] [string]$Ws = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Sack = 'DISABLED', [double]$Wsval = '4', [ValidateSet('ENABLED', 'DISABLED')] [string]$Nagle = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Ackonpush = 'ENABLED', [double]$Mss, [double]$Maxburst = '6', [double]$Initialcwnd = '4', [double]$Delayedack = '100', [double]$Oooqsize = '64', [double]$Maxpktpermss, [double]$Pktperretx = '1', [double]$Minrto = '1000', [double]$Slowstartincr = '2', [double]$Buffersize = '8190', [ValidateSet('ENABLED', 'DISABLED')] [string]$Syncookie = 'ENABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Kaprobeupdatelastactivity = 'ENABLED', [ValidateSet('Default', 'Westwood', 'BIC', 'CUBIC', 'Nile')] [string]$Flavor = 'Default', [ValidateSet('ENABLED', 'DISABLED')] [string]$Dynamicreceivebuffering = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Ka = 'DISABLED', [double]$Kaconnidletime, [double]$Kamaxprobes, [double]$Kaprobeinterval, [double]$Sendbuffsize = '8190', [ValidateSet('ENABLED', 'DISABLED')] [string]$Mptcp = 'DISABLED', [ValidateSet('AUTOMATIC', 'CONN_ESTABLISHED', 'ON_FIRST_DATA')] [string]$Establishclientconn = 'AUTOMATIC', [ValidateSet('AUTOMATIC', 'DISABLED')] [string]$Tcpsegoffload = 'AUTOMATIC', [ValidateSet('ENABLED', 'DISABLED')] [string]$Rfc5961compliance = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Rstwindowattenuate = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Rstmaxack = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Spoofsyndrop = 'ENABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Ecn = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Mptcpdropdataonpreestsf = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Mptcpfastopen = 'DISABLED', [double]$Mptcpsessiontimeout = '0', [ValidateSet('ENABLED', 'DISABLED')] [string]$Timestamp = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Dsack = 'ENABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Ackaggregation = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Frto = 'DISABLED', [double]$Maxcwnd = '524288', [ValidateSet('ENABLED', 'DISABLED')] [string]$Fack = 'DISABLED', [ValidateSet('TRANSPARENT', 'ENDPOINT')] [string]$Tcpmode = 'TRANSPARENT', [ValidateSet('ENABLED', 'DISABLED')] [string]$Tcpfastopen = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Hystart = 'DISABLED', [double]$Dupackthresh = '3', [ValidateSet('DISABLED', 'FIXED', 'DYNAMIC')] [string]$Burstratecontrol = 'DISABLED', [double]$Tcprate = '0', [double]$Rateqmax = '0', [ValidateSet('ENABLED', 'DISABLED')] [string]$Drophalfclosedconnontimeout = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Dropestconnontimeout = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Applyadaptivetcp = 'DISABLED', [double]$Tcpfastopencookiesize = '8', [ValidateSet('ENABLED', 'DISABLED')] [string]$Taillossprobe = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Clientiptcpoption = 'DISABLED', [double]$Clientiptcpoptionnumber, [ValidateSet('ENABLED', 'DISABLED')] [string]$Mpcapablecbit = 'DISABLED', [ValidateSet('ENABLED', 'DISABLED')] [string]$Sendclientportintcpoption = 'DISABLED', [double]$Slowstartthreshold = '524288', [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNstcpprofile: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('ws') ) { $payload.Add('ws', $ws) } if ( $PSBoundParameters.ContainsKey('sack') ) { $payload.Add('sack', $sack) } if ( $PSBoundParameters.ContainsKey('wsval') ) { $payload.Add('wsval', $wsval) } if ( $PSBoundParameters.ContainsKey('nagle') ) { $payload.Add('nagle', $nagle) } if ( $PSBoundParameters.ContainsKey('ackonpush') ) { $payload.Add('ackonpush', $ackonpush) } if ( $PSBoundParameters.ContainsKey('mss') ) { $payload.Add('mss', $mss) } if ( $PSBoundParameters.ContainsKey('maxburst') ) { $payload.Add('maxburst', $maxburst) } if ( $PSBoundParameters.ContainsKey('initialcwnd') ) { $payload.Add('initialcwnd', $initialcwnd) } if ( $PSBoundParameters.ContainsKey('delayedack') ) { $payload.Add('delayedack', $delayedack) } if ( $PSBoundParameters.ContainsKey('oooqsize') ) { $payload.Add('oooqsize', $oooqsize) } if ( $PSBoundParameters.ContainsKey('maxpktpermss') ) { $payload.Add('maxpktpermss', $maxpktpermss) } if ( $PSBoundParameters.ContainsKey('pktperretx') ) { $payload.Add('pktperretx', $pktperretx) } if ( $PSBoundParameters.ContainsKey('minrto') ) { $payload.Add('minrto', $minrto) } if ( $PSBoundParameters.ContainsKey('slowstartincr') ) { $payload.Add('slowstartincr', $slowstartincr) } if ( $PSBoundParameters.ContainsKey('buffersize') ) { $payload.Add('buffersize', $buffersize) } if ( $PSBoundParameters.ContainsKey('syncookie') ) { $payload.Add('syncookie', $syncookie) } if ( $PSBoundParameters.ContainsKey('kaprobeupdatelastactivity') ) { $payload.Add('kaprobeupdatelastactivity', $kaprobeupdatelastactivity) } if ( $PSBoundParameters.ContainsKey('flavor') ) { $payload.Add('flavor', $flavor) } if ( $PSBoundParameters.ContainsKey('dynamicreceivebuffering') ) { $payload.Add('dynamicreceivebuffering', $dynamicreceivebuffering) } if ( $PSBoundParameters.ContainsKey('ka') ) { $payload.Add('ka', $ka) } if ( $PSBoundParameters.ContainsKey('kaconnidletime') ) { $payload.Add('kaconnidletime', $kaconnidletime) } if ( $PSBoundParameters.ContainsKey('kamaxprobes') ) { $payload.Add('kamaxprobes', $kamaxprobes) } if ( $PSBoundParameters.ContainsKey('kaprobeinterval') ) { $payload.Add('kaprobeinterval', $kaprobeinterval) } if ( $PSBoundParameters.ContainsKey('sendbuffsize') ) { $payload.Add('sendbuffsize', $sendbuffsize) } if ( $PSBoundParameters.ContainsKey('mptcp') ) { $payload.Add('mptcp', $mptcp) } if ( $PSBoundParameters.ContainsKey('establishclientconn') ) { $payload.Add('establishclientconn', $establishclientconn) } if ( $PSBoundParameters.ContainsKey('tcpsegoffload') ) { $payload.Add('tcpsegoffload', $tcpsegoffload) } if ( $PSBoundParameters.ContainsKey('rfc5961compliance') ) { $payload.Add('rfc5961compliance', $rfc5961compliance) } if ( $PSBoundParameters.ContainsKey('rstwindowattenuate') ) { $payload.Add('rstwindowattenuate', $rstwindowattenuate) } if ( $PSBoundParameters.ContainsKey('rstmaxack') ) { $payload.Add('rstmaxack', $rstmaxack) } if ( $PSBoundParameters.ContainsKey('spoofsyndrop') ) { $payload.Add('spoofsyndrop', $spoofsyndrop) } if ( $PSBoundParameters.ContainsKey('ecn') ) { $payload.Add('ecn', $ecn) } if ( $PSBoundParameters.ContainsKey('mptcpdropdataonpreestsf') ) { $payload.Add('mptcpdropdataonpreestsf', $mptcpdropdataonpreestsf) } if ( $PSBoundParameters.ContainsKey('mptcpfastopen') ) { $payload.Add('mptcpfastopen', $mptcpfastopen) } if ( $PSBoundParameters.ContainsKey('mptcpsessiontimeout') ) { $payload.Add('mptcpsessiontimeout', $mptcpsessiontimeout) } if ( $PSBoundParameters.ContainsKey('timestamp') ) { $payload.Add('timestamp', $timestamp) } if ( $PSBoundParameters.ContainsKey('dsack') ) { $payload.Add('dsack', $dsack) } if ( $PSBoundParameters.ContainsKey('ackaggregation') ) { $payload.Add('ackaggregation', $ackaggregation) } if ( $PSBoundParameters.ContainsKey('frto') ) { $payload.Add('frto', $frto) } if ( $PSBoundParameters.ContainsKey('maxcwnd') ) { $payload.Add('maxcwnd', $maxcwnd) } if ( $PSBoundParameters.ContainsKey('fack') ) { $payload.Add('fack', $fack) } if ( $PSBoundParameters.ContainsKey('tcpmode') ) { $payload.Add('tcpmode', $tcpmode) } if ( $PSBoundParameters.ContainsKey('tcpfastopen') ) { $payload.Add('tcpfastopen', $tcpfastopen) } if ( $PSBoundParameters.ContainsKey('hystart') ) { $payload.Add('hystart', $hystart) } if ( $PSBoundParameters.ContainsKey('dupackthresh') ) { $payload.Add('dupackthresh', $dupackthresh) } if ( $PSBoundParameters.ContainsKey('burstratecontrol') ) { $payload.Add('burstratecontrol', $burstratecontrol) } if ( $PSBoundParameters.ContainsKey('tcprate') ) { $payload.Add('tcprate', $tcprate) } if ( $PSBoundParameters.ContainsKey('rateqmax') ) { $payload.Add('rateqmax', $rateqmax) } if ( $PSBoundParameters.ContainsKey('drophalfclosedconnontimeout') ) { $payload.Add('drophalfclosedconnontimeout', $drophalfclosedconnontimeout) } if ( $PSBoundParameters.ContainsKey('dropestconnontimeout') ) { $payload.Add('dropestconnontimeout', $dropestconnontimeout) } if ( $PSBoundParameters.ContainsKey('applyadaptivetcp') ) { $payload.Add('applyadaptivetcp', $applyadaptivetcp) } if ( $PSBoundParameters.ContainsKey('tcpfastopencookiesize') ) { $payload.Add('tcpfastopencookiesize', $tcpfastopencookiesize) } if ( $PSBoundParameters.ContainsKey('taillossprobe') ) { $payload.Add('taillossprobe', $taillossprobe) } if ( $PSBoundParameters.ContainsKey('clientiptcpoption') ) { $payload.Add('clientiptcpoption', $clientiptcpoption) } if ( $PSBoundParameters.ContainsKey('clientiptcpoptionnumber') ) { $payload.Add('clientiptcpoptionnumber', $clientiptcpoptionnumber) } if ( $PSBoundParameters.ContainsKey('mpcapablecbit') ) { $payload.Add('mpcapablecbit', $mpcapablecbit) } if ( $PSBoundParameters.ContainsKey('sendclientportintcpoption') ) { $payload.Add('sendclientportintcpoption', $sendclientportintcpoption) } if ( $PSBoundParameters.ContainsKey('slowstartthreshold') ) { $payload.Add('slowstartthreshold', $slowstartthreshold) } if ( $PSCmdlet.ShouldProcess("nstcpprofile", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nstcpprofile -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNstcpprofile -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNstcpprofile: Finished" } } function Invoke-NSDeleteNstcpprofile { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Configuration for TCP profile resource. .PARAMETER Name Name for a TCP profile. Must begin with a letter, number, or the underscore \(_\) character. Other characters allowed, after the first character, are the hyphen \(-\), period \(.\), hash \(\#\), space \( \), at \(@\), colon \(:\), and equal \(=\) characters. The name of a TCP profile cannot be changed after it is created. CLI Users: If the name includes one or more spaces, enclose the name in double or single quotation marks \(for example, "my tcp profile" or 'my tcp profile'\). .EXAMPLE PS C:\>Invoke-NSDeleteNstcpprofile -Name <string> An example how to delete nstcpprofile config Object(s). .NOTES File Name : Invoke-NSDeleteNstcpprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstcpprofile/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Name ) begin { Write-Verbose "Invoke-NSDeleteNstcpprofile: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nstcpprofile -NitroPath nitro/v1/config -Resource $name -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNstcpprofile: Finished" } } function Invoke-NSUpdateNstcpprofile { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for TCP profile resource. .PARAMETER Name Name for a TCP profile. Must begin with a letter, number, or the underscore \(_\) character. Other characters allowed, after the first character, are the hyphen \(-\), period \(.\), hash \(\#\), space \( \), at \(@\), colon \(:\), and equal \(=\) characters. The name of a TCP profile cannot be changed after it is created. CLI Users: If the name includes one or more spaces, enclose the name in double or single quotation marks \(for example, "my tcp profile" or 'my tcp profile'\). .PARAMETER Ws Enable or disable window scaling. Possible values = ENABLED, DISABLED .PARAMETER Sack Enable or disable Selective ACKnowledgement (SACK). Possible values = ENABLED, DISABLED .PARAMETER Wsval Factor used to calculate the new window size. This argument is needed only when window scaling is enabled. Maximum value = 14 .PARAMETER Nagle Enable or disable the Nagle algorithm on TCP connections. Possible values = ENABLED, DISABLED .PARAMETER Ackonpush Send immediate positive acknowledgement (ACK) on receipt of TCP packets with PUSH flag. Possible values = ENABLED, DISABLED .PARAMETER Mss Maximum number of octets to allow in a TCP data segment. Maximum value = 9176 .PARAMETER Maxburst Maximum number of TCP segments allowed in a burst. Maximum value = 255 .PARAMETER Initialcwnd Initial maximum upper limit on the number of TCP packets that can be outstanding on the TCP link to the server. Maximum value = 44 .PARAMETER Delayedack Timeout for TCP delayed ACK, in milliseconds. Maximum value = 300 .PARAMETER Oooqsize Maximum size of out-of-order packets queue. A value of 0 means no limit. Maximum value = 65535 .PARAMETER Maxpktpermss Maximum number of TCP packets allowed per maximum segment size (MSS). Maximum value = 1460 .PARAMETER Pktperretx Maximum limit on the number of packets that should be retransmitted on receiving a partial ACK. Maximum value = 512 .PARAMETER Minrto Minimum retransmission timeout, in milliseconds, specified in 10-millisecond increments (value must yield a whole number if divided by 10). Maximum value = 64000 .PARAMETER Slowstartincr Multiplier that determines the rate at which slow start increases the size of the TCP transmission window after each acknowledgement of successful transmission. Maximum value = 100 .PARAMETER Buffersize TCP buffering size, in bytes. Maximum value = 20971520 .PARAMETER Syncookie Enable or disable the SYNCOOKIE mechanism for TCP handshake with clients. Disabling SYNCOOKIE prevents SYN attack protection on the Citrix ADC. Possible values = ENABLED, DISABLED .PARAMETER Kaprobeupdatelastactivity Update last activity for the connection after receiving keep-alive (KA) probes. Possible values = ENABLED, DISABLED .PARAMETER Flavor Set TCP congestion control algorithm. Possible values = Default, Westwood, BIC, CUBIC, Nile .PARAMETER Dynamicreceivebuffering Enable or disable dynamic receive buffering. When enabled, allows the receive buffer to be adjusted dynamically based on memory and network conditions. Note: The buffer size argument must be set for dynamic adjustments to take place. Possible values = ENABLED, DISABLED .PARAMETER Ka Send periodic TCP keep-alive (KA) probes to check if peer is still up. Possible values = ENABLED, DISABLED .PARAMETER Kaconnidletime Duration, in seconds, for the connection to be idle, before sending a keep-alive (KA) probe. Maximum value = 4095 .PARAMETER Kamaxprobes Number of keep-alive (KA) probes to be sent when not acknowledged, before assuming the peer to be down. Maximum value = 254 .PARAMETER Kaprobeinterval Time interval, in seconds, before the next keep-alive (KA) probe, if the peer does not respond. Maximum value = 4095 .PARAMETER Sendbuffsize TCP Send Buffer Size. Maximum value = 20971520 .PARAMETER Mptcp Enable or disable Multipath TCP. Possible values = ENABLED, DISABLED .PARAMETER Establishclientconn Establishing Client Client connection on First data/ Final-ACK / Automatic. Possible values = AUTOMATIC, CONN_ESTABLISHED, ON_FIRST_DATA .PARAMETER Tcpsegoffload Offload TCP segmentation to the NIC. If set to AUTOMATIC, TCP segmentation will be offloaded to the NIC, if the NIC supports it. Possible values = AUTOMATIC, DISABLED .PARAMETER Rfc5961compliance Enable or disable RFC 5961 compliance to protect against tcp spoofing(RST/SYN/Data). When enabled, will be compliant with RFC 5961. Possible values = ENABLED, DISABLED .PARAMETER Rstwindowattenuate Enable or disable RST window attenuation to protect against spoofing. When enabled, will reply with corrective ACK when a sequence number is invalid. Possible values = ENABLED, DISABLED .PARAMETER Rstmaxack Enable or disable acceptance of RST that is out of window yet echoes highest ACK sequence number. Useful only in proxy mode. Possible values = ENABLED, DISABLED .PARAMETER Spoofsyndrop Enable or disable drop of invalid SYN packets to protect against spoofing. When disabled, established connections will be reset when a SYN packet is received. Possible values = ENABLED, DISABLED .PARAMETER Ecn Enable or disable TCP Explicit Congestion Notification. Possible values = ENABLED, DISABLED .PARAMETER Mptcpdropdataonpreestsf Enable or disable silently dropping the data on Pre-Established subflow. When enabled, DSS data packets are dropped silently instead of dropping the connection when data is received on pre established subflow. Possible values = ENABLED, DISABLED .PARAMETER Mptcpfastopen Enable or disable Multipath TCP fastopen. When enabled, DSS data packets are accepted before receiving the third ack of SYN handshake. Possible values = ENABLED, DISABLED .PARAMETER Mptcpsessiontimeout MPTCP session timeout in seconds. If this value is not set, idle MPTCP sessions are flushed after vserver's client idle timeout. Maximum value = 86400 .PARAMETER Timestamp Enable or Disable TCP Timestamp option (RFC 1323). Possible values = ENABLED, DISABLED .PARAMETER Dsack Enable or disable DSACK. Possible values = ENABLED, DISABLED .PARAMETER Ackaggregation Enable or disable ACK Aggregation. Possible values = ENABLED, DISABLED .PARAMETER Frto Enable or disable FRTO (Forward RTO-Recovery). Possible values = ENABLED, DISABLED .PARAMETER Maxcwnd TCP Maximum Congestion Window. Maximum value = 20971520 .PARAMETER Fack Enable or disable FACK (Forward ACK). Possible values = ENABLED, DISABLED .PARAMETER Tcpmode TCP Optimization modes TRANSPARENT / ENDPOINT. Possible values = TRANSPARENT, ENDPOINT .PARAMETER Tcpfastopen Enable or disable TCP Fastopen. When enabled, NS can receive or send Data in SYN or SYN-ACK packets. Possible values = ENABLED, DISABLED .PARAMETER Hystart Enable or disable CUBIC Hystart. Possible values = ENABLED, DISABLED .PARAMETER Dupackthresh TCP dupack threshold. Maximum value = 15 .PARAMETER Burstratecontrol TCP Burst Rate Control DISABLED/FIXED/DYNAMIC. FIXED requires a TCP rate to be set. Possible values = DISABLED, FIXED, DYNAMIC .PARAMETER Tcprate TCP connection payload send rate in Kb/s. Maximum value = 10000000 .PARAMETER Rateqmax Maximum connection queue size in bytes, when BurstRateControl is used. Maximum value = 1000000000 .PARAMETER Drophalfclosedconnontimeout Silently drop tcp half closed connections on idle timeout. Possible values = ENABLED, DISABLED .PARAMETER Dropestconnontimeout Silently drop tcp established connections on idle timeout. Possible values = ENABLED, DISABLED .PARAMETER Applyadaptivetcp Apply Adaptive TCP optimizations. Possible values = ENABLED, DISABLED .PARAMETER Tcpfastopencookiesize TCP FastOpen Cookie size. This accepts only even numbers. Odd number is trimmed down to nearest even number. Maximum value = 16 .PARAMETER Taillossprobe TCP tail loss probe optimizations. Possible values = ENABLED, DISABLED .PARAMETER Clientiptcpoption Client IP in TCP options. Possible values = ENABLED, DISABLED .PARAMETER Clientiptcpoptionnumber ClientIP TCP Option number. Maximum value = 254 .PARAMETER Mpcapablecbit Set C bit in MP-CAPABLE Syn-Ack sent by Citrix ADC. Possible values = ENABLED, DISABLED .PARAMETER Sendclientportintcpoption Send Client Port number along with Client IP in TCP-Options. ClientIpTcpOption must be ENABLED. Possible values = ENABLED, DISABLED .PARAMETER Slowstartthreshold TCP Slow Start Threhsold Value. Maximum value = 20971520 .PARAMETER PassThru Return details about the created nstcpprofile item. .EXAMPLE PS C:\>Invoke-NSUpdateNstcpprofile -name <string> An example how to update nstcpprofile config Object(s). .NOTES File Name : Invoke-NSUpdateNstcpprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstcpprofile/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateLength(1, 127)] [string]$Name, [ValidateSet('ENABLED', 'DISABLED')] [string]$Ws, [ValidateSet('ENABLED', 'DISABLED')] [string]$Sack, [double]$Wsval, [ValidateSet('ENABLED', 'DISABLED')] [string]$Nagle, [ValidateSet('ENABLED', 'DISABLED')] [string]$Ackonpush, [double]$Mss, [double]$Maxburst, [double]$Initialcwnd, [double]$Delayedack, [double]$Oooqsize, [double]$Maxpktpermss, [double]$Pktperretx, [double]$Minrto, [double]$Slowstartincr, [double]$Buffersize, [ValidateSet('ENABLED', 'DISABLED')] [string]$Syncookie, [ValidateSet('ENABLED', 'DISABLED')] [string]$Kaprobeupdatelastactivity, [ValidateSet('Default', 'Westwood', 'BIC', 'CUBIC', 'Nile')] [string]$Flavor, [ValidateSet('ENABLED', 'DISABLED')] [string]$Dynamicreceivebuffering, [ValidateSet('ENABLED', 'DISABLED')] [string]$Ka, [double]$Kaconnidletime, [double]$Kamaxprobes, [double]$Kaprobeinterval, [double]$Sendbuffsize, [ValidateSet('ENABLED', 'DISABLED')] [string]$Mptcp, [ValidateSet('AUTOMATIC', 'CONN_ESTABLISHED', 'ON_FIRST_DATA')] [string]$Establishclientconn, [ValidateSet('AUTOMATIC', 'DISABLED')] [string]$Tcpsegoffload, [ValidateSet('ENABLED', 'DISABLED')] [string]$Rfc5961compliance, [ValidateSet('ENABLED', 'DISABLED')] [string]$Rstwindowattenuate, [ValidateSet('ENABLED', 'DISABLED')] [string]$Rstmaxack, [ValidateSet('ENABLED', 'DISABLED')] [string]$Spoofsyndrop, [ValidateSet('ENABLED', 'DISABLED')] [string]$Ecn, [ValidateSet('ENABLED', 'DISABLED')] [string]$Mptcpdropdataonpreestsf, [ValidateSet('ENABLED', 'DISABLED')] [string]$Mptcpfastopen, [double]$Mptcpsessiontimeout, [ValidateSet('ENABLED', 'DISABLED')] [string]$Timestamp, [ValidateSet('ENABLED', 'DISABLED')] [string]$Dsack, [ValidateSet('ENABLED', 'DISABLED')] [string]$Ackaggregation, [ValidateSet('ENABLED', 'DISABLED')] [string]$Frto, [double]$Maxcwnd, [ValidateSet('ENABLED', 'DISABLED')] [string]$Fack, [ValidateSet('TRANSPARENT', 'ENDPOINT')] [string]$Tcpmode, [ValidateSet('ENABLED', 'DISABLED')] [string]$Tcpfastopen, [ValidateSet('ENABLED', 'DISABLED')] [string]$Hystart, [double]$Dupackthresh, [ValidateSet('DISABLED', 'FIXED', 'DYNAMIC')] [string]$Burstratecontrol, [double]$Tcprate, [double]$Rateqmax, [ValidateSet('ENABLED', 'DISABLED')] [string]$Drophalfclosedconnontimeout, [ValidateSet('ENABLED', 'DISABLED')] [string]$Dropestconnontimeout, [ValidateSet('ENABLED', 'DISABLED')] [string]$Applyadaptivetcp, [double]$Tcpfastopencookiesize, [ValidateSet('ENABLED', 'DISABLED')] [string]$Taillossprobe, [ValidateSet('ENABLED', 'DISABLED')] [string]$Clientiptcpoption, [double]$Clientiptcpoptionnumber, [ValidateSet('ENABLED', 'DISABLED')] [string]$Mpcapablecbit, [ValidateSet('ENABLED', 'DISABLED')] [string]$Sendclientportintcpoption, [double]$Slowstartthreshold, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateNstcpprofile: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('ws') ) { $payload.Add('ws', $ws) } if ( $PSBoundParameters.ContainsKey('sack') ) { $payload.Add('sack', $sack) } if ( $PSBoundParameters.ContainsKey('wsval') ) { $payload.Add('wsval', $wsval) } if ( $PSBoundParameters.ContainsKey('nagle') ) { $payload.Add('nagle', $nagle) } if ( $PSBoundParameters.ContainsKey('ackonpush') ) { $payload.Add('ackonpush', $ackonpush) } if ( $PSBoundParameters.ContainsKey('mss') ) { $payload.Add('mss', $mss) } if ( $PSBoundParameters.ContainsKey('maxburst') ) { $payload.Add('maxburst', $maxburst) } if ( $PSBoundParameters.ContainsKey('initialcwnd') ) { $payload.Add('initialcwnd', $initialcwnd) } if ( $PSBoundParameters.ContainsKey('delayedack') ) { $payload.Add('delayedack', $delayedack) } if ( $PSBoundParameters.ContainsKey('oooqsize') ) { $payload.Add('oooqsize', $oooqsize) } if ( $PSBoundParameters.ContainsKey('maxpktpermss') ) { $payload.Add('maxpktpermss', $maxpktpermss) } if ( $PSBoundParameters.ContainsKey('pktperretx') ) { $payload.Add('pktperretx', $pktperretx) } if ( $PSBoundParameters.ContainsKey('minrto') ) { $payload.Add('minrto', $minrto) } if ( $PSBoundParameters.ContainsKey('slowstartincr') ) { $payload.Add('slowstartincr', $slowstartincr) } if ( $PSBoundParameters.ContainsKey('buffersize') ) { $payload.Add('buffersize', $buffersize) } if ( $PSBoundParameters.ContainsKey('syncookie') ) { $payload.Add('syncookie', $syncookie) } if ( $PSBoundParameters.ContainsKey('kaprobeupdatelastactivity') ) { $payload.Add('kaprobeupdatelastactivity', $kaprobeupdatelastactivity) } if ( $PSBoundParameters.ContainsKey('flavor') ) { $payload.Add('flavor', $flavor) } if ( $PSBoundParameters.ContainsKey('dynamicreceivebuffering') ) { $payload.Add('dynamicreceivebuffering', $dynamicreceivebuffering) } if ( $PSBoundParameters.ContainsKey('ka') ) { $payload.Add('ka', $ka) } if ( $PSBoundParameters.ContainsKey('kaconnidletime') ) { $payload.Add('kaconnidletime', $kaconnidletime) } if ( $PSBoundParameters.ContainsKey('kamaxprobes') ) { $payload.Add('kamaxprobes', $kamaxprobes) } if ( $PSBoundParameters.ContainsKey('kaprobeinterval') ) { $payload.Add('kaprobeinterval', $kaprobeinterval) } if ( $PSBoundParameters.ContainsKey('sendbuffsize') ) { $payload.Add('sendbuffsize', $sendbuffsize) } if ( $PSBoundParameters.ContainsKey('mptcp') ) { $payload.Add('mptcp', $mptcp) } if ( $PSBoundParameters.ContainsKey('establishclientconn') ) { $payload.Add('establishclientconn', $establishclientconn) } if ( $PSBoundParameters.ContainsKey('tcpsegoffload') ) { $payload.Add('tcpsegoffload', $tcpsegoffload) } if ( $PSBoundParameters.ContainsKey('rfc5961compliance') ) { $payload.Add('rfc5961compliance', $rfc5961compliance) } if ( $PSBoundParameters.ContainsKey('rstwindowattenuate') ) { $payload.Add('rstwindowattenuate', $rstwindowattenuate) } if ( $PSBoundParameters.ContainsKey('rstmaxack') ) { $payload.Add('rstmaxack', $rstmaxack) } if ( $PSBoundParameters.ContainsKey('spoofsyndrop') ) { $payload.Add('spoofsyndrop', $spoofsyndrop) } if ( $PSBoundParameters.ContainsKey('ecn') ) { $payload.Add('ecn', $ecn) } if ( $PSBoundParameters.ContainsKey('mptcpdropdataonpreestsf') ) { $payload.Add('mptcpdropdataonpreestsf', $mptcpdropdataonpreestsf) } if ( $PSBoundParameters.ContainsKey('mptcpfastopen') ) { $payload.Add('mptcpfastopen', $mptcpfastopen) } if ( $PSBoundParameters.ContainsKey('mptcpsessiontimeout') ) { $payload.Add('mptcpsessiontimeout', $mptcpsessiontimeout) } if ( $PSBoundParameters.ContainsKey('timestamp') ) { $payload.Add('timestamp', $timestamp) } if ( $PSBoundParameters.ContainsKey('dsack') ) { $payload.Add('dsack', $dsack) } if ( $PSBoundParameters.ContainsKey('ackaggregation') ) { $payload.Add('ackaggregation', $ackaggregation) } if ( $PSBoundParameters.ContainsKey('frto') ) { $payload.Add('frto', $frto) } if ( $PSBoundParameters.ContainsKey('maxcwnd') ) { $payload.Add('maxcwnd', $maxcwnd) } if ( $PSBoundParameters.ContainsKey('fack') ) { $payload.Add('fack', $fack) } if ( $PSBoundParameters.ContainsKey('tcpmode') ) { $payload.Add('tcpmode', $tcpmode) } if ( $PSBoundParameters.ContainsKey('tcpfastopen') ) { $payload.Add('tcpfastopen', $tcpfastopen) } if ( $PSBoundParameters.ContainsKey('hystart') ) { $payload.Add('hystart', $hystart) } if ( $PSBoundParameters.ContainsKey('dupackthresh') ) { $payload.Add('dupackthresh', $dupackthresh) } if ( $PSBoundParameters.ContainsKey('burstratecontrol') ) { $payload.Add('burstratecontrol', $burstratecontrol) } if ( $PSBoundParameters.ContainsKey('tcprate') ) { $payload.Add('tcprate', $tcprate) } if ( $PSBoundParameters.ContainsKey('rateqmax') ) { $payload.Add('rateqmax', $rateqmax) } if ( $PSBoundParameters.ContainsKey('drophalfclosedconnontimeout') ) { $payload.Add('drophalfclosedconnontimeout', $drophalfclosedconnontimeout) } if ( $PSBoundParameters.ContainsKey('dropestconnontimeout') ) { $payload.Add('dropestconnontimeout', $dropestconnontimeout) } if ( $PSBoundParameters.ContainsKey('applyadaptivetcp') ) { $payload.Add('applyadaptivetcp', $applyadaptivetcp) } if ( $PSBoundParameters.ContainsKey('tcpfastopencookiesize') ) { $payload.Add('tcpfastopencookiesize', $tcpfastopencookiesize) } if ( $PSBoundParameters.ContainsKey('taillossprobe') ) { $payload.Add('taillossprobe', $taillossprobe) } if ( $PSBoundParameters.ContainsKey('clientiptcpoption') ) { $payload.Add('clientiptcpoption', $clientiptcpoption) } if ( $PSBoundParameters.ContainsKey('clientiptcpoptionnumber') ) { $payload.Add('clientiptcpoptionnumber', $clientiptcpoptionnumber) } if ( $PSBoundParameters.ContainsKey('mpcapablecbit') ) { $payload.Add('mpcapablecbit', $mpcapablecbit) } if ( $PSBoundParameters.ContainsKey('sendclientportintcpoption') ) { $payload.Add('sendclientportintcpoption', $sendclientportintcpoption) } if ( $PSBoundParameters.ContainsKey('slowstartthreshold') ) { $payload.Add('slowstartthreshold', $slowstartthreshold) } if ( $PSCmdlet.ShouldProcess("nstcpprofile", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nstcpprofile -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNstcpprofile -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNstcpprofile: Finished" } } function Invoke-NSUnsetNstcpprofile { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for TCP profile resource. .PARAMETER Name Name for a TCP profile. Must begin with a letter, number, or the underscore \(_\) character. Other characters allowed, after the first character, are the hyphen \(-\), period \(.\), hash \(\#\), space \( \), at \(@\), colon \(:\), and equal \(=\) characters. The name of a TCP profile cannot be changed after it is created. CLI Users: If the name includes one or more spaces, enclose the name in double or single quotation marks \(for example, "my tcp profile" or 'my tcp profile'\). .PARAMETER Ws Enable or disable window scaling. Possible values = ENABLED, DISABLED .PARAMETER Sack Enable or disable Selective ACKnowledgement (SACK). Possible values = ENABLED, DISABLED .PARAMETER Wsval Factor used to calculate the new window size. This argument is needed only when window scaling is enabled. Maximum value = 14 .PARAMETER Nagle Enable or disable the Nagle algorithm on TCP connections. Possible values = ENABLED, DISABLED .PARAMETER Ackonpush Send immediate positive acknowledgement (ACK) on receipt of TCP packets with PUSH flag. Possible values = ENABLED, DISABLED .PARAMETER Mss Maximum number of octets to allow in a TCP data segment. Maximum value = 9176 .PARAMETER Maxburst Maximum number of TCP segments allowed in a burst. Maximum value = 255 .PARAMETER Initialcwnd Initial maximum upper limit on the number of TCP packets that can be outstanding on the TCP link to the server. Maximum value = 44 .PARAMETER Delayedack Timeout for TCP delayed ACK, in milliseconds. Maximum value = 300 .PARAMETER Oooqsize Maximum size of out-of-order packets queue. A value of 0 means no limit. Maximum value = 65535 .PARAMETER Maxpktpermss Maximum number of TCP packets allowed per maximum segment size (MSS). Maximum value = 1460 .PARAMETER Pktperretx Maximum limit on the number of packets that should be retransmitted on receiving a partial ACK. Maximum value = 512 .PARAMETER Minrto Minimum retransmission timeout, in milliseconds, specified in 10-millisecond increments (value must yield a whole number if divided by 10). Maximum value = 64000 .PARAMETER Slowstartincr Multiplier that determines the rate at which slow start increases the size of the TCP transmission window after each acknowledgement of successful transmission. Maximum value = 100 .PARAMETER Buffersize TCP buffering size, in bytes. Maximum value = 20971520 .PARAMETER Syncookie Enable or disable the SYNCOOKIE mechanism for TCP handshake with clients. Disabling SYNCOOKIE prevents SYN attack protection on the Citrix ADC. Possible values = ENABLED, DISABLED .PARAMETER Kaprobeupdatelastactivity Update last activity for the connection after receiving keep-alive (KA) probes. Possible values = ENABLED, DISABLED .PARAMETER Flavor Set TCP congestion control algorithm. Possible values = Default, Westwood, BIC, CUBIC, Nile .PARAMETER Dynamicreceivebuffering Enable or disable dynamic receive buffering. When enabled, allows the receive buffer to be adjusted dynamically based on memory and network conditions. Note: The buffer size argument must be set for dynamic adjustments to take place. Possible values = ENABLED, DISABLED .PARAMETER Ka Send periodic TCP keep-alive (KA) probes to check if peer is still up. Possible values = ENABLED, DISABLED .PARAMETER Kamaxprobes Number of keep-alive (KA) probes to be sent when not acknowledged, before assuming the peer to be down. Maximum value = 254 .PARAMETER Kaconnidletime Duration, in seconds, for the connection to be idle, before sending a keep-alive (KA) probe. Maximum value = 4095 .PARAMETER Kaprobeinterval Time interval, in seconds, before the next keep-alive (KA) probe, if the peer does not respond. Maximum value = 4095 .PARAMETER Sendbuffsize TCP Send Buffer Size. Maximum value = 20971520 .PARAMETER Mptcp Enable or disable Multipath TCP. Possible values = ENABLED, DISABLED .PARAMETER Establishclientconn Establishing Client Client connection on First data/ Final-ACK / Automatic. Possible values = AUTOMATIC, CONN_ESTABLISHED, ON_FIRST_DATA .PARAMETER Tcpsegoffload Offload TCP segmentation to the NIC. If set to AUTOMATIC, TCP segmentation will be offloaded to the NIC, if the NIC supports it. Possible values = AUTOMATIC, DISABLED .PARAMETER Rfc5961compliance Enable or disable RFC 5961 compliance to protect against tcp spoofing(RST/SYN/Data). When enabled, will be compliant with RFC 5961. Possible values = ENABLED, DISABLED .PARAMETER Rstwindowattenuate Enable or disable RST window attenuation to protect against spoofing. When enabled, will reply with corrective ACK when a sequence number is invalid. Possible values = ENABLED, DISABLED .PARAMETER Rstmaxack Enable or disable acceptance of RST that is out of window yet echoes highest ACK sequence number. Useful only in proxy mode. Possible values = ENABLED, DISABLED .PARAMETER Spoofsyndrop Enable or disable drop of invalid SYN packets to protect against spoofing. When disabled, established connections will be reset when a SYN packet is received. Possible values = ENABLED, DISABLED .PARAMETER Ecn Enable or disable TCP Explicit Congestion Notification. Possible values = ENABLED, DISABLED .PARAMETER Mptcpdropdataonpreestsf Enable or disable silently dropping the data on Pre-Established subflow. When enabled, DSS data packets are dropped silently instead of dropping the connection when data is received on pre established subflow. Possible values = ENABLED, DISABLED .PARAMETER Mptcpfastopen Enable or disable Multipath TCP fastopen. When enabled, DSS data packets are accepted before receiving the third ack of SYN handshake. Possible values = ENABLED, DISABLED .PARAMETER Mptcpsessiontimeout MPTCP session timeout in seconds. If this value is not set, idle MPTCP sessions are flushed after vserver's client idle timeout. Maximum value = 86400 .PARAMETER Timestamp Enable or Disable TCP Timestamp option (RFC 1323). Possible values = ENABLED, DISABLED .PARAMETER Dsack Enable or disable DSACK. Possible values = ENABLED, DISABLED .PARAMETER Ackaggregation Enable or disable ACK Aggregation. Possible values = ENABLED, DISABLED .PARAMETER Frto Enable or disable FRTO (Forward RTO-Recovery). Possible values = ENABLED, DISABLED .PARAMETER Maxcwnd TCP Maximum Congestion Window. Maximum value = 20971520 .PARAMETER Fack Enable or disable FACK (Forward ACK). Possible values = ENABLED, DISABLED .PARAMETER Tcpmode TCP Optimization modes TRANSPARENT / ENDPOINT. Possible values = TRANSPARENT, ENDPOINT .PARAMETER Tcpfastopen Enable or disable TCP Fastopen. When enabled, NS can receive or send Data in SYN or SYN-ACK packets. Possible values = ENABLED, DISABLED .PARAMETER Hystart Enable or disable CUBIC Hystart. Possible values = ENABLED, DISABLED .PARAMETER Dupackthresh TCP dupack threshold. Maximum value = 15 .PARAMETER Burstratecontrol TCP Burst Rate Control DISABLED/FIXED/DYNAMIC. FIXED requires a TCP rate to be set. Possible values = DISABLED, FIXED, DYNAMIC .PARAMETER Tcprate TCP connection payload send rate in Kb/s. Maximum value = 10000000 .PARAMETER Rateqmax Maximum connection queue size in bytes, when BurstRateControl is used. Maximum value = 1000000000 .PARAMETER Drophalfclosedconnontimeout Silently drop tcp half closed connections on idle timeout. Possible values = ENABLED, DISABLED .PARAMETER Dropestconnontimeout Silently drop tcp established connections on idle timeout. Possible values = ENABLED, DISABLED .PARAMETER Applyadaptivetcp Apply Adaptive TCP optimizations. Possible values = ENABLED, DISABLED .PARAMETER Clientiptcpoption Client IP in TCP options. Possible values = ENABLED, DISABLED .PARAMETER Mpcapablecbit Set C bit in MP-CAPABLE Syn-Ack sent by Citrix ADC. Possible values = ENABLED, DISABLED .PARAMETER Slowstartthreshold TCP Slow Start Threhsold Value. Maximum value = 20971520 .PARAMETER Tcpfastopencookiesize TCP FastOpen Cookie size. This accepts only even numbers. Odd number is trimmed down to nearest even number. Maximum value = 16 .PARAMETER Taillossprobe TCP tail loss probe optimizations. Possible values = ENABLED, DISABLED .PARAMETER Clientiptcpoptionnumber ClientIP TCP Option number. Maximum value = 254 .PARAMETER Sendclientportintcpoption Send Client Port number along with Client IP in TCP-Options. ClientIpTcpOption must be ENABLED. Possible values = ENABLED, DISABLED .EXAMPLE PS C:\>Invoke-NSUnsetNstcpprofile -name <string> An example how to unset nstcpprofile config Object(s). .NOTES File Name : Invoke-NSUnsetNstcpprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstcpprofile Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateLength(1, 127)] [string]$Name, [Boolean]$ws, [Boolean]$sack, [Boolean]$wsval, [Boolean]$nagle, [Boolean]$ackonpush, [Boolean]$mss, [Boolean]$maxburst, [Boolean]$initialcwnd, [Boolean]$delayedack, [Boolean]$oooqsize, [Boolean]$maxpktpermss, [Boolean]$pktperretx, [Boolean]$minrto, [Boolean]$slowstartincr, [Boolean]$buffersize, [Boolean]$syncookie, [Boolean]$kaprobeupdatelastactivity, [Boolean]$flavor, [Boolean]$dynamicreceivebuffering, [Boolean]$ka, [Boolean]$kamaxprobes, [Boolean]$kaconnidletime, [Boolean]$kaprobeinterval, [Boolean]$sendbuffsize, [Boolean]$mptcp, [Boolean]$establishclientconn, [Boolean]$tcpsegoffload, [Boolean]$rfc5961compliance, [Boolean]$rstwindowattenuate, [Boolean]$rstmaxack, [Boolean]$spoofsyndrop, [Boolean]$ecn, [Boolean]$mptcpdropdataonpreestsf, [Boolean]$mptcpfastopen, [Boolean]$mptcpsessiontimeout, [Boolean]$timestamp, [Boolean]$dsack, [Boolean]$ackaggregation, [Boolean]$frto, [Boolean]$maxcwnd, [Boolean]$fack, [Boolean]$tcpmode, [Boolean]$tcpfastopen, [Boolean]$hystart, [Boolean]$dupackthresh, [Boolean]$burstratecontrol, [Boolean]$tcprate, [Boolean]$rateqmax, [Boolean]$drophalfclosedconnontimeout, [Boolean]$dropestconnontimeout, [Boolean]$applyadaptivetcp, [Boolean]$clientiptcpoption, [Boolean]$mpcapablecbit, [Boolean]$slowstartthreshold, [Boolean]$tcpfastopencookiesize, [Boolean]$taillossprobe, [Boolean]$clientiptcpoptionnumber, [Boolean]$sendclientportintcpoption ) begin { Write-Verbose "Invoke-NSUnsetNstcpprofile: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('ws') ) { $payload.Add('ws', $ws) } if ( $PSBoundParameters.ContainsKey('sack') ) { $payload.Add('sack', $sack) } if ( $PSBoundParameters.ContainsKey('wsval') ) { $payload.Add('wsval', $wsval) } if ( $PSBoundParameters.ContainsKey('nagle') ) { $payload.Add('nagle', $nagle) } if ( $PSBoundParameters.ContainsKey('ackonpush') ) { $payload.Add('ackonpush', $ackonpush) } if ( $PSBoundParameters.ContainsKey('mss') ) { $payload.Add('mss', $mss) } if ( $PSBoundParameters.ContainsKey('maxburst') ) { $payload.Add('maxburst', $maxburst) } if ( $PSBoundParameters.ContainsKey('initialcwnd') ) { $payload.Add('initialcwnd', $initialcwnd) } if ( $PSBoundParameters.ContainsKey('delayedack') ) { $payload.Add('delayedack', $delayedack) } if ( $PSBoundParameters.ContainsKey('oooqsize') ) { $payload.Add('oooqsize', $oooqsize) } if ( $PSBoundParameters.ContainsKey('maxpktpermss') ) { $payload.Add('maxpktpermss', $maxpktpermss) } if ( $PSBoundParameters.ContainsKey('pktperretx') ) { $payload.Add('pktperretx', $pktperretx) } if ( $PSBoundParameters.ContainsKey('minrto') ) { $payload.Add('minrto', $minrto) } if ( $PSBoundParameters.ContainsKey('slowstartincr') ) { $payload.Add('slowstartincr', $slowstartincr) } if ( $PSBoundParameters.ContainsKey('buffersize') ) { $payload.Add('buffersize', $buffersize) } if ( $PSBoundParameters.ContainsKey('syncookie') ) { $payload.Add('syncookie', $syncookie) } if ( $PSBoundParameters.ContainsKey('kaprobeupdatelastactivity') ) { $payload.Add('kaprobeupdatelastactivity', $kaprobeupdatelastactivity) } if ( $PSBoundParameters.ContainsKey('flavor') ) { $payload.Add('flavor', $flavor) } if ( $PSBoundParameters.ContainsKey('dynamicreceivebuffering') ) { $payload.Add('dynamicreceivebuffering', $dynamicreceivebuffering) } if ( $PSBoundParameters.ContainsKey('ka') ) { $payload.Add('ka', $ka) } if ( $PSBoundParameters.ContainsKey('kamaxprobes') ) { $payload.Add('kamaxprobes', $kamaxprobes) } if ( $PSBoundParameters.ContainsKey('kaconnidletime') ) { $payload.Add('kaconnidletime', $kaconnidletime) } if ( $PSBoundParameters.ContainsKey('kaprobeinterval') ) { $payload.Add('kaprobeinterval', $kaprobeinterval) } if ( $PSBoundParameters.ContainsKey('sendbuffsize') ) { $payload.Add('sendbuffsize', $sendbuffsize) } if ( $PSBoundParameters.ContainsKey('mptcp') ) { $payload.Add('mptcp', $mptcp) } if ( $PSBoundParameters.ContainsKey('establishclientconn') ) { $payload.Add('establishclientconn', $establishclientconn) } if ( $PSBoundParameters.ContainsKey('tcpsegoffload') ) { $payload.Add('tcpsegoffload', $tcpsegoffload) } if ( $PSBoundParameters.ContainsKey('rfc5961compliance') ) { $payload.Add('rfc5961compliance', $rfc5961compliance) } if ( $PSBoundParameters.ContainsKey('rstwindowattenuate') ) { $payload.Add('rstwindowattenuate', $rstwindowattenuate) } if ( $PSBoundParameters.ContainsKey('rstmaxack') ) { $payload.Add('rstmaxack', $rstmaxack) } if ( $PSBoundParameters.ContainsKey('spoofsyndrop') ) { $payload.Add('spoofsyndrop', $spoofsyndrop) } if ( $PSBoundParameters.ContainsKey('ecn') ) { $payload.Add('ecn', $ecn) } if ( $PSBoundParameters.ContainsKey('mptcpdropdataonpreestsf') ) { $payload.Add('mptcpdropdataonpreestsf', $mptcpdropdataonpreestsf) } if ( $PSBoundParameters.ContainsKey('mptcpfastopen') ) { $payload.Add('mptcpfastopen', $mptcpfastopen) } if ( $PSBoundParameters.ContainsKey('mptcpsessiontimeout') ) { $payload.Add('mptcpsessiontimeout', $mptcpsessiontimeout) } if ( $PSBoundParameters.ContainsKey('timestamp') ) { $payload.Add('timestamp', $timestamp) } if ( $PSBoundParameters.ContainsKey('dsack') ) { $payload.Add('dsack', $dsack) } if ( $PSBoundParameters.ContainsKey('ackaggregation') ) { $payload.Add('ackaggregation', $ackaggregation) } if ( $PSBoundParameters.ContainsKey('frto') ) { $payload.Add('frto', $frto) } if ( $PSBoundParameters.ContainsKey('maxcwnd') ) { $payload.Add('maxcwnd', $maxcwnd) } if ( $PSBoundParameters.ContainsKey('fack') ) { $payload.Add('fack', $fack) } if ( $PSBoundParameters.ContainsKey('tcpmode') ) { $payload.Add('tcpmode', $tcpmode) } if ( $PSBoundParameters.ContainsKey('tcpfastopen') ) { $payload.Add('tcpfastopen', $tcpfastopen) } if ( $PSBoundParameters.ContainsKey('hystart') ) { $payload.Add('hystart', $hystart) } if ( $PSBoundParameters.ContainsKey('dupackthresh') ) { $payload.Add('dupackthresh', $dupackthresh) } if ( $PSBoundParameters.ContainsKey('burstratecontrol') ) { $payload.Add('burstratecontrol', $burstratecontrol) } if ( $PSBoundParameters.ContainsKey('tcprate') ) { $payload.Add('tcprate', $tcprate) } if ( $PSBoundParameters.ContainsKey('rateqmax') ) { $payload.Add('rateqmax', $rateqmax) } if ( $PSBoundParameters.ContainsKey('drophalfclosedconnontimeout') ) { $payload.Add('drophalfclosedconnontimeout', $drophalfclosedconnontimeout) } if ( $PSBoundParameters.ContainsKey('dropestconnontimeout') ) { $payload.Add('dropestconnontimeout', $dropestconnontimeout) } if ( $PSBoundParameters.ContainsKey('applyadaptivetcp') ) { $payload.Add('applyadaptivetcp', $applyadaptivetcp) } if ( $PSBoundParameters.ContainsKey('clientiptcpoption') ) { $payload.Add('clientiptcpoption', $clientiptcpoption) } if ( $PSBoundParameters.ContainsKey('mpcapablecbit') ) { $payload.Add('mpcapablecbit', $mpcapablecbit) } if ( $PSBoundParameters.ContainsKey('slowstartthreshold') ) { $payload.Add('slowstartthreshold', $slowstartthreshold) } if ( $PSBoundParameters.ContainsKey('tcpfastopencookiesize') ) { $payload.Add('tcpfastopencookiesize', $tcpfastopencookiesize) } if ( $PSBoundParameters.ContainsKey('taillossprobe') ) { $payload.Add('taillossprobe', $taillossprobe) } if ( $PSBoundParameters.ContainsKey('clientiptcpoptionnumber') ) { $payload.Add('clientiptcpoptionnumber', $clientiptcpoptionnumber) } if ( $PSBoundParameters.ContainsKey('sendclientportintcpoption') ) { $payload.Add('sendclientportintcpoption', $sendclientportintcpoption) } if ( $PSCmdlet.ShouldProcess("$name", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nstcpprofile -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNstcpprofile: Finished" } } function Invoke-NSGetNstcpprofile { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for TCP profile resource. .PARAMETER Name Name for a TCP profile. Must begin with a letter, number, or the underscore \(_\) character. Other characters allowed, after the first character, are the hyphen \(-\), period \(.\), hash \(\#\), space \( \), at \(@\), colon \(:\), and equal \(=\) characters. The name of a TCP profile cannot be changed after it is created. CLI Users: If the name includes one or more spaces, enclose the name in double or single quotation marks \(for example, "my tcp profile" or 'my tcp profile'\). .PARAMETER GetAll Retrieve all nstcpprofile object(s). .PARAMETER Count If specified, the count of the nstcpprofile object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNstcpprofile Get data. .EXAMPLE PS C:\>Invoke-NSGetNstcpprofile -GetAll Get all nstcpprofile data. .EXAMPLE PS C:\>Invoke-NSGetNstcpprofile -Count Get the number of nstcpprofile objects. .EXAMPLE PS C:\>Invoke-NSGetNstcpprofile -name <string> Get nstcpprofile object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNstcpprofile -Filter @{ 'name'='<value>' } Get nstcpprofile data with a filter. .NOTES File Name : Invoke-NSGetNstcpprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstcpprofile/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateLength(1, 127)] [string]$Name, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNstcpprofile: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nstcpprofile objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstcpprofile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nstcpprofile objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstcpprofile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nstcpprofile objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstcpprofile -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nstcpprofile configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstcpprofile -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nstcpprofile configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstcpprofile -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNstcpprofile: Ended" } } function Invoke-NSApplyNstestlicense { <# .SYNOPSIS Apply System/Global level configuration. config Object. .DESCRIPTION Configuration for testlicense resource. .EXAMPLE PS C:\>Invoke-NSApplyNstestlicense An example how to apply nstestlicense config Object(s). .NOTES File Name : Invoke-NSApplyNstestlicense Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstestlicense/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession) ) begin { Write-Verbose "Invoke-NSApplyNstestlicense: Starting" } process { try { $payload = @{ } if ( $PSCmdlet.ShouldProcess($Name, "Apply System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nstestlicense -Action apply -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSApplyNstestlicense: Finished" } } function Invoke-NSGetNstestlicense { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for testlicense resource. .PARAMETER GetAll Retrieve all nstestlicense object(s). .PARAMETER Count If specified, the count of the nstestlicense object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNstestlicense Get data. .EXAMPLE PS C:\>Invoke-NSGetNstestlicense -GetAll Get all nstestlicense data. .EXAMPLE PS C:\>Invoke-NSGetNstestlicense -name <string> Get nstestlicense object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNstestlicense -Filter @{ 'name'='<value>' } Get nstestlicense data with a filter. .NOTES File Name : Invoke-NSGetNstestlicense Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstestlicense/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNstestlicense: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nstestlicense objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstestlicense -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nstestlicense objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstestlicense -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nstestlicense objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstestlicense -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nstestlicense configuration for property ''" } else { Write-Verbose "Retrieving nstestlicense configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstestlicense -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNstestlicense: Ended" } } function Invoke-NSUpdateNstimeout { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for timeout resource. .PARAMETER Zombie Interval, in seconds, at which the Citrix ADC zombie cleanup process must run. This process cleans up inactive TCP connections. Maximum value = 600 .PARAMETER Client Client idle timeout (in seconds). If zero, the service-type default value is taken when service is created. Maximum value = 18000 .PARAMETER Server Server idle timeout (in seconds). If zero, the service-type default value is taken when service is created. Maximum value = 18000 .PARAMETER Httpclient Global idle timeout, in seconds, for client connections of HTTP service type. This value is over ridden by the client timeout that is configured on individual entities. Maximum value = 18000 .PARAMETER Httpserver Global idle timeout, in seconds, for server connections of HTTP service type. This value is over ridden by the server timeout that is configured on individual entities. Maximum value = 18000 .PARAMETER Tcpclient Global idle timeout, in seconds, for non-HTTP client connections of TCP service type. This value is over ridden by the client timeout that is configured on individual entities. Maximum value = 18000 .PARAMETER Tcpserver Global idle timeout, in seconds, for non-HTTP server connections of TCP service type. This value is over ridden by the server timeout that is configured on entities. Maximum value = 18000 .PARAMETER Anyclient Global idle timeout, in seconds, for non-TCP client connections. This value is over ridden by the client timeout that is configured on individual entities. Maximum value = 31536000 .PARAMETER Anyserver Global idle timeout, in seconds, for non TCP server connections. This value is over ridden by the server timeout that is configured on individual entities. Maximum value = 31536000 .PARAMETER Anytcpclient Global idle timeout, in seconds, for TCP client connections. This value takes precedence over entity level timeout settings (vserver/service). This is applicable only to transport protocol TCP. Maximum value = 31536000 .PARAMETER Anytcpserver Global idle timeout, in seconds, for TCP server connections. This value takes precedence over entity level timeout settings ( vserver/service). This is applicable only to transport protocol TCP. Maximum value = 31536000 .PARAMETER Halfclose Idle timeout, in seconds, for connections that are in TCP half-closed state. Maximum value = 600 .PARAMETER Nontcpzombie Interval at which the zombie clean-up process for non-TCP connections should run. Inactive IP NAT connections will be cleaned up. Maximum value = 600 .PARAMETER Reducedfintimeout Alternative idle timeout, in seconds, for closed TCP NATPCB connections. Maximum value = 300 .PARAMETER Reducedrsttimeout Timer interval, in seconds, for abruptly terminated TCP NATPCB connections. Maximum value = 300 .PARAMETER Newconnidletimeout Timer interval, in seconds, for new TCP NATPCB connections on which no data was received. Maximum value = 120 .EXAMPLE PS C:\>Invoke-NSUpdateNstimeout An example how to update nstimeout config Object(s). .NOTES File Name : Invoke-NSUpdateNstimeout Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstimeout/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [double]$Zombie, [double]$Client, [double]$Server, [double]$Httpclient, [double]$Httpserver, [double]$Tcpclient, [double]$Tcpserver, [double]$Anyclient, [double]$Anyserver, [double]$Anytcpclient, [double]$Anytcpserver, [double]$Halfclose, [double]$Nontcpzombie, [double]$Reducedfintimeout, [double]$Reducedrsttimeout, [double]$Newconnidletimeout ) begin { Write-Verbose "Invoke-NSUpdateNstimeout: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('zombie') ) { $payload.Add('zombie', $zombie) } if ( $PSBoundParameters.ContainsKey('client') ) { $payload.Add('client', $client) } if ( $PSBoundParameters.ContainsKey('server') ) { $payload.Add('server', $server) } if ( $PSBoundParameters.ContainsKey('httpclient') ) { $payload.Add('httpclient', $httpclient) } if ( $PSBoundParameters.ContainsKey('httpserver') ) { $payload.Add('httpserver', $httpserver) } if ( $PSBoundParameters.ContainsKey('tcpclient') ) { $payload.Add('tcpclient', $tcpclient) } if ( $PSBoundParameters.ContainsKey('tcpserver') ) { $payload.Add('tcpserver', $tcpserver) } if ( $PSBoundParameters.ContainsKey('anyclient') ) { $payload.Add('anyclient', $anyclient) } if ( $PSBoundParameters.ContainsKey('anyserver') ) { $payload.Add('anyserver', $anyserver) } if ( $PSBoundParameters.ContainsKey('anytcpclient') ) { $payload.Add('anytcpclient', $anytcpclient) } if ( $PSBoundParameters.ContainsKey('anytcpserver') ) { $payload.Add('anytcpserver', $anytcpserver) } if ( $PSBoundParameters.ContainsKey('halfclose') ) { $payload.Add('halfclose', $halfclose) } if ( $PSBoundParameters.ContainsKey('nontcpzombie') ) { $payload.Add('nontcpzombie', $nontcpzombie) } if ( $PSBoundParameters.ContainsKey('reducedfintimeout') ) { $payload.Add('reducedfintimeout', $reducedfintimeout) } if ( $PSBoundParameters.ContainsKey('reducedrsttimeout') ) { $payload.Add('reducedrsttimeout', $reducedrsttimeout) } if ( $PSBoundParameters.ContainsKey('newconnidletimeout') ) { $payload.Add('newconnidletimeout', $newconnidletimeout) } if ( $PSCmdlet.ShouldProcess("nstimeout", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nstimeout -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNstimeout: Finished" } } function Invoke-NSUnsetNstimeout { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for timeout resource. .PARAMETER Zombie Interval, in seconds, at which the Citrix ADC zombie cleanup process must run. This process cleans up inactive TCP connections. Maximum value = 600 .PARAMETER Client Client idle timeout (in seconds). If zero, the service-type default value is taken when service is created. Maximum value = 18000 .PARAMETER Server Server idle timeout (in seconds). If zero, the service-type default value is taken when service is created. Maximum value = 18000 .PARAMETER Httpclient Global idle timeout, in seconds, for client connections of HTTP service type. This value is over ridden by the client timeout that is configured on individual entities. Maximum value = 18000 .PARAMETER Httpserver Global idle timeout, in seconds, for server connections of HTTP service type. This value is over ridden by the server timeout that is configured on individual entities. Maximum value = 18000 .PARAMETER Tcpclient Global idle timeout, in seconds, for non-HTTP client connections of TCP service type. This value is over ridden by the client timeout that is configured on individual entities. Maximum value = 18000 .PARAMETER Tcpserver Global idle timeout, in seconds, for non-HTTP server connections of TCP service type. This value is over ridden by the server timeout that is configured on entities. Maximum value = 18000 .PARAMETER Anyclient Global idle timeout, in seconds, for non-TCP client connections. This value is over ridden by the client timeout that is configured on individual entities. Maximum value = 31536000 .PARAMETER Anyserver Global idle timeout, in seconds, for non TCP server connections. This value is over ridden by the server timeout that is configured on individual entities. Maximum value = 31536000 .PARAMETER Anytcpclient Global idle timeout, in seconds, for TCP client connections. This value takes precedence over entity level timeout settings (vserver/service). This is applicable only to transport protocol TCP. Maximum value = 31536000 .PARAMETER Anytcpserver Global idle timeout, in seconds, for TCP server connections. This value takes precedence over entity level timeout settings ( vserver/service). This is applicable only to transport protocol TCP. Maximum value = 31536000 .PARAMETER Halfclose Idle timeout, in seconds, for connections that are in TCP half-closed state. Maximum value = 600 .PARAMETER Nontcpzombie Interval at which the zombie clean-up process for non-TCP connections should run. Inactive IP NAT connections will be cleaned up. Maximum value = 600 .PARAMETER Reducedfintimeout Alternative idle timeout, in seconds, for closed TCP NATPCB connections. Maximum value = 300 .PARAMETER Reducedrsttimeout Timer interval, in seconds, for abruptly terminated TCP NATPCB connections. Maximum value = 300 .PARAMETER Newconnidletimeout Timer interval, in seconds, for new TCP NATPCB connections on which no data was received. Maximum value = 120 .EXAMPLE PS C:\>Invoke-NSUnsetNstimeout An example how to unset nstimeout config Object(s). .NOTES File Name : Invoke-NSUnsetNstimeout Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstimeout Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Boolean]$zombie, [Boolean]$client, [Boolean]$server, [Boolean]$httpclient, [Boolean]$httpserver, [Boolean]$tcpclient, [Boolean]$tcpserver, [Boolean]$anyclient, [Boolean]$anyserver, [Boolean]$anytcpclient, [Boolean]$anytcpserver, [Boolean]$halfclose, [Boolean]$nontcpzombie, [Boolean]$reducedfintimeout, [Boolean]$reducedrsttimeout, [Boolean]$newconnidletimeout ) begin { Write-Verbose "Invoke-NSUnsetNstimeout: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('zombie') ) { $payload.Add('zombie', $zombie) } if ( $PSBoundParameters.ContainsKey('client') ) { $payload.Add('client', $client) } if ( $PSBoundParameters.ContainsKey('server') ) { $payload.Add('server', $server) } if ( $PSBoundParameters.ContainsKey('httpclient') ) { $payload.Add('httpclient', $httpclient) } if ( $PSBoundParameters.ContainsKey('httpserver') ) { $payload.Add('httpserver', $httpserver) } if ( $PSBoundParameters.ContainsKey('tcpclient') ) { $payload.Add('tcpclient', $tcpclient) } if ( $PSBoundParameters.ContainsKey('tcpserver') ) { $payload.Add('tcpserver', $tcpserver) } if ( $PSBoundParameters.ContainsKey('anyclient') ) { $payload.Add('anyclient', $anyclient) } if ( $PSBoundParameters.ContainsKey('anyserver') ) { $payload.Add('anyserver', $anyserver) } if ( $PSBoundParameters.ContainsKey('anytcpclient') ) { $payload.Add('anytcpclient', $anytcpclient) } if ( $PSBoundParameters.ContainsKey('anytcpserver') ) { $payload.Add('anytcpserver', $anytcpserver) } if ( $PSBoundParameters.ContainsKey('halfclose') ) { $payload.Add('halfclose', $halfclose) } if ( $PSBoundParameters.ContainsKey('nontcpzombie') ) { $payload.Add('nontcpzombie', $nontcpzombie) } if ( $PSBoundParameters.ContainsKey('reducedfintimeout') ) { $payload.Add('reducedfintimeout', $reducedfintimeout) } if ( $PSBoundParameters.ContainsKey('reducedrsttimeout') ) { $payload.Add('reducedrsttimeout', $reducedrsttimeout) } if ( $PSBoundParameters.ContainsKey('newconnidletimeout') ) { $payload.Add('newconnidletimeout', $newconnidletimeout) } if ( $PSCmdlet.ShouldProcess("nstimeout", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nstimeout -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNstimeout: Finished" } } function Invoke-NSGetNstimeout { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for timeout resource. .PARAMETER GetAll Retrieve all nstimeout object(s). .PARAMETER Count If specified, the count of the nstimeout object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNstimeout Get data. .EXAMPLE PS C:\>Invoke-NSGetNstimeout -GetAll Get all nstimeout data. .EXAMPLE PS C:\>Invoke-NSGetNstimeout -name <string> Get nstimeout object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNstimeout -Filter @{ 'name'='<value>' } Get nstimeout data with a filter. .NOTES File Name : Invoke-NSGetNstimeout Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstimeout/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNstimeout: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nstimeout objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstimeout -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nstimeout objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstimeout -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nstimeout objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstimeout -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nstimeout configuration for property ''" } else { Write-Verbose "Retrieving nstimeout configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstimeout -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNstimeout: Ended" } } function Invoke-NSAddNstimer { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Configuration for Timer resource. .PARAMETER Name Timer name. .PARAMETER Interval The frequency at which the policies bound to this timer are invoked. The minimum value is 20 msec. The maximum value is 20940 in seconds and 349 in minutes. Maximum value = 20940000 .PARAMETER Unit Timer interval unit. Possible values = SEC, MIN .PARAMETER Comment Comments associated with this timer. .PARAMETER PassThru Return details about the created nstimer item. .EXAMPLE PS C:\>Invoke-NSAddNstimer -name <string> -interval <int> An example how to add nstimer config Object(s). .NOTES File Name : Invoke-NSAddNstimer Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstimer/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [Parameter(Mandatory)] [int]$Interval = '5', [ValidateSet('SEC', 'MIN')] [string]$Unit = 'SEC', [string]$Comment, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNstimer: Starting" } process { try { $payload = @{ name = $name interval = $interval } if ( $PSBoundParameters.ContainsKey('unit') ) { $payload.Add('unit', $unit) } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSCmdlet.ShouldProcess("nstimer", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nstimer -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNstimer -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNstimer: Finished" } } function Invoke-NSDeleteNstimer { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Configuration for Timer resource. .PARAMETER Name Timer name. .EXAMPLE PS C:\>Invoke-NSDeleteNstimer -Name <string> An example how to delete nstimer config Object(s). .NOTES File Name : Invoke-NSDeleteNstimer Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstimer/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Name ) begin { Write-Verbose "Invoke-NSDeleteNstimer: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nstimer -NitroPath nitro/v1/config -Resource $name -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNstimer: Finished" } } function Invoke-NSUpdateNstimer { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for Timer resource. .PARAMETER Name Timer name. .PARAMETER Interval The frequency at which the policies bound to this timer are invoked. The minimum value is 20 msec. The maximum value is 20940 in seconds and 349 in minutes. Maximum value = 20940000 .PARAMETER Unit Timer interval unit. Possible values = SEC, MIN .PARAMETER Comment Comments associated with this timer. .PARAMETER PassThru Return details about the created nstimer item. .EXAMPLE PS C:\>Invoke-NSUpdateNstimer -name <string> An example how to update nstimer config Object(s). .NOTES File Name : Invoke-NSUpdateNstimer Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstimer/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [int]$Interval, [ValidateSet('SEC', 'MIN')] [string]$Unit, [string]$Comment, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateNstimer: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('interval') ) { $payload.Add('interval', $interval) } if ( $PSBoundParameters.ContainsKey('unit') ) { $payload.Add('unit', $unit) } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSCmdlet.ShouldProcess("nstimer", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nstimer -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNstimer -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNstimer: Finished" } } function Invoke-NSUnsetNstimer { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for Timer resource. .PARAMETER Name Timer name. .PARAMETER Interval The frequency at which the policies bound to this timer are invoked. The minimum value is 20 msec. The maximum value is 20940 in seconds and 349 in minutes. Maximum value = 20940000 .PARAMETER Unit Timer interval unit. Possible values = SEC, MIN .PARAMETER Comment Comments associated with this timer. .EXAMPLE PS C:\>Invoke-NSUnsetNstimer -name <string> An example how to unset nstimer config Object(s). .NOTES File Name : Invoke-NSUnsetNstimer Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstimer Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [Boolean]$interval, [Boolean]$unit, [Boolean]$comment ) begin { Write-Verbose "Invoke-NSUnsetNstimer: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('interval') ) { $payload.Add('interval', $interval) } if ( $PSBoundParameters.ContainsKey('unit') ) { $payload.Add('unit', $unit) } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSCmdlet.ShouldProcess("$name", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nstimer -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNstimer: Finished" } } function Invoke-NSRenameNstimer { <# .SYNOPSIS Rename System/Global level configuration. config Object. .DESCRIPTION Configuration for Timer resource. .PARAMETER Name Timer name. .PARAMETER Newname The new name of the timer. .PARAMETER PassThru Return details about the created nstimer item. .EXAMPLE PS C:\>Invoke-NSRenameNstimer -name <string> -newname <string> An example how to rename nstimer config Object(s). .NOTES File Name : Invoke-NSRenameNstimer Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstimer/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Newname, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSRenameNstimer: Starting" } process { try { $payload = @{ name = $name newname = $newname } if ( $PSCmdlet.ShouldProcess("nstimer", "Rename System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nstimer -Action rename -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNstimer -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSRenameNstimer: Finished" } } function Invoke-NSGetNstimer { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for Timer resource. .PARAMETER Name Timer name. .PARAMETER GetAll Retrieve all nstimer object(s). .PARAMETER Count If specified, the count of the nstimer object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNstimer Get data. .EXAMPLE PS C:\>Invoke-NSGetNstimer -GetAll Get all nstimer data. .EXAMPLE PS C:\>Invoke-NSGetNstimer -Count Get the number of nstimer objects. .EXAMPLE PS C:\>Invoke-NSGetNstimer -name <string> Get nstimer object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNstimer -Filter @{ 'name'='<value>' } Get nstimer data with a filter. .NOTES File Name : Invoke-NSGetNstimer Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstimer/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNstimer: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nstimer objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstimer -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nstimer objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstimer -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nstimer objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstimer -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nstimer configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstimer -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nstimer configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstimer -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNstimer: Ended" } } function Invoke-NSAddNstimerAutoscalepolicyBinding { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Binding object showing the autoscalepolicy that can be bound to nstimer. .PARAMETER Name Timer name. .PARAMETER Policyname The timer policy associated with the timer. .PARAMETER Priority Specifies the priority of the timer policy. .PARAMETER Gotopriorityexpression Expression specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE. .PARAMETER Vserver Name of the vserver which provides the context for the rule in timer policy. When not specified it is treated as a Global Default context. .PARAMETER Samplesize Denotes the sample size. Sample size value of 'x' means that previous '(x - 1)' policy's rule evaluation results and the current evaluation result are present with the binding. For example, sample size of 10 means that there is a state of previous 9 policy evaluation results and also the current policy evaluation result. Maximum value = 32 .PARAMETER Threshold Denotes the threshold. If the rule of the policy in the binding relation evaluates 'threshold size' number of times in 'sample size' to true, then the corresponding action is taken. Its value needs to be less than or equal to the sample size value. Maximum value = 32 .PARAMETER PassThru Return details about the created nstimer_autoscalepolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddNstimerAutoscalepolicyBinding -name <string> -policyname <string> -priority <double> An example how to add nstimer_autoscalepolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddNstimerAutoscalepolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstimer_autoscalepolicy_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [Parameter(Mandatory)] [string]$Policyname, [Parameter(Mandatory)] [double]$Priority, [string]$Gotopriorityexpression, [string]$Vserver, [double]$Samplesize = '3', [double]$Threshold = '3', [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNstimerAutoscalepolicyBinding: Starting" } process { try { $payload = @{ name = $name policyname = $policyname priority = $priority } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('vserver') ) { $payload.Add('vserver', $vserver) } if ( $PSBoundParameters.ContainsKey('samplesize') ) { $payload.Add('samplesize', $samplesize) } if ( $PSBoundParameters.ContainsKey('threshold') ) { $payload.Add('threshold', $threshold) } if ( $PSCmdlet.ShouldProcess("nstimer_autoscalepolicy_binding", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nstimer_autoscalepolicy_binding -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNstimerAutoscalepolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNstimerAutoscalepolicyBinding: Finished" } } function Invoke-NSDeleteNstimerAutoscalepolicyBinding { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Binding object showing the autoscalepolicy that can be bound to nstimer. .PARAMETER Name Timer name. .PARAMETER Policyname The timer policy associated with the timer. .EXAMPLE PS C:\>Invoke-NSDeleteNstimerAutoscalepolicyBinding -Name <string> An example how to delete nstimer_autoscalepolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteNstimerAutoscalepolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstimer_autoscalepolicy_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Name, [string]$Policyname ) begin { Write-Verbose "Invoke-NSDeleteNstimerAutoscalepolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policyname') ) { $arguments.Add('policyname', $Policyname) } if ( $PSCmdlet.ShouldProcess("$name", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nstimer_autoscalepolicy_binding -NitroPath nitro/v1/config -Resource $name -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNstimerAutoscalepolicyBinding: Finished" } } function Invoke-NSGetNstimerAutoscalepolicyBinding { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Binding object showing the autoscalepolicy that can be bound to nstimer. .PARAMETER Name Timer name. .PARAMETER GetAll Retrieve all nstimer_autoscalepolicy_binding object(s). .PARAMETER Count If specified, the count of the nstimer_autoscalepolicy_binding object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNstimerAutoscalepolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetNstimerAutoscalepolicyBinding -GetAll Get all nstimer_autoscalepolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetNstimerAutoscalepolicyBinding -Count Get the number of nstimer_autoscalepolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetNstimerAutoscalepolicyBinding -name <string> Get nstimer_autoscalepolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNstimerAutoscalepolicyBinding -Filter @{ 'name'='<value>' } Get nstimer_autoscalepolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetNstimerAutoscalepolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstimer_autoscalepolicy_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNstimerAutoscalepolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all nstimer_autoscalepolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstimer_autoscalepolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nstimer_autoscalepolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstimer_autoscalepolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nstimer_autoscalepolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstimer_autoscalepolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nstimer_autoscalepolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstimer_autoscalepolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nstimer_autoscalepolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstimer_autoscalepolicy_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNstimerAutoscalepolicyBinding: Ended" } } function Invoke-NSGetNstimerBinding { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Binding object which returns the resources bound to nstimer. .PARAMETER Name Timer name. .PARAMETER GetAll Retrieve all nstimer_binding object(s). .PARAMETER Count If specified, the count of the nstimer_binding object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNstimerBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetNstimerBinding -GetAll Get all nstimer_binding data. .EXAMPLE PS C:\>Invoke-NSGetNstimerBinding -name <string> Get nstimer_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNstimerBinding -Filter @{ 'name'='<value>' } Get nstimer_binding data with a filter. .NOTES File Name : Invoke-NSGetNstimerBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstimer_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNstimerBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all nstimer_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstimer_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nstimer_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstimer_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nstimer_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstimer_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nstimer_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstimer_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nstimer_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstimer_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNstimerBinding: Ended" } } function Invoke-NSGetNstimezone { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for 0 resource. .PARAMETER Value . .PARAMETER GetAll Retrieve all nstimezone object(s). .PARAMETER Count If specified, the count of the nstimezone object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNstimezone Get data. .EXAMPLE PS C:\>Invoke-NSGetNstimezone -GetAll Get all nstimezone data. .EXAMPLE PS C:\>Invoke-NSGetNstimezone -Count Get the number of nstimezone objects. .EXAMPLE PS C:\>Invoke-NSGetNstimezone -name <string> Get nstimezone object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNstimezone -Filter @{ 'name'='<value>' } Get nstimezone data with a filter. .NOTES File Name : Invoke-NSGetNstimezone Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstimezone/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [string]$Value, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNstimezone: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nstimezone objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstimezone -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nstimezone objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstimezone -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nstimezone objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstimezone -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nstimezone configuration for property 'value'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstimezone -NitroPath nitro/v1/config -Resource $value -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nstimezone configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstimezone -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNstimezone: Ended" } } function Invoke-NSAddNstrafficdomain { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Configuration for Traffic Domain resource. .PARAMETER Td Integer value that uniquely identifies a traffic domain. Maximum value = 4094 .PARAMETER Aliasname Name of traffic domain being added. .PARAMETER Vmac Associate the traffic domain with a VMAC address instead of with VLANs. The Citrix ADC then sends the VMAC address of the traffic domain in all responses to ARP queries for network entities in that domain. As a result, the ADC can segregate subsequent incoming traffic for this traffic domain on the basis of the destination MAC address, because the destination MAC address is the VMAC address of the traffic domain. After creating entities on a traffic domain, you can easily manage and monitor them by performing traffic domain level operations. Possible values = ENABLED, DISABLED .PARAMETER PassThru Return details about the created nstrafficdomain item. .EXAMPLE PS C:\>Invoke-NSAddNstrafficdomain -td <double> An example how to add nstrafficdomain config Object(s). .NOTES File Name : Invoke-NSAddNstrafficdomain Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstrafficdomain/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [double]$Td, [ValidateLength(1, 31)] [string]$Aliasname, [ValidateSet('ENABLED', 'DISABLED')] [string]$Vmac = 'DISABLED', [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNstrafficdomain: Starting" } process { try { $payload = @{ td = $td } if ( $PSBoundParameters.ContainsKey('aliasname') ) { $payload.Add('aliasname', $aliasname) } if ( $PSBoundParameters.ContainsKey('vmac') ) { $payload.Add('vmac', $vmac) } if ( $PSCmdlet.ShouldProcess("nstrafficdomain", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nstrafficdomain -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNstrafficdomain -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNstrafficdomain: Finished" } } function Invoke-NSDeleteNstrafficdomain { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Configuration for Traffic Domain resource. .PARAMETER Td Integer value that uniquely identifies a traffic domain. Maximum value = 4094 .EXAMPLE PS C:\>Invoke-NSDeleteNstrafficdomain -Td <double> An example how to delete nstrafficdomain config Object(s). .NOTES File Name : Invoke-NSDeleteNstrafficdomain Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstrafficdomain/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [double]$Td ) begin { Write-Verbose "Invoke-NSDeleteNstrafficdomain: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$td", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nstrafficdomain -NitroPath nitro/v1/config -Resource $td -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNstrafficdomain: Finished" } } function Invoke-NSClearNstrafficdomain { <# .SYNOPSIS Clear System/Global level configuration. config Object. .DESCRIPTION Configuration for Traffic Domain resource. .PARAMETER Td Integer value that uniquely identifies a traffic domain. Maximum value = 4094 .EXAMPLE PS C:\>Invoke-NSClearNstrafficdomain -td <double> An example how to clear nstrafficdomain config Object(s). .NOTES File Name : Invoke-NSClearNstrafficdomain Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstrafficdomain/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [double]$Td ) begin { Write-Verbose "Invoke-NSClearNstrafficdomain: Starting" } process { try { $payload = @{ td = $td } if ( $PSCmdlet.ShouldProcess($Name, "Clear System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nstrafficdomain -Action clear -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSClearNstrafficdomain: Finished" } } function Invoke-NSEnableNstrafficdomain { <# .SYNOPSIS Enable System/Global level configuration. config Object. .DESCRIPTION Configuration for Traffic Domain resource. .PARAMETER Td Integer value that uniquely identifies a traffic domain. Maximum value = 4094 .EXAMPLE PS C:\>Invoke-NSEnableNstrafficdomain -td <double> An example how to enable nstrafficdomain config Object(s). .NOTES File Name : Invoke-NSEnableNstrafficdomain Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstrafficdomain/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [double]$Td ) begin { Write-Verbose "Invoke-NSEnableNstrafficdomain: Starting" } process { try { $payload = @{ td = $td } if ( $PSCmdlet.ShouldProcess($Name, "Enable System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nstrafficdomain -Action enable -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSEnableNstrafficdomain: Finished" } } function Invoke-NSDisableNstrafficdomain { <# .SYNOPSIS Disable System/Global level configuration. config Object. .DESCRIPTION Configuration for Traffic Domain resource. .PARAMETER Td Integer value that uniquely identifies a traffic domain. Maximum value = 4094 .EXAMPLE PS C:\>Invoke-NSDisableNstrafficdomain -td <double> An example how to disable nstrafficdomain config Object(s). .NOTES File Name : Invoke-NSDisableNstrafficdomain Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstrafficdomain/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [double]$Td ) begin { Write-Verbose "Invoke-NSDisableNstrafficdomain: Starting" } process { try { $payload = @{ td = $td } if ( $PSCmdlet.ShouldProcess($Name, "Disable System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nstrafficdomain -Action disable -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDisableNstrafficdomain: Finished" } } function Invoke-NSGetNstrafficdomain { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for Traffic Domain resource. .PARAMETER Td Integer value that uniquely identifies a traffic domain. Maximum value = 4094 .PARAMETER GetAll Retrieve all nstrafficdomain object(s). .PARAMETER Count If specified, the count of the nstrafficdomain object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNstrafficdomain Get data. .EXAMPLE PS C:\>Invoke-NSGetNstrafficdomain -GetAll Get all nstrafficdomain data. .EXAMPLE PS C:\>Invoke-NSGetNstrafficdomain -Count Get the number of nstrafficdomain objects. .EXAMPLE PS C:\>Invoke-NSGetNstrafficdomain -name <string> Get nstrafficdomain object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNstrafficdomain -Filter @{ 'name'='<value>' } Get nstrafficdomain data with a filter. .NOTES File Name : Invoke-NSGetNstrafficdomain Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstrafficdomain/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [double]$Td, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNstrafficdomain: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nstrafficdomain objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstrafficdomain -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nstrafficdomain objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstrafficdomain -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nstrafficdomain objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstrafficdomain -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nstrafficdomain configuration for property 'td'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstrafficdomain -NitroPath nitro/v1/config -Resource $td -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nstrafficdomain configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstrafficdomain -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNstrafficdomain: Ended" } } function Invoke-NSGetNstrafficdomainBinding { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Binding object which returns the resources bound to nstrafficdomain. .PARAMETER Td Integer value that uniquely identifies a traffic domain. Maximum value = 4094 .PARAMETER GetAll Retrieve all nstrafficdomain_binding object(s). .PARAMETER Count If specified, the count of the nstrafficdomain_binding object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNstrafficdomainBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetNstrafficdomainBinding -GetAll Get all nstrafficdomain_binding data. .EXAMPLE PS C:\>Invoke-NSGetNstrafficdomainBinding -name <string> Get nstrafficdomain_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNstrafficdomainBinding -Filter @{ 'name'='<value>' } Get nstrafficdomain_binding data with a filter. .NOTES File Name : Invoke-NSGetNstrafficdomainBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstrafficdomain_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [double]$Td, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNstrafficdomainBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all nstrafficdomain_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstrafficdomain_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nstrafficdomain_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstrafficdomain_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nstrafficdomain_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstrafficdomain_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nstrafficdomain_binding configuration for property 'td'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstrafficdomain_binding -NitroPath nitro/v1/config -Resource $td -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nstrafficdomain_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstrafficdomain_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNstrafficdomainBinding: Ended" } } function Invoke-NSAddNstrafficdomainBridgegroupBinding { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Binding object showing the bridgegroup that can be bound to nstrafficdomain. .PARAMETER Td Integer value that uniquely identifies a traffic domain. Maximum value = 4094 .PARAMETER Bridgegroup ID of the configured bridge to bind to this traffic domain. More than one bridge group can be bound to a traffic domain, but the same bridge group cannot be a part of multiple traffic domains. Maximum value = 1000 .PARAMETER PassThru Return details about the created nstrafficdomain_bridgegroup_binding item. .EXAMPLE PS C:\>Invoke-NSAddNstrafficdomainBridgegroupBinding -td <double> An example how to add nstrafficdomain_bridgegroup_binding config Object(s). .NOTES File Name : Invoke-NSAddNstrafficdomainBridgegroupBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstrafficdomain_bridgegroup_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [double]$Td, [double]$Bridgegroup, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNstrafficdomainBridgegroupBinding: Starting" } process { try { $payload = @{ td = $td } if ( $PSBoundParameters.ContainsKey('bridgegroup') ) { $payload.Add('bridgegroup', $bridgegroup) } if ( $PSCmdlet.ShouldProcess("nstrafficdomain_bridgegroup_binding", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nstrafficdomain_bridgegroup_binding -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNstrafficdomainBridgegroupBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNstrafficdomainBridgegroupBinding: Finished" } } function Invoke-NSDeleteNstrafficdomainBridgegroupBinding { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Binding object showing the bridgegroup that can be bound to nstrafficdomain. .PARAMETER Td Integer value that uniquely identifies a traffic domain. Maximum value = 4094 .PARAMETER Bridgegroup ID of the configured bridge to bind to this traffic domain. More than one bridge group can be bound to a traffic domain, but the same bridge group cannot be a part of multiple traffic domains. Maximum value = 1000 .EXAMPLE PS C:\>Invoke-NSDeleteNstrafficdomainBridgegroupBinding -Td <double> An example how to delete nstrafficdomain_bridgegroup_binding config Object(s). .NOTES File Name : Invoke-NSDeleteNstrafficdomainBridgegroupBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstrafficdomain_bridgegroup_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [double]$Td, [double]$Bridgegroup ) begin { Write-Verbose "Invoke-NSDeleteNstrafficdomainBridgegroupBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Bridgegroup') ) { $arguments.Add('bridgegroup', $Bridgegroup) } if ( $PSCmdlet.ShouldProcess("$td", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nstrafficdomain_bridgegroup_binding -NitroPath nitro/v1/config -Resource $td -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNstrafficdomainBridgegroupBinding: Finished" } } function Invoke-NSGetNstrafficdomainBridgegroupBinding { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Binding object showing the bridgegroup that can be bound to nstrafficdomain. .PARAMETER Td Integer value that uniquely identifies a traffic domain. Maximum value = 4094 .PARAMETER GetAll Retrieve all nstrafficdomain_bridgegroup_binding object(s). .PARAMETER Count If specified, the count of the nstrafficdomain_bridgegroup_binding object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNstrafficdomainBridgegroupBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetNstrafficdomainBridgegroupBinding -GetAll Get all nstrafficdomain_bridgegroup_binding data. .EXAMPLE PS C:\>Invoke-NSGetNstrafficdomainBridgegroupBinding -Count Get the number of nstrafficdomain_bridgegroup_binding objects. .EXAMPLE PS C:\>Invoke-NSGetNstrafficdomainBridgegroupBinding -name <string> Get nstrafficdomain_bridgegroup_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNstrafficdomainBridgegroupBinding -Filter @{ 'name'='<value>' } Get nstrafficdomain_bridgegroup_binding data with a filter. .NOTES File Name : Invoke-NSGetNstrafficdomainBridgegroupBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstrafficdomain_bridgegroup_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [double]$Td, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNstrafficdomainBridgegroupBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all nstrafficdomain_bridgegroup_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstrafficdomain_bridgegroup_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nstrafficdomain_bridgegroup_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstrafficdomain_bridgegroup_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nstrafficdomain_bridgegroup_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstrafficdomain_bridgegroup_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nstrafficdomain_bridgegroup_binding configuration for property 'td'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstrafficdomain_bridgegroup_binding -NitroPath nitro/v1/config -Resource $td -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nstrafficdomain_bridgegroup_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstrafficdomain_bridgegroup_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNstrafficdomainBridgegroupBinding: Ended" } } function Invoke-NSAddNstrafficdomainVlanBinding { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Binding object showing the vlan that can be bound to nstrafficdomain. .PARAMETER Td Integer value that uniquely identifies a traffic domain. Maximum value = 4094 .PARAMETER Vlan ID of the VLAN to bind to this traffic domain. More than one VLAN can be bound to a traffic domain, but the same VLAN cannot be a part of multiple traffic domains. Maximum value = 4094 .PARAMETER PassThru Return details about the created nstrafficdomain_vlan_binding item. .EXAMPLE PS C:\>Invoke-NSAddNstrafficdomainVlanBinding -td <double> An example how to add nstrafficdomain_vlan_binding config Object(s). .NOTES File Name : Invoke-NSAddNstrafficdomainVlanBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstrafficdomain_vlan_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [double]$Td, [double]$Vlan, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNstrafficdomainVlanBinding: Starting" } process { try { $payload = @{ td = $td } if ( $PSBoundParameters.ContainsKey('vlan') ) { $payload.Add('vlan', $vlan) } if ( $PSCmdlet.ShouldProcess("nstrafficdomain_vlan_binding", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nstrafficdomain_vlan_binding -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNstrafficdomainVlanBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNstrafficdomainVlanBinding: Finished" } } function Invoke-NSDeleteNstrafficdomainVlanBinding { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Binding object showing the vlan that can be bound to nstrafficdomain. .PARAMETER Td Integer value that uniquely identifies a traffic domain. Maximum value = 4094 .PARAMETER Vlan ID of the VLAN to bind to this traffic domain. More than one VLAN can be bound to a traffic domain, but the same VLAN cannot be a part of multiple traffic domains. Maximum value = 4094 .EXAMPLE PS C:\>Invoke-NSDeleteNstrafficdomainVlanBinding -Td <double> An example how to delete nstrafficdomain_vlan_binding config Object(s). .NOTES File Name : Invoke-NSDeleteNstrafficdomainVlanBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstrafficdomain_vlan_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [double]$Td, [double]$Vlan ) begin { Write-Verbose "Invoke-NSDeleteNstrafficdomainVlanBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Vlan') ) { $arguments.Add('vlan', $Vlan) } if ( $PSCmdlet.ShouldProcess("$td", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nstrafficdomain_vlan_binding -NitroPath nitro/v1/config -Resource $td -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNstrafficdomainVlanBinding: Finished" } } function Invoke-NSGetNstrafficdomainVlanBinding { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Binding object showing the vlan that can be bound to nstrafficdomain. .PARAMETER Td Integer value that uniquely identifies a traffic domain. Maximum value = 4094 .PARAMETER GetAll Retrieve all nstrafficdomain_vlan_binding object(s). .PARAMETER Count If specified, the count of the nstrafficdomain_vlan_binding object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNstrafficdomainVlanBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetNstrafficdomainVlanBinding -GetAll Get all nstrafficdomain_vlan_binding data. .EXAMPLE PS C:\>Invoke-NSGetNstrafficdomainVlanBinding -Count Get the number of nstrafficdomain_vlan_binding objects. .EXAMPLE PS C:\>Invoke-NSGetNstrafficdomainVlanBinding -name <string> Get nstrafficdomain_vlan_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNstrafficdomainVlanBinding -Filter @{ 'name'='<value>' } Get nstrafficdomain_vlan_binding data with a filter. .NOTES File Name : Invoke-NSGetNstrafficdomainVlanBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstrafficdomain_vlan_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [double]$Td, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNstrafficdomainVlanBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all nstrafficdomain_vlan_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstrafficdomain_vlan_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nstrafficdomain_vlan_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstrafficdomain_vlan_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nstrafficdomain_vlan_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstrafficdomain_vlan_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nstrafficdomain_vlan_binding configuration for property 'td'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstrafficdomain_vlan_binding -NitroPath nitro/v1/config -Resource $td -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nstrafficdomain_vlan_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstrafficdomain_vlan_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNstrafficdomainVlanBinding: Ended" } } function Invoke-NSAddNstrafficdomainVxlanBinding { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Binding object showing the vxlan that can be bound to nstrafficdomain. .PARAMETER Td Integer value that uniquely identifies a traffic domain. Maximum value = 4094 .PARAMETER Vxlan ID of the VXLAN to bind to this traffic domain. More than one VXLAN can be bound to a traffic domain, but the same VXLAN cannot be a part of multiple traffic domains. Maximum value = 16777215 .PARAMETER PassThru Return details about the created nstrafficdomain_vxlan_binding item. .EXAMPLE PS C:\>Invoke-NSAddNstrafficdomainVxlanBinding -td <double> An example how to add nstrafficdomain_vxlan_binding config Object(s). .NOTES File Name : Invoke-NSAddNstrafficdomainVxlanBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstrafficdomain_vxlan_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [double]$Td, [double]$Vxlan, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNstrafficdomainVxlanBinding: Starting" } process { try { $payload = @{ td = $td } if ( $PSBoundParameters.ContainsKey('vxlan') ) { $payload.Add('vxlan', $vxlan) } if ( $PSCmdlet.ShouldProcess("nstrafficdomain_vxlan_binding", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nstrafficdomain_vxlan_binding -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNstrafficdomainVxlanBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNstrafficdomainVxlanBinding: Finished" } } function Invoke-NSDeleteNstrafficdomainVxlanBinding { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Binding object showing the vxlan that can be bound to nstrafficdomain. .PARAMETER Td Integer value that uniquely identifies a traffic domain. Maximum value = 4094 .PARAMETER Vxlan ID of the VXLAN to bind to this traffic domain. More than one VXLAN can be bound to a traffic domain, but the same VXLAN cannot be a part of multiple traffic domains. Maximum value = 16777215 .EXAMPLE PS C:\>Invoke-NSDeleteNstrafficdomainVxlanBinding -Td <double> An example how to delete nstrafficdomain_vxlan_binding config Object(s). .NOTES File Name : Invoke-NSDeleteNstrafficdomainVxlanBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstrafficdomain_vxlan_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [double]$Td, [double]$Vxlan ) begin { Write-Verbose "Invoke-NSDeleteNstrafficdomainVxlanBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Vxlan') ) { $arguments.Add('vxlan', $Vxlan) } if ( $PSCmdlet.ShouldProcess("$td", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nstrafficdomain_vxlan_binding -NitroPath nitro/v1/config -Resource $td -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNstrafficdomainVxlanBinding: Finished" } } function Invoke-NSGetNstrafficdomainVxlanBinding { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Binding object showing the vxlan that can be bound to nstrafficdomain. .PARAMETER Td Integer value that uniquely identifies a traffic domain. Maximum value = 4094 .PARAMETER GetAll Retrieve all nstrafficdomain_vxlan_binding object(s). .PARAMETER Count If specified, the count of the nstrafficdomain_vxlan_binding object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNstrafficdomainVxlanBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetNstrafficdomainVxlanBinding -GetAll Get all nstrafficdomain_vxlan_binding data. .EXAMPLE PS C:\>Invoke-NSGetNstrafficdomainVxlanBinding -Count Get the number of nstrafficdomain_vxlan_binding objects. .EXAMPLE PS C:\>Invoke-NSGetNstrafficdomainVxlanBinding -name <string> Get nstrafficdomain_vxlan_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNstrafficdomainVxlanBinding -Filter @{ 'name'='<value>' } Get nstrafficdomain_vxlan_binding data with a filter. .NOTES File Name : Invoke-NSGetNstrafficdomainVxlanBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nstrafficdomain_vxlan_binding/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [double]$Td, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNstrafficdomainVxlanBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all nstrafficdomain_vxlan_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstrafficdomain_vxlan_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nstrafficdomain_vxlan_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstrafficdomain_vxlan_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nstrafficdomain_vxlan_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstrafficdomain_vxlan_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nstrafficdomain_vxlan_binding configuration for property 'td'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstrafficdomain_vxlan_binding -NitroPath nitro/v1/config -Resource $td -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nstrafficdomain_vxlan_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nstrafficdomain_vxlan_binding -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNstrafficdomainVxlanBinding: Ended" } } function Invoke-NSAddNsvariable { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Configuration for variable resource. .PARAMETER Name Variable name. This follows the same syntax rules as other expression entity names: It must begin with an alpha character (A-Z or a-z) or an underscore (_). The rest of the characters must be alpha, numeric (0-9) or underscores. It cannot be re or xp (reserved for regular and XPath expressions). It cannot be an expression reserved word (e.g. SYS or HTTP). It cannot be used for an existing expression object (HTTP callout, patset, dataset, stringmap, or named expression). .PARAMETER Type Specification of the variable type; one of the following: ulong - singleton variable with an unsigned 64-bit value. text(value-max-size) - singleton variable with a text string value. map(text(key-max-size),ulong,max-entries) - map of text string keys to unsigned 64-bit values. map(text(key-max-size),text(value-max-size),max-entries) - map of text string keys to text string values. where value-max-size is a positive integer that is the maximum number of bytes in a text string value. key-max-size is a positive integer that is the maximum number of bytes in a text string key. max-entries is a positive integer that is the maximum number of entries in a map variable. For a global singleton text variable, value-max-size <= 64000. For a global map with ulong values, key-max-size <= 64000. For a global map with text values, key-max-size + value-max-size <= 64000. max-entries is a positive integer that is the maximum number of entries in a map variable. This has a theoretical maximum of 2^64-1, but in actual use will be much smaller, considering the memory available for use by the map. Example: map(text(10),text(20),100) specifies a map of text string keys (max size 10 bytes) to text string values (max size 20 bytes), with 100 max entries. .PARAMETER Scope Scope of the variable: global - (default) one set of values visible across all Packet Engines on a standalone Citrix ADC, an HA pair, or all nodes of a cluster transaction - one value for each request-response transaction (singleton variables only; no expiration). Possible values = global, transaction .PARAMETER Iffull Action to perform if an assignment to a map exceeds its configured max-entries: lru - (default) reuse the least recently used entry in the map. undef - force the assignment to return an undefined (Undef) result to the policy executing the assignment. Possible values = undef, lru .PARAMETER Ifvaluetoobig Action to perform if an value is assigned to a text variable that exceeds its configured max-size, or if a key is used that exceeds its configured max-size: truncate - (default) truncate the text string to the first max-size bytes and proceed. undef - force the assignment or expression evaluation to return an undefined (Undef) result to the policy executing the assignment or expression. Possible values = undef, truncate .PARAMETER Ifnovalue Action to perform if on a variable reference in an expression if the variable is single-valued and uninitialized or if the variable is a map and there is no value for the specified key: init - (default) initialize the single-value variable, or create a map entry for the key and the initial value, using the -init value or its default. undef - force the expression evaluation to return an undefined (Undef) result to the policy executing the expression. Possible values = undef, init .PARAMETER Init Initialization value for this variable, to which a singleton variable or map entry will be set if it is referenced before an assignment action has assigned it a value. If the singleton variable or map entry already has been assigned a value, setting this parameter will have no effect on that variable value. Default: 0 for ulong, NULL for text. .PARAMETER Expires Value expiration in seconds. If the value is not referenced within the expiration period it will be deleted. 0 (the default) means no expiration. Maximum value = 31622400 .PARAMETER Comment Comments associated with this variable. .PARAMETER PassThru Return details about the created nsvariable item. .EXAMPLE PS C:\>Invoke-NSAddNsvariable -name <string> -type <string> An example how to add nsvariable config Object(s). .NOTES File Name : Invoke-NSAddNsvariable Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsvariable/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Type, [ValidateSet('global', 'transaction')] [string]$Scope = 'global', [ValidateSet('undef', 'lru')] [string]$Iffull = 'lru', [ValidateSet('undef', 'truncate')] [string]$Ifvaluetoobig = 'truncate', [ValidateSet('undef', 'init')] [string]$Ifnovalue = 'init', [string]$Init, [double]$Expires, [string]$Comment, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNsvariable: Starting" } process { try { $payload = @{ name = $name type = $type } if ( $PSBoundParameters.ContainsKey('scope') ) { $payload.Add('scope', $scope) } if ( $PSBoundParameters.ContainsKey('iffull') ) { $payload.Add('iffull', $iffull) } if ( $PSBoundParameters.ContainsKey('ifvaluetoobig') ) { $payload.Add('ifvaluetoobig', $ifvaluetoobig) } if ( $PSBoundParameters.ContainsKey('ifnovalue') ) { $payload.Add('ifnovalue', $ifnovalue) } if ( $PSBoundParameters.ContainsKey('init') ) { $payload.Add('init', $init) } if ( $PSBoundParameters.ContainsKey('expires') ) { $payload.Add('expires', $expires) } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSCmdlet.ShouldProcess("nsvariable", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsvariable -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNsvariable -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNsvariable: Finished" } } function Invoke-NSUpdateNsvariable { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for variable resource. .PARAMETER Name Variable name. This follows the same syntax rules as other expression entity names: It must begin with an alpha character (A-Z or a-z) or an underscore (_). The rest of the characters must be alpha, numeric (0-9) or underscores. It cannot be re or xp (reserved for regular and XPath expressions). It cannot be an expression reserved word (e.g. SYS or HTTP). It cannot be used for an existing expression object (HTTP callout, patset, dataset, stringmap, or named expression). .PARAMETER Type Specification of the variable type; one of the following: ulong - singleton variable with an unsigned 64-bit value. text(value-max-size) - singleton variable with a text string value. map(text(key-max-size),ulong,max-entries) - map of text string keys to unsigned 64-bit values. map(text(key-max-size),text(value-max-size),max-entries) - map of text string keys to text string values. where value-max-size is a positive integer that is the maximum number of bytes in a text string value. key-max-size is a positive integer that is the maximum number of bytes in a text string key. max-entries is a positive integer that is the maximum number of entries in a map variable. For a global singleton text variable, value-max-size <= 64000. For a global map with ulong values, key-max-size <= 64000. For a global map with text values, key-max-size + value-max-size <= 64000. max-entries is a positive integer that is the maximum number of entries in a map variable. This has a theoretical maximum of 2^64-1, but in actual use will be much smaller, considering the memory available for use by the map. Example: map(text(10),text(20),100) specifies a map of text string keys (max size 10 bytes) to text string values (max size 20 bytes), with 100 max entries. .PARAMETER Iffull Action to perform if an assignment to a map exceeds its configured max-entries: lru - (default) reuse the least recently used entry in the map. undef - force the assignment to return an undefined (Undef) result to the policy executing the assignment. Possible values = undef, lru .PARAMETER Ifvaluetoobig Action to perform if an value is assigned to a text variable that exceeds its configured max-size, or if a key is used that exceeds its configured max-size: truncate - (default) truncate the text string to the first max-size bytes and proceed. undef - force the assignment or expression evaluation to return an undefined (Undef) result to the policy executing the assignment or expression. Possible values = undef, truncate .PARAMETER Ifnovalue Action to perform if on a variable reference in an expression if the variable is single-valued and uninitialized or if the variable is a map and there is no value for the specified key: init - (default) initialize the single-value variable, or create a map entry for the key and the initial value, using the -init value or its default. undef - force the expression evaluation to return an undefined (Undef) result to the policy executing the expression. Possible values = undef, init .PARAMETER Init Initialization value for this variable, to which a singleton variable or map entry will be set if it is referenced before an assignment action has assigned it a value. If the singleton variable or map entry already has been assigned a value, setting this parameter will have no effect on that variable value. Default: 0 for ulong, NULL for text. .PARAMETER Expires Value expiration in seconds. If the value is not referenced within the expiration period it will be deleted. 0 (the default) means no expiration. Maximum value = 31622400 .PARAMETER Comment Comments associated with this variable. .PARAMETER PassThru Return details about the created nsvariable item. .EXAMPLE PS C:\>Invoke-NSUpdateNsvariable -name <string> An example how to update nsvariable config Object(s). .NOTES File Name : Invoke-NSUpdateNsvariable Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsvariable/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [ValidateScript({ $_.Length -gt 1 })] [string]$Type, [ValidateSet('undef', 'lru')] [string]$Iffull, [ValidateSet('undef', 'truncate')] [string]$Ifvaluetoobig, [ValidateSet('undef', 'init')] [string]$Ifnovalue, [string]$Init, [double]$Expires, [string]$Comment, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateNsvariable: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('type') ) { $payload.Add('type', $type) } if ( $PSBoundParameters.ContainsKey('iffull') ) { $payload.Add('iffull', $iffull) } if ( $PSBoundParameters.ContainsKey('ifvaluetoobig') ) { $payload.Add('ifvaluetoobig', $ifvaluetoobig) } if ( $PSBoundParameters.ContainsKey('ifnovalue') ) { $payload.Add('ifnovalue', $ifnovalue) } if ( $PSBoundParameters.ContainsKey('init') ) { $payload.Add('init', $init) } if ( $PSBoundParameters.ContainsKey('expires') ) { $payload.Add('expires', $expires) } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSCmdlet.ShouldProcess("nsvariable", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nsvariable -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNsvariable -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNsvariable: Finished" } } function Invoke-NSUnsetNsvariable { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for variable resource. .PARAMETER Name Variable name. This follows the same syntax rules as other expression entity names: It must begin with an alpha character (A-Z or a-z) or an underscore (_). The rest of the characters must be alpha, numeric (0-9) or underscores. It cannot be re or xp (reserved for regular and XPath expressions). It cannot be an expression reserved word (e.g. SYS or HTTP). It cannot be used for an existing expression object (HTTP callout, patset, dataset, stringmap, or named expression). .PARAMETER Iffull Action to perform if an assignment to a map exceeds its configured max-entries: lru - (default) reuse the least recently used entry in the map. undef - force the assignment to return an undefined (Undef) result to the policy executing the assignment. Possible values = undef, lru .PARAMETER Ifvaluetoobig Action to perform if an value is assigned to a text variable that exceeds its configured max-size, or if a key is used that exceeds its configured max-size: truncate - (default) truncate the text string to the first max-size bytes and proceed. undef - force the assignment or expression evaluation to return an undefined (Undef) result to the policy executing the assignment or expression. Possible values = undef, truncate .PARAMETER Ifnovalue Action to perform if on a variable reference in an expression if the variable is single-valued and uninitialized or if the variable is a map and there is no value for the specified key: init - (default) initialize the single-value variable, or create a map entry for the key and the initial value, using the -init value or its default. undef - force the expression evaluation to return an undefined (Undef) result to the policy executing the expression. Possible values = undef, init .PARAMETER Init Initialization value for this variable, to which a singleton variable or map entry will be set if it is referenced before an assignment action has assigned it a value. If the singleton variable or map entry already has been assigned a value, setting this parameter will have no effect on that variable value. Default: 0 for ulong, NULL for text. .PARAMETER Expires Value expiration in seconds. If the value is not referenced within the expiration period it will be deleted. 0 (the default) means no expiration. Maximum value = 31622400 .PARAMETER Comment Comments associated with this variable. .EXAMPLE PS C:\>Invoke-NSUnsetNsvariable -name <string> An example how to unset nsvariable config Object(s). .NOTES File Name : Invoke-NSUnsetNsvariable Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsvariable Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [Boolean]$iffull, [Boolean]$ifvaluetoobig, [Boolean]$ifnovalue, [Boolean]$init, [Boolean]$expires, [Boolean]$comment ) begin { Write-Verbose "Invoke-NSUnsetNsvariable: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('iffull') ) { $payload.Add('iffull', $iffull) } if ( $PSBoundParameters.ContainsKey('ifvaluetoobig') ) { $payload.Add('ifvaluetoobig', $ifvaluetoobig) } if ( $PSBoundParameters.ContainsKey('ifnovalue') ) { $payload.Add('ifnovalue', $ifnovalue) } if ( $PSBoundParameters.ContainsKey('init') ) { $payload.Add('init', $init) } if ( $PSBoundParameters.ContainsKey('expires') ) { $payload.Add('expires', $expires) } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSCmdlet.ShouldProcess("$name", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nsvariable -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNsvariable: Finished" } } function Invoke-NSDeleteNsvariable { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Configuration for variable resource. .PARAMETER Name Variable name. This follows the same syntax rules as other expression entity names: It must begin with an alpha character (A-Z or a-z) or an underscore (_). The rest of the characters must be alpha, numeric (0-9) or underscores. It cannot be re or xp (reserved for regular and XPath expressions). It cannot be an expression reserved word (e.g. SYS or HTTP). It cannot be used for an existing expression object (HTTP callout, patset, dataset, stringmap, or named expression). .EXAMPLE PS C:\>Invoke-NSDeleteNsvariable -Name <string> An example how to delete nsvariable config Object(s). .NOTES File Name : Invoke-NSDeleteNsvariable Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsvariable/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Name ) begin { Write-Verbose "Invoke-NSDeleteNsvariable: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nsvariable -NitroPath nitro/v1/config -Resource $name -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNsvariable: Finished" } } function Invoke-NSGetNsvariable { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for variable resource. .PARAMETER Name Variable name. This follows the same syntax rules as other expression entity names: It must begin with an alpha character (A-Z or a-z) or an underscore (_). The rest of the characters must be alpha, numeric (0-9) or underscores. It cannot be re or xp (reserved for regular and XPath expressions). It cannot be an expression reserved word (e.g. SYS or HTTP). It cannot be used for an existing expression object (HTTP callout, patset, dataset, stringmap, or named expression). .PARAMETER GetAll Retrieve all nsvariable object(s). .PARAMETER Count If specified, the count of the nsvariable object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsvariable Get data. .EXAMPLE PS C:\>Invoke-NSGetNsvariable -GetAll Get all nsvariable data. .EXAMPLE PS C:\>Invoke-NSGetNsvariable -Count Get the number of nsvariable objects. .EXAMPLE PS C:\>Invoke-NSGetNsvariable -name <string> Get nsvariable object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsvariable -Filter @{ 'name'='<value>' } Get nsvariable data with a filter. .NOTES File Name : Invoke-NSGetNsvariable Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsvariable/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateScript({ $_.Length -gt 1 })] [string]$Name, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNsvariable: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsvariable objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsvariable -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsvariable objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsvariable -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsvariable objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsvariable -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsvariable configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsvariable -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nsvariable configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsvariable -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsvariable: Ended" } } function Invoke-NSGetNsversion { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for version resource. .PARAMETER Installedversion Installed version. .PARAMETER GetAll Retrieve all nsversion object(s). .PARAMETER Count If specified, the count of the nsversion object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsversion Get data. .EXAMPLE PS C:\>Invoke-NSGetNsversion -GetAll Get all nsversion data. .EXAMPLE PS C:\>Invoke-NSGetNsversion -name <string> Get nsversion object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsversion -Filter @{ 'name'='<value>' } Get nsversion data with a filter. .NOTES File Name : Invoke-NSGetNsversion Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsversion/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByArgument')] [boolean]$Installedversion, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNsversion: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsversion objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsversion -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsversion objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsversion -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsversion objects by arguments" $arguments = @{ } if ( $PSBoundParameters.ContainsKey('installedversion') ) { $arguments.Add('installedversion', $installedversion) } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsversion -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsversion configuration for property ''" } else { Write-Verbose "Retrieving nsversion configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsversion -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsversion: Ended" } } function Invoke-NSUpdateNsvpxparam { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for "VPX" resource. .PARAMETER Masterclockcpu1 This argument is deprecated. Possible values = YES, NO .PARAMETER Cpuyield This setting applicable in virtual appliances, is to affect the cpu yield(relinquishing the cpu resources) in any hypervised environment. * There are 3 options for the behavior: 1. YES - Allow the Virtual Appliance to yield its vCPUs periodically, if there is no data traffic. 2. NO - Virtual Appliance will not yield the vCPU. 3. DEFAULT - Restores the default behaviour, according to the license. * Its behavior in different scenarios: 1. As this setting is node specific only, it will not be propagated to other nodes, when executed on Cluster(CLIP) and HA(Primary). 2. In cluster setup, use '-ownerNode' to specify ID of the cluster node. 3. This setting is a system wide implementation and not granular to vCPUs. 4. No effect on the management PE. Possible values = DEFAULT, YES, NO .PARAMETER Ownernode ID of the cluster node for which you are setting the cpuyield and/or KVMVirtioMultiqueue. It can be configured only through the cluster IP address. Maximum value = 31 .PARAMETER Kvmvirtiomultiqueue This setting applicable on KVM VPX with virtio NICs, is to configure multiple queues for all virtio interfaces. * There are 2 options for this behavior: 1. YES - Allows VPX to use multiple queues for each virtio interface as configured through the KVM Hypervisor. 2. NO - Each virtio interface within VPX will use a single queue for transmit and receive. * Its behavior in different scenarios: 1. As this setting is node specific only, it will not be propagated to other nodes, when executed on Cluster(CLIP) and HA(Primary). 2. In cluster setup, use '-ownerNode' to specify ID of the cluster node. Possible values = YES, NO .EXAMPLE PS C:\>Invoke-NSUpdateNsvpxparam An example how to update nsvpxparam config Object(s). .NOTES File Name : Invoke-NSUpdateNsvpxparam Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsvpxparam/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateSet('YES', 'NO')] [string]$Masterclockcpu1, [ValidateSet('DEFAULT', 'YES', 'NO')] [string]$Cpuyield, [double]$Ownernode, [ValidateSet('YES', 'NO')] [string]$Kvmvirtiomultiqueue ) begin { Write-Verbose "Invoke-NSUpdateNsvpxparam: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('masterclockcpu1') ) { $payload.Add('masterclockcpu1', $masterclockcpu1) } if ( $PSBoundParameters.ContainsKey('cpuyield') ) { $payload.Add('cpuyield', $cpuyield) } if ( $PSBoundParameters.ContainsKey('ownernode') ) { $payload.Add('ownernode', $ownernode) } if ( $PSBoundParameters.ContainsKey('kvmvirtiomultiqueue') ) { $payload.Add('kvmvirtiomultiqueue', $kvmvirtiomultiqueue) } if ( $PSCmdlet.ShouldProcess("nsvpxparam", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nsvpxparam -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNsvpxparam: Finished" } } function Invoke-NSUnsetNsvpxparam { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for "VPX" resource. .PARAMETER Masterclockcpu1 This argument is deprecated. Possible values = YES, NO .PARAMETER Cpuyield This setting applicable in virtual appliances, is to affect the cpu yield(relinquishing the cpu resources) in any hypervised environment. * There are 3 options for the behavior: 1. YES - Allow the Virtual Appliance to yield its vCPUs periodically, if there is no data traffic. 2. NO - Virtual Appliance will not yield the vCPU. 3. DEFAULT - Restores the default behaviour, according to the license. * Its behavior in different scenarios: 1. As this setting is node specific only, it will not be propagated to other nodes, when executed on Cluster(CLIP) and HA(Primary). 2. In cluster setup, use '-ownerNode' to specify ID of the cluster node. 3. This setting is a system wide implementation and not granular to vCPUs. 4. No effect on the management PE. Possible values = DEFAULT, YES, NO .PARAMETER Ownernode ID of the cluster node for which you are setting the cpuyield and/or KVMVirtioMultiqueue. It can be configured only through the cluster IP address. Maximum value = 31 .PARAMETER Kvmvirtiomultiqueue This setting applicable on KVM VPX with virtio NICs, is to configure multiple queues for all virtio interfaces. * There are 2 options for this behavior: 1. YES - Allows VPX to use multiple queues for each virtio interface as configured through the KVM Hypervisor. 2. NO - Each virtio interface within VPX will use a single queue for transmit and receive. * Its behavior in different scenarios: 1. As this setting is node specific only, it will not be propagated to other nodes, when executed on Cluster(CLIP) and HA(Primary). 2. In cluster setup, use '-ownerNode' to specify ID of the cluster node. Possible values = YES, NO .EXAMPLE PS C:\>Invoke-NSUnsetNsvpxparam An example how to unset nsvpxparam config Object(s). .NOTES File Name : Invoke-NSUnsetNsvpxparam Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsvpxparam Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Boolean]$masterclockcpu1, [Boolean]$cpuyield, [Boolean]$ownernode, [Boolean]$kvmvirtiomultiqueue ) begin { Write-Verbose "Invoke-NSUnsetNsvpxparam: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('masterclockcpu1') ) { $payload.Add('masterclockcpu1', $masterclockcpu1) } if ( $PSBoundParameters.ContainsKey('cpuyield') ) { $payload.Add('cpuyield', $cpuyield) } if ( $PSBoundParameters.ContainsKey('ownernode') ) { $payload.Add('ownernode', $ownernode) } if ( $PSBoundParameters.ContainsKey('kvmvirtiomultiqueue') ) { $payload.Add('kvmvirtiomultiqueue', $kvmvirtiomultiqueue) } if ( $PSCmdlet.ShouldProcess("nsvpxparam", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nsvpxparam -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNsvpxparam: Finished" } } function Invoke-NSGetNsvpxparam { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for "VPX" resource. .PARAMETER GetAll Retrieve all nsvpxparam object(s). .PARAMETER Count If specified, the count of the nsvpxparam object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsvpxparam Get data. .EXAMPLE PS C:\>Invoke-NSGetNsvpxparam -GetAll Get all nsvpxparam data. .EXAMPLE PS C:\>Invoke-NSGetNsvpxparam -Count Get the number of nsvpxparam objects. .EXAMPLE PS C:\>Invoke-NSGetNsvpxparam -name <string> Get nsvpxparam object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsvpxparam -Filter @{ 'name'='<value>' } Get nsvpxparam data with a filter. .NOTES File Name : Invoke-NSGetNsvpxparam Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsvpxparam/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNsvpxparam: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsvpxparam objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsvpxparam -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsvpxparam objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsvpxparam -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsvpxparam objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsvpxparam -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsvpxparam configuration for property ''" } else { Write-Verbose "Retrieving nsvpxparam configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsvpxparam -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsvpxparam: Ended" } } function Invoke-NSUpdateNsweblogparam { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for Web log parameters resource. .PARAMETER Buffersizemb Buffer size, in MB, allocated for log transaction data on the system. The maximum value is limited to the memory available on the system. Maximum value = 4294967294LU .PARAMETER Customreqhdrs Name(s) of HTTP request headers whose values should be exported by the Web Logging feature. .PARAMETER Customrsphdrs Name(s) of HTTP response headers whose values should be exported by the Web Logging feature. .EXAMPLE PS C:\>Invoke-NSUpdateNsweblogparam An example how to update nsweblogparam config Object(s). .NOTES File Name : Invoke-NSUpdateNsweblogparam Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsweblogparam/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [double]$Buffersizemb, [ValidateScript({ $_.Length -gt 1 })] [string[]]$Customreqhdrs, [ValidateScript({ $_.Length -gt 1 })] [string[]]$Customrsphdrs ) begin { Write-Verbose "Invoke-NSUpdateNsweblogparam: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('buffersizemb') ) { $payload.Add('buffersizemb', $buffersizemb) } if ( $PSBoundParameters.ContainsKey('customreqhdrs') ) { $payload.Add('customreqhdrs', $customreqhdrs) } if ( $PSBoundParameters.ContainsKey('customrsphdrs') ) { $payload.Add('customrsphdrs', $customrsphdrs) } if ( $PSCmdlet.ShouldProcess("nsweblogparam", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nsweblogparam -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNsweblogparam: Finished" } } function Invoke-NSUnsetNsweblogparam { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for Web log parameters resource. .PARAMETER Buffersizemb Buffer size, in MB, allocated for log transaction data on the system. The maximum value is limited to the memory available on the system. Maximum value = 4294967294LU .PARAMETER Customreqhdrs Name(s) of HTTP request headers whose values should be exported by the Web Logging feature. .PARAMETER Customrsphdrs Name(s) of HTTP response headers whose values should be exported by the Web Logging feature. .EXAMPLE PS C:\>Invoke-NSUnsetNsweblogparam An example how to unset nsweblogparam config Object(s). .NOTES File Name : Invoke-NSUnsetNsweblogparam Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsweblogparam Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Boolean]$buffersizemb, [Boolean]$customreqhdrs, [Boolean]$customrsphdrs ) begin { Write-Verbose "Invoke-NSUnsetNsweblogparam: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('buffersizemb') ) { $payload.Add('buffersizemb', $buffersizemb) } if ( $PSBoundParameters.ContainsKey('customreqhdrs') ) { $payload.Add('customreqhdrs', $customreqhdrs) } if ( $PSBoundParameters.ContainsKey('customrsphdrs') ) { $payload.Add('customrsphdrs', $customrsphdrs) } if ( $PSCmdlet.ShouldProcess("nsweblogparam", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nsweblogparam -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNsweblogparam: Finished" } } function Invoke-NSGetNsweblogparam { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for Web log parameters resource. .PARAMETER GetAll Retrieve all nsweblogparam object(s). .PARAMETER Count If specified, the count of the nsweblogparam object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsweblogparam Get data. .EXAMPLE PS C:\>Invoke-NSGetNsweblogparam -GetAll Get all nsweblogparam data. .EXAMPLE PS C:\>Invoke-NSGetNsweblogparam -name <string> Get nsweblogparam object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsweblogparam -Filter @{ 'name'='<value>' } Get nsweblogparam data with a filter. .NOTES File Name : Invoke-NSGetNsweblogparam Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsweblogparam/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetNsweblogparam: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsweblogparam objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsweblogparam -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsweblogparam objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsweblogparam -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsweblogparam objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsweblogparam -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsweblogparam configuration for property ''" } else { Write-Verbose "Retrieving nsweblogparam configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsweblogparam -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsweblogparam: Ended" } } function Invoke-NSAddNsxmlnamespace { <# .SYNOPSIS Add System/Global level configuration. config Object. .DESCRIPTION Configuration for XML namespace resource. .PARAMETER Prefix XML prefix. .PARAMETER Namespace Expanded namespace for which the XML prefix is provided. .PARAMETER Description Description for the prefix. .PARAMETER PassThru Return details about the created nsxmlnamespace item. .EXAMPLE PS C:\>Invoke-NSAddNsxmlnamespace -prefix <string> -Namespace <string> An example how to add nsxmlnamespace config Object(s). .NOTES File Name : Invoke-NSAddNsxmlnamespace Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsxmlnamespace/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Prefix, [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Namespace, [ValidateScript({ $_.Length -gt 1 })] [string]$Description, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddNsxmlnamespace: Starting" } process { try { $payload = @{ prefix = $prefix Namespace = $Namespace } if ( $PSBoundParameters.ContainsKey('description') ) { $payload.Add('description', $description) } if ( $PSCmdlet.ShouldProcess("nsxmlnamespace", "Add System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type nsxmlnamespace -Payload $payload -GetWarning #HTTP Status Code on Success: 201 Created #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNsxmlnamespace -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddNsxmlnamespace: Finished" } } function Invoke-NSDeleteNsxmlnamespace { <# .SYNOPSIS Delete System/Global level configuration. config Object. .DESCRIPTION Configuration for XML namespace resource. .PARAMETER Prefix XML prefix. .EXAMPLE PS C:\>Invoke-NSDeleteNsxmlnamespace -Prefix <string> An example how to delete nsxmlnamespace config Object(s). .NOTES File Name : Invoke-NSDeleteNsxmlnamespace Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsxmlnamespace/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [string]$Prefix ) begin { Write-Verbose "Invoke-NSDeleteNsxmlnamespace: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$prefix", "Delete System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type nsxmlnamespace -NitroPath nitro/v1/config -Resource $prefix -Arguments $arguments #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSDeleteNsxmlnamespace: Finished" } } function Invoke-NSUpdateNsxmlnamespace { <# .SYNOPSIS Update System/Global level configuration. config Object. .DESCRIPTION Configuration for XML namespace resource. .PARAMETER Prefix XML prefix. .PARAMETER Namespace Expanded namespace for which the XML prefix is provided. .PARAMETER Description Description for the prefix. .PARAMETER PassThru Return details about the created nsxmlnamespace item. .EXAMPLE PS C:\>Invoke-NSUpdateNsxmlnamespace -prefix <string> An example how to update nsxmlnamespace config Object(s). .NOTES File Name : Invoke-NSUpdateNsxmlnamespace Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsxmlnamespace/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Prefix, [ValidateScript({ $_.Length -gt 1 })] [string]$Namespace, [ValidateScript({ $_.Length -gt 1 })] [string]$Description, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateNsxmlnamespace: Starting" } process { try { $payload = @{ prefix = $prefix } if ( $PSBoundParameters.ContainsKey('Namespace') ) { $payload.Add('Namespace', $Namespace) } if ( $PSBoundParameters.ContainsKey('description') ) { $payload.Add('description', $description) } if ( $PSCmdlet.ShouldProcess("nsxmlnamespace", "Update System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type nsxmlnamespace -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error if ( $PSBoundParameters.ContainsKey('PassThru') ) { Write-Output (Invoke-NSGetNsxmlnamespace -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateNsxmlnamespace: Finished" } } function Invoke-NSUnsetNsxmlnamespace { <# .SYNOPSIS Unset System/Global level configuration. config Object. .DESCRIPTION Configuration for XML namespace resource. .PARAMETER Prefix XML prefix. .PARAMETER Namespace Expanded namespace for which the XML prefix is provided. .PARAMETER Description Description for the prefix. .EXAMPLE PS C:\>Invoke-NSUnsetNsxmlnamespace -prefix <string> An example how to unset nsxmlnamespace config Object(s). .NOTES File Name : Invoke-NSUnsetNsxmlnamespace Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsxmlnamespace Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [ValidateScript({ $_.Length -gt 1 })] [string]$Prefix, [Boolean]$Namespace, [Boolean]$description ) begin { Write-Verbose "Invoke-NSUnsetNsxmlnamespace: Starting" } process { try { $payload = @{ prefix = $prefix } if ( $PSBoundParameters.ContainsKey('Namespace') ) { $payload.Add('Namespace', $Namespace) } if ( $PSBoundParameters.ContainsKey('description') ) { $payload.Add('description', $description) } if ( $PSCmdlet.ShouldProcess("$prefix", "Unset System/Global level configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type nsxmlnamespace -NitroPath nitro/v1/config -Action unset -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $response } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUnsetNsxmlnamespace: Finished" } } function Invoke-NSGetNsxmlnamespace { <# .SYNOPSIS Get System/Global level configuration. config object(s). .DESCRIPTION Configuration for XML namespace resource. .PARAMETER Prefix XML prefix. .PARAMETER GetAll Retrieve all nsxmlnamespace object(s). .PARAMETER Count If specified, the count of the nsxmlnamespace object(s) will be returned. .PARAMETER Filter Specify a filter. -Filter @{ 'name'='<value>' } .PARAMETER ViewSummary When specified, only a summary of information is returned. .EXAMPLE PS C:\>Invoke-NSGetNsxmlnamespace Get data. .EXAMPLE PS C:\>Invoke-NSGetNsxmlnamespace -GetAll Get all nsxmlnamespace data. .EXAMPLE PS C:\>Invoke-NSGetNsxmlnamespace -Count Get the number of nsxmlnamespace objects. .EXAMPLE PS C:\>Invoke-NSGetNsxmlnamespace -name <string> Get nsxmlnamespace object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetNsxmlnamespace -Filter @{ 'name'='<value>' } Get nsxmlnamespace data with a filter. .NOTES File Name : Invoke-NSGetNsxmlnamespace Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/nsxmlnamespace/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(DefaultParameterSetName = "GetAll")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [Parameter(ParameterSetName = 'GetByResource')] [ValidateScript({ $_.Length -gt 1 })] [string]$Prefix, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Parameter(ParameterSetName = 'Get')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetNsxmlnamespace: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all nsxmlnamespace objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsxmlnamespace -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'Count' ) { if ( $PSBoundParameters.ContainsKey('Count') ) { $query = @{ 'count' = 'yes' } } Write-Verbose "Retrieving total count for nsxmlnamespace objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsxmlnamespace -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving nsxmlnamespace objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsxmlnamespace -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving nsxmlnamespace configuration for property 'prefix'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsxmlnamespace -NitroPath nitro/v1/config -Resource $prefix -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving nsxmlnamespace configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type nsxmlnamespace -NitroPath nitro/v1/config -Summary:$ViewSummary -Query $query -Filter $Filter -GetWarning } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" $response = $null } Write-Output $response } end { Write-Verbose "Invoke-NSGetNsxmlnamespace: Ended" } } function Invoke-NSReboot { <# .SYNOPSIS Reboot System/Global level configuration. config Object. .DESCRIPTION Configuration for 0 resource. .PARAMETER Warm Restarts the Citrix ADC software without rebooting the underlying operating system. The session terminates and you must log on to the appliance after it has restarted. Note: This argument is required only for nCore appliances. Classic appliances ignore this argument. .EXAMPLE PS C:\>Invoke-NSReboot An example how to reboot reboot config Object(s). .NOTES File Name : Invoke-NSReboot Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/reboot/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession), [boolean]$Warm ) begin { Write-Verbose "Invoke-NSReboot: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('warm') ) { $payload.Add('warm', $warm) } if ( $PSCmdlet.ShouldProcess($Name, "Reboot System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type reboot -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSReboot: Finished" } } function Invoke-NSShutdown { <# .SYNOPSIS Shutdown System/Global level configuration. config Object. .DESCRIPTION Configuration for 0 resource. .EXAMPLE PS C:\>Invoke-NSShutdown An example how to shutdown shutdown config Object(s). .NOTES File Name : Invoke-NSShutdown Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/shutdown/ Requires : PowerShell v5.1 and up NS 13.x and up. NS 12 and lower may work, not guaranteed (best effort). .LINK https://blog.j81.nl #> [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPasswordParams', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] param( [Parameter(DontShow)] [Object]$NSSession = (Get-NSSession) ) begin { Write-Verbose "Invoke-NSShutdown: Starting" } process { try { $payload = @{ } if ( $PSCmdlet.ShouldProcess($Name, "Shutdown System/Global level configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type shutdown -Payload $payload -GetWarning #HTTP Status Code on Success: 200 OK #HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error Write-Output $result } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSShutdown: Finished" } } # SIG # Begin signature block # MIIkmgYJKoZIhvcNAQcCoIIkizCCJIcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAvj2PvJdJ6X/oJ # HeZMb1tNWhB3fdDZvn48NHMj/i4BeKCCHl4wggTzMIID26ADAgECAhAsJ03zZBC0 # i/247uUvWN5TMA0GCSqGSIb3DQEBCwUAMHwxCzAJBgNVBAYTAkdCMRswGQYDVQQI # ExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNVBAcTB1NhbGZvcmQxGDAWBgNVBAoT # D1NlY3RpZ28gTGltaXRlZDEkMCIGA1UEAxMbU2VjdGlnbyBSU0EgQ29kZSBTaWdu # aW5nIENBMB4XDTIxMDUwNTAwMDAwMFoXDTI0MDUwNDIzNTk1OVowWzELMAkGA1UE # BhMCTkwxEjAQBgNVBAcMCVZlbGRob3ZlbjEbMBkGA1UECgwSSm9oYW5uZXMgQmls # bGVrZW5zMRswGQYDVQQDDBJKb2hhbm5lcyBCaWxsZWtlbnMwggEiMA0GCSqGSIb3 # DQEBAQUAA4IBDwAwggEKAoIBAQCsfgRG81keOHalHfCUgxOa1Qy4VNOnGxB8SL8e # rjP9SfcF13McP7F1HGka5Be495pTZ+duGbaQMNozwg/5Dg9IRJEeBabeSSJJCbZo # SNpmUu7NNRRfidQxlPC81LxTVHxJ7In0MEfCVm7rWcri28MRCAuafqOfSE+hyb1Z # /tKyCyQ5RUq3kjs/CF+VfMHsJn6ZT63YqewRkwHuc7UogTTZKjhPJ9prGLTer8UX # UgvsGRbvhYZXIEuy+bmx/iJ1yRl1kX4nj6gUYzlhemOnlSDD66YOrkLDhXPMXLym # AN7h0/W5Bo//R5itgvdGBkXkWCKRASnq/9PTcoxW6mwtgU8xAgMBAAGjggGQMIIB # jDAfBgNVHSMEGDAWgBQO4TqoUzox1Yq+wbutZxoDha00DjAdBgNVHQ4EFgQUZWMy # gC0i1u2NZ1msk2Mm5nJm5AswDgYDVR0PAQH/BAQDAgeAMAwGA1UdEwEB/wQCMAAw # EwYDVR0lBAwwCgYIKwYBBQUHAwMwEQYJYIZIAYb4QgEBBAQDAgQQMEoGA1UdIARD # MEEwNQYMKwYBBAGyMQECAQMCMCUwIwYIKwYBBQUHAgEWF2h0dHBzOi8vc2VjdGln # by5jb20vQ1BTMAgGBmeBDAEEATBDBgNVHR8EPDA6MDigNqA0hjJodHRwOi8vY3Js # LnNlY3RpZ28uY29tL1NlY3RpZ29SU0FDb2RlU2lnbmluZ0NBLmNybDBzBggrBgEF # BQcBAQRnMGUwPgYIKwYBBQUHMAKGMmh0dHA6Ly9jcnQuc2VjdGlnby5jb20vU2Vj # dGlnb1JTQUNvZGVTaWduaW5nQ0EuY3J0MCMGCCsGAQUFBzABhhdodHRwOi8vb2Nz # cC5zZWN0aWdvLmNvbTANBgkqhkiG9w0BAQsFAAOCAQEARjv9ieRocb1DXRWm3XtY # jjuSRjlvkoPd9wS6DNfsGlSU42BFd9LCKSyRREZVu8FDq7dN0PhD4bBTT+k6AgrY # KG6f/8yUponOdxskv850SjN2S2FeVuR20pqActMrpd1+GCylG8mj8RGjdrLQ3QuX # qYKS68WJ39WWYdVB/8Ftajir5p6sAfwHErLhbJS6WwmYjGI/9SekossvU8mZjZwo # Gbu+fjZhPc4PhjbEh0ABSsPMfGjQQsg5zLFjg/P+cS6hgYI7qctToo0TexGe32DY # fFWHrHuBErW2qXEJvzSqM5OtLRD06a4lH5ZkhojhMOX9S8xDs/ArDKgX1j1Xm4Tu # DjCCBYEwggRpoAMCAQICEDlyRDr5IrdR19NsEN0xNZUwDQYJKoZIhvcNAQEMBQAw # ezELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G # A1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNV # BAMMGEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczAeFw0xOTAzMTIwMDAwMDBaFw0y # ODEyMzEyMzU5NTlaMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMKTmV3IEplcnNl # eTEUMBIGA1UEBxMLSmVyc2V5IENpdHkxHjAcBgNVBAoTFVRoZSBVU0VSVFJVU1Qg # TmV0d29yazEuMCwGA1UEAxMlVVNFUlRydXN0IFJTQSBDZXJ0aWZpY2F0aW9uIEF1 # dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAIASZRc2DsPb # CLPQrFcNdu3NJ9NMrVCDYeKqIE0JLWQJ3M6Jn8w9qez2z8Hc8dOx1ns3KBErR9o5 # xrw6GbRfpr19naNjQrZ28qk7K5H44m/Q7BYgkAk+4uh0yRi0kdRiZNt/owbxiBhq # kCI8vP4T8IcUe/bkH47U5FHGEWdGCFHLhhRUP7wz/n5snP8WnRi9UY41pqdmyHJn # 2yFmsdSbeAPAUDrozPDcvJ5M/q8FljUfV1q3/875PbcstvZU3cjnEjpNrkyKt1ya # tLcgPcp/IjSufjtoZgFE5wFORlObM2D3lL5TN5BzQ/Myw1Pv26r+dE5px2uMYJPe # xMcM3+EyrsyTO1F4lWeL7j1W/gzQaQ8bD/MlJmszbfduR/pzQ+V+DqVmsSl8MoRj # VYnEDcGTVDAZE6zTfTen6106bDVc20HXEtqpSQvf2ICKCZNijrVmzyWIzYS4sT+k # OQ/ZAp7rEkyVfPNrBaleFoPMuGfi6BOdzFuC00yz7Vv/3uVzrCM7LQC/NVV0CUnY # SVgaf5I25lGSDvMmfRxNF7zJ7EMm0L9BX0CpRET0medXh55QH1dUqD79dGMvsVBl # CeZYQi5DGky08CVHWfoEHpPUJkZKUIGy3r54t/xnFeHJV4QeD2PW6WK61l9VLupc # xigIBCU5uA4rqfJMlxwHPw1S9e3vL4IPAgMBAAGjgfIwge8wHwYDVR0jBBgwFoAU # oBEKIz6W8Qfs4q8p74Klf9AwpLQwHQYDVR0OBBYEFFN5v1qqK0rPVIDh2JvAnfKy # A2bLMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MBEGA1UdIAQKMAgw # BgYEVR0gADBDBgNVHR8EPDA6MDigNqA0hjJodHRwOi8vY3JsLmNvbW9kb2NhLmNv # bS9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNybDA0BggrBgEFBQcBAQQoMCYwJAYI # KwYBBQUHMAGGGGh0dHA6Ly9vY3NwLmNvbW9kb2NhLmNvbTANBgkqhkiG9w0BAQwF # AAOCAQEAGIdR3HQhPZyK4Ce3M9AuzOzw5steEd4ib5t1jp5y/uTW/qofnJYt7wNK # fq70jW9yPEM7wD/ruN9cqqnGrvL82O6je0P2hjZ8FODN9Pc//t64tIrwkZb+/UNk # fv3M0gGhfX34GRnJQisTv1iLuqSiZgR2iJFODIkUzqJNyTKzuugUGrxx8VvwQQuY # AAoiAxDlDLH5zZI3Ge078eQ6tvlFEyZ1r7uq7z97dzvSxAKRPRkA0xdcOds/exgN # Rc2ThZYvXd9ZFk8/Ub3VRRg/7UqO6AZhdCMWtQ1QcydER38QXYkqa4UxFMToqWpM # gLxqeM+4f452cpkMnf7XkQgWoaNflTCCBfUwggPdoAMCAQICEB2iSDBvmyYY0ILg # ln0z02owDQYJKoZIhvcNAQEMBQAwgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpO # ZXcgSmVyc2V5MRQwEgYDVQQHEwtKZXJzZXkgQ2l0eTEeMBwGA1UEChMVVGhlIFVT # RVJUUlVTVCBOZXR3b3JrMS4wLAYDVQQDEyVVU0VSVHJ1c3QgUlNBIENlcnRpZmlj # YXRpb24gQXV0aG9yaXR5MB4XDTE4MTEwMjAwMDAwMFoXDTMwMTIzMTIzNTk1OVow # fDELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G # A1UEBxMHU2FsZm9yZDEYMBYGA1UEChMPU2VjdGlnbyBMaW1pdGVkMSQwIgYDVQQD # ExtTZWN0aWdvIFJTQSBDb2RlIFNpZ25pbmcgQ0EwggEiMA0GCSqGSIb3DQEBAQUA # A4IBDwAwggEKAoIBAQCGIo0yhXoYn0nwli9jCB4t3HyfFM/jJrYlZilAhlRGdDFi # xRDtsocnppnLlTDAVvWkdcapDlBipVGREGrgS2Ku/fD4GKyn/+4uMyD6DBmJqGx7 # rQDDYaHcaWVtH24nlteXUYam9CflfGqLlR5bYNV+1xaSnAAvaPeX7Wpyvjg7Y96P # v25MQV0SIAhZ6DnNj9LWzwa0VwW2TqE+V2sfmLzEYtYbC43HZhtKn52BxHJAteJf # 7wtF/6POF6YtVbC3sLxUap28jVZTxvC6eVBJLPcDuf4vZTXyIuosB69G2flGHNyM # fHEo8/6nxhTdVZFuihEN3wYklX0Pp6F8OtqGNWHTAgMBAAGjggFkMIIBYDAfBgNV # HSMEGDAWgBRTeb9aqitKz1SA4dibwJ3ysgNmyzAdBgNVHQ4EFgQUDuE6qFM6MdWK # vsG7rWcaA4WtNA4wDgYDVR0PAQH/BAQDAgGGMBIGA1UdEwEB/wQIMAYBAf8CAQAw # HQYDVR0lBBYwFAYIKwYBBQUHAwMGCCsGAQUFBwMIMBEGA1UdIAQKMAgwBgYEVR0g # ADBQBgNVHR8ESTBHMEWgQ6BBhj9odHRwOi8vY3JsLnVzZXJ0cnVzdC5jb20vVVNF # UlRydXN0UlNBQ2VydGlmaWNhdGlvbkF1dGhvcml0eS5jcmwwdgYIKwYBBQUHAQEE # ajBoMD8GCCsGAQUFBzAChjNodHRwOi8vY3J0LnVzZXJ0cnVzdC5jb20vVVNFUlRy # dXN0UlNBQWRkVHJ1c3RDQS5jcnQwJQYIKwYBBQUHMAGGGWh0dHA6Ly9vY3NwLnVz # ZXJ0cnVzdC5jb20wDQYJKoZIhvcNAQEMBQADggIBAE1jUO1HNEphpNveaiqMm/EA # AB4dYns61zLC9rPgY7P7YQCImhttEAcET7646ol4IusPRuzzRl5ARokS9At3Wpwq # QTr81vTr5/cVlTPDoYMot94v5JT3hTODLUpASL+awk9KsY8k9LOBN9O3ZLCmI2pZ # aFJCX/8E6+F0ZXkI9amT3mtxQJmWunjxucjiwwgWsatjWsgVgG10Xkp1fqW4w2y1 # z99KeYdcx0BNYzX2MNPPtQoOCwR/oEuuu6Ol0IQAkz5TXTSlADVpbL6fICUQDRn7 # UJBhvjmPeo5N9p8OHv4HURJmgyYZSJXOSsnBf/M6BZv5b9+If8AjntIeQ3pFMcGc # TanwWbJZGehqjSkEAnd8S0vNcL46slVaeD68u28DECV3FTSK+TbMQ5Lkuk/xYpMo # JVcp+1EZx6ElQGqEV8aynbG8HArafGd+fS7pKEwYfsR7MUFxmksp7As9V1DSyt39 # ngVR5UR43QHesXWYDVQk/fBO4+L4g71yuss9Ou7wXheSaG3IYfmm8SoKC6W59J7u # mDIFhZ7r+YMp08Ysfb06dy6LN0KgaoLtO0qqlBCk4Q34F8W2WnkzGJLjtXX4oemO # CiUe5B7xn1qHI/+fpFGe+zmAEc3btcSnqIBv5VPU4OOiwtJbGvoyJi1qV3AcPKRY # LqPzW0sH3DJZ84enGm1YMIIG7DCCBNSgAwIBAgIQMA9vrN1mmHR8qUY2p3gtuTAN # BgkqhkiG9w0BAQwFADCBiDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJz # ZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNU # IE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBB # dXRob3JpdHkwHhcNMTkwNTAyMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjB9MQswCQYD # VQQGEwJHQjEbMBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdT # YWxmb3JkMRgwFgYDVQQKEw9TZWN0aWdvIExpbWl0ZWQxJTAjBgNVBAMTHFNlY3Rp # Z28gUlNBIFRpbWUgU3RhbXBpbmcgQ0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw # ggIKAoICAQDIGwGv2Sx+iJl9AZg/IJC9nIAhVJO5z6A+U++zWsB21hoEpc5Hg7Xr # xMxJNMvzRWW5+adkFiYJ+9UyUnkuyWPCE5u2hj8BBZJmbyGr1XEQeYf0RirNxFrJ # 29ddSU1yVg/cyeNTmDoqHvzOWEnTv/M5u7mkI0Ks0BXDf56iXNc48RaycNOjxN+z # xXKsLgp3/A2UUrf8H5VzJD0BKLwPDU+zkQGObp0ndVXRFzs0IXuXAZSvf4DP0REK # V4TJf1bgvUacgr6Unb+0ILBgfrhN9Q0/29DqhYyKVnHRLZRMyIw80xSinL0m/9NT # IMdgaZtYClT0Bef9Maz5yIUXx7gpGaQpL0bj3duRX58/Nj4OMGcrRrc1r5a+2kxg # zKi7nw0U1BjEMJh0giHPYla1IXMSHv2qyghYh3ekFesZVf/QOVQtJu5FGjpvzdeE # 8NfwKMVPZIMC1Pvi3vG8Aij0bdonigbSlofe6GsO8Ft96XZpkyAcSpcsdxkrk5WY # nJee647BeFbGRCXfBhKaBi2fA179g6JTZ8qx+o2hZMmIklnLqEbAyfKm/31X2xJ2 # +opBJNQb/HKlFKLUrUMcpEmLQTkUAx4p+hulIq6lw02C0I3aa7fb9xhAV3PwcaP7 # Sn1FNsH3jYL6uckNU4B9+rY5WDLvbxhQiddPnTO9GrWdod6VQXqngwIDAQABo4IB # WjCCAVYwHwYDVR0jBBgwFoAUU3m/WqorSs9UgOHYm8Cd8rIDZsswHQYDVR0OBBYE # FBqh+GEZIA/DQXdFKI7RNV8GEgRVMA4GA1UdDwEB/wQEAwIBhjASBgNVHRMBAf8E # CDAGAQH/AgEAMBMGA1UdJQQMMAoGCCsGAQUFBwMIMBEGA1UdIAQKMAgwBgYEVR0g # ADBQBgNVHR8ESTBHMEWgQ6BBhj9odHRwOi8vY3JsLnVzZXJ0cnVzdC5jb20vVVNF # UlRydXN0UlNBQ2VydGlmaWNhdGlvbkF1dGhvcml0eS5jcmwwdgYIKwYBBQUHAQEE # ajBoMD8GCCsGAQUFBzAChjNodHRwOi8vY3J0LnVzZXJ0cnVzdC5jb20vVVNFUlRy # dXN0UlNBQWRkVHJ1c3RDQS5jcnQwJQYIKwYBBQUHMAGGGWh0dHA6Ly9vY3NwLnVz # ZXJ0cnVzdC5jb20wDQYJKoZIhvcNAQEMBQADggIBAG1UgaUzXRbhtVOBkXXfA3oy # Cy0lhBGysNsqfSoF9bw7J/RaoLlJWZApbGHLtVDb4n35nwDvQMOt0+LkVvlYQc/x # QuUQff+wdB+PxlwJ+TNe6qAcJlhc87QRD9XVw+K81Vh4v0h24URnbY+wQxAPjeT5 # OGK/EwHFhaNMxcyyUzCVpNb0llYIuM1cfwGWvnJSajtCN3wWeDmTk5SbsdyybUFt # Z83Jb5A9f0VywRsj1sJVhGbks8VmBvbz1kteraMrQoohkv6ob1olcGKBc2NeoLvY # 3NdK0z2vgwY4Eh0khy3k/ALWPncEvAQ2ted3y5wujSMYuaPCRx3wXdahc1cFaJqn # yTdlHb7qvNhCg0MFpYumCf/RoZSmTqo9CfUFbLfSZFrYKiLCS53xOV5M3kg9mzSW # mglfjv33sVKRzj+J9hyhtal1H3G/W0NdZT1QgW6r8NDT/LKzH7aZlib0PHmLXGTM # ze4nmuWgwAxyh8FuTVrTHurwROYybxzrF06Uw3hlIDsPQaof6aFBnf6xuKBlKjTg # 3qj5PObBMLvAoGMs/FwWAKjQxH/qEZ0eBsambTJdtDgJK0kHqv3sMNrxpy/Pt/36 # 0KOE2See+wFmd7lWEOEgbsausfm2usg1XTN2jvF8IAwqd661ogKGuinutFoAsYyr # 4/kKyVRd1LlqdJ69SK6YMIIG9TCCBN2gAwIBAgIQOUwl4XygbSeoZeI72R0i1DAN # BgkqhkiG9w0BAQwFADB9MQswCQYDVQQGEwJHQjEbMBkGA1UECBMSR3JlYXRlciBN # YW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRgwFgYDVQQKEw9TZWN0aWdvIExp # bWl0ZWQxJTAjBgNVBAMTHFNlY3RpZ28gUlNBIFRpbWUgU3RhbXBpbmcgQ0EwHhcN # MjMwNTAzMDAwMDAwWhcNMzQwODAyMjM1OTU5WjBqMQswCQYDVQQGEwJHQjETMBEG # A1UECBMKTWFuY2hlc3RlcjEYMBYGA1UEChMPU2VjdGlnbyBMaW1pdGVkMSwwKgYD # VQQDDCNTZWN0aWdvIFJTQSBUaW1lIFN0YW1waW5nIFNpZ25lciAjNDCCAiIwDQYJ # KoZIhvcNAQEBBQADggIPADCCAgoCggIBAKSTKFJLzyeHdqQpHJk4wOcO1NEc7GjL # AWTkis13sHFlgryf/Iu7u5WY+yURjlqICWYRFFiyuiJb5vYy8V0twHqiDuDgVmTt # oeWBIHIgZEFsx8MI+vN9Xe8hmsJ+1yzDuhGYHvzTIAhCs1+/f4hYMqsws9iMepZK # GRNcrPznq+kcFi6wsDiVSs+FUKtnAyWhuzjpD2+pWpqRKBM1uR/zPeEkyGuxmegN # 77tN5T2MVAOR0Pwtz1UzOHoJHAfRIuBjhqe+/dKDcxIUm5pMCUa9NLzhS1B7cuBb # /Rm7HzxqGXtuuy1EKr48TMysigSTxleGoHM2K4GX+hubfoiH2FJ5if5udzfXu1Cf # +hglTxPyXnypsSBaKaujQod34PRMAkjdWKVTpqOg7RmWZRUpxe0zMCXmloOBmvZg # ZpBYB4DNQnWs+7SR0MXdAUBqtqgQ7vaNereeda/TpUsYoQyfV7BeJUeRdM11EtGc # b+ReDZvsdSbu/tP1ki9ShejaRFEqoswAyodmQ6MbAO+itZadYq0nC/IbSsnDlEI3 # iCCEqIeuw7ojcnv4VO/4ayewhfWnQ4XYKzl021p3AtGk+vXNnD3MH65R0Hts2B0t # EUJTcXTC5TWqLVIS2SXP8NPQkUMS1zJ9mGzjd0HI/x8kVO9urcY+VXvxXIc6ZPFg # SwVP77kv7AkTAgMBAAGjggGCMIIBfjAfBgNVHSMEGDAWgBQaofhhGSAPw0F3RSiO # 0TVfBhIEVTAdBgNVHQ4EFgQUAw8xyJEqk71j89FdTaQ0D9KVARgwDgYDVR0PAQH/ # BAQDAgbAMAwGA1UdEwEB/wQCMAAwFgYDVR0lAQH/BAwwCgYIKwYBBQUHAwgwSgYD # VR0gBEMwQTA1BgwrBgEEAbIxAQIBAwgwJTAjBggrBgEFBQcCARYXaHR0cHM6Ly9z # ZWN0aWdvLmNvbS9DUFMwCAYGZ4EMAQQCMEQGA1UdHwQ9MDswOaA3oDWGM2h0dHA6 # Ly9jcmwuc2VjdGlnby5jb20vU2VjdGlnb1JTQVRpbWVTdGFtcGluZ0NBLmNybDB0 # BggrBgEFBQcBAQRoMGYwPwYIKwYBBQUHMAKGM2h0dHA6Ly9jcnQuc2VjdGlnby5j # b20vU2VjdGlnb1JTQVRpbWVTdGFtcGluZ0NBLmNydDAjBggrBgEFBQcwAYYXaHR0 # cDovL29jc3Auc2VjdGlnby5jb20wDQYJKoZIhvcNAQEMBQADggIBAEybZVj64HnP # 7xXDMm3eM5Hrd1ji673LSjx13n6UbcMixwSV32VpYRMM9gye9YkgXsGHxwMkysel # 8Cbf+PgxZQ3g621RV6aMhFIIRhwqwt7y2opF87739i7Efu347Wi/elZI6WHlmjl3 # vL66kWSIdf9dhRY0J9Ipy//tLdr/vpMM7G2iDczD8W69IZEaIwBSrZfUYngqhHmo # 1z2sIY9wwyR5OpfxDaOjW1PYqwC6WPs1gE9fKHFsGV7Cg3KQruDG2PKZ++q0kmV8 # B3w1RB2tWBhrYvvebMQKqWzTIUZw3C+NdUwjwkHQepY7w0vdzZImdHZcN6CaJJ5O # X07Tjw/lE09ZRGVLQ2TPSPhnZ7lNv8wNsTow0KE9SK16ZeTs3+AB8LMqSjmswaT5 # qX010DJAoLEZKhghssh9BXEaSyc2quCYHIN158d+S4RDzUP7kJd2KhKsQMFwW5kK # QPqAbZRhe8huuchnZyRcUI0BIN4H9wHU+C4RzZ2D5fjKJRxEPSflsIZHKgsbhHZ9 # e2hPjbf3E7TtoC3ucw/ZELqdmSx813UfjxDElOZ+JOWVSoiMJ9aFZh35rmR2kehI # /shVCu0pwx/eOKbAFPsyPfipg2I2yMO+AIccq/pKQhyJA9z1XHxw2V14Tu6fXiDm # CWp8KwijSPUV/ARP380hHHrl9Y4a1LlAMYIFkjCCBY4CAQEwgZAwfDELMAkGA1UE # BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2Fs # Zm9yZDEYMBYGA1UEChMPU2VjdGlnbyBMaW1pdGVkMSQwIgYDVQQDExtTZWN0aWdv # IFJTQSBDb2RlIFNpZ25pbmcgQ0ECECwnTfNkELSL/bju5S9Y3lMwDQYJYIZIAWUD # BAIBBQCggYQwGAYKKwYBBAGCNwIBDDEKMAigAoAAoQKAADAZBgkqhkiG9w0BCQMx # DAYKKwYBBAGCNwIBBDAcBgorBgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkq # hkiG9w0BCQQxIgQg5+erWEJPPPNMv7e/5EEtnZ4wxLqDsskkKhBtr9A6irwwDQYJ # KoZIhvcNAQEBBQAEggEAkom6a6lcsyRJqmyNMz5vZtBmNixYb/M4ruSa0xf6VRH8 # bBwMqyZOX3Yf5kEsDF9/I49NEDUVuBhl7alLJnw/YAgVWH38l+kQviYO4/IT+uiQ # 5ZDrHzpJu9v0iKKYO4E0z66iS1vrFLqB4BcbeEn59sUJQkjUhAnE6RXFMWg6gxtb # XEQKgvhPi0T2GTPI1+2OMRKAAYt8N4PuZJ4Aaoor73LwMmBkrM13TJ+c4AeCGsPg # vW+U5+yo30DyC+18KuYOfDJqajuOKNr9TFaROZQEc1RXtaRIo1nw8xLeTpms/nUd # xE6WgdlWd81dTq/++lXowk0hb8aMzI2k1lSGiRuOK6GCA0swggNHBgkqhkiG9w0B # CQYxggM4MIIDNAIBATCBkTB9MQswCQYDVQQGEwJHQjEbMBkGA1UECBMSR3JlYXRl # ciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRgwFgYDVQQKEw9TZWN0aWdv # IExpbWl0ZWQxJTAjBgNVBAMTHFNlY3RpZ28gUlNBIFRpbWUgU3RhbXBpbmcgQ0EC # EDlMJeF8oG0nqGXiO9kdItQwDQYJYIZIAWUDBAICBQCgeTAYBgkqhkiG9w0BCQMx # CwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0yMzExMjAyMDQyNTVaMD8GCSqG # SIb3DQEJBDEyBDAov3Tcd/0cRriRz2b1PrBpain52E4do68LTjsB085TLSoPPoxv # QIVJiTPwP+IATmUwDQYJKoZIhvcNAQEBBQAEggIAgJghAzfKhEHAaz2jotx0c5Nq # 7maLclNVfuwiDkvMQyB+NQs97jvmwOJR0m1HCsIEJxCzUC5F3OukOW1u9qQany8S # y/XyHirv585TNAsrT7xANaxF89EtU/Dy+Zbe/IZ2koqw8fCH/sGlc8wjeKzLlrYN # 13N6fBK2A7KcD942hMi+gXr+DpTLrskY7ttrgE/EtucfI5i1ESN+rmJRz99B0kZI # SSbt+CEm2vtEQBjJM2WDIuSnETHBq1KT6dkpyu7SDcG0osnjHHsvpYoB35NLW1JD # Sk7ULQ1HvwF5XgUBz7T3rQbVTJCQrE+0qTkZ/92yeGs39CAHYrAhMxkzsD1zIcqN # Wt0rIYMgJfHZyo8inAAdSAchhoa46cz2LjtqQIoXy5d0dK8JFfb44Yugrl54gy37 # Q+v4PWNyqmAj1qT1wMkVGArjP8s0a/2Kj26ro8IJ3RVL68NN+h3X3uGkao2LNXJx # SCXYo1CUh+Gt6MAz5FQ11Z8vMLQYvKe7SZUohuc9j+cyQD8bFuXPlQl5GC9wZ1ho # pQvciU14xx+6FCiX5wniBN4HKk412jPGYSHw8JIK22Gm2BQpQNho/BeTfTb0Yfwg # Dh/jDEFdsAMwCMTXTRMBa3BhRuhqQevyuI9zQL7JkLXSCUAYvSVRW+Y4SFpOfZJs # JVcXav4Rvocetw8vlgE= # SIG # End signature block |