Public/ns-functions-config-vpn.ps1
function Invoke-NSAddVpnalwaysonprofile { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for AlwyasON profile resource. .PARAMETER Name name of AlwaysON profile. .PARAMETER Networkaccessonvpnfailure Option to block network traffic when tunnel is not established(and the config requires that tunnel be established). When set to onlyToGateway, the network traffic to and from the client (except Gateway IP) is blocked. When set to fullAccess, the network traffic is not blocked. Possible values = onlyToGateway, fullAccess .PARAMETER Clientcontrol Allow/Deny user to log off and connect to another Gateway. Possible values = ALLOW, DENY .PARAMETER Locationbasedvpn Option to decide if tunnel should be established when in enterprise network. When locationBasedVPN is remote, client tries to detect if it is located in enterprise network or not and establishes the tunnel if not in enterprise network. Dns suffixes configured using -add dns suffix- are used to decide if the client is in the enterprise network or not. If the resolution of the DNS suffix results in private IP, client is said to be in enterprise network. When set to EveryWhere, the client skips the check to detect if it is on the enterprise network and tries to establish the tunnel. Possible values = Remote, Everywhere .PARAMETER PassThru Return details about the created vpnalwaysonprofile item. .EXAMPLE PS C:\>Invoke-NSAddVpnalwaysonprofile -name <string> An example how to add vpnalwaysonprofile config Object(s). .NOTES File Name : Invoke-NSAddVpnalwaysonprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnalwaysonprofile/ Requires : PowerShell v5.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('onlyToGateway', 'fullAccess')] [string]$Networkaccessonvpnfailure = 'fullAccess', [ValidateSet('ALLOW', 'DENY')] [string]$Clientcontrol = 'DENY', [ValidateSet('Remote', 'Everywhere')] [string]$Locationbasedvpn = 'Remote', [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnalwaysonprofile: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('networkaccessonvpnfailure') ) { $payload.Add('networkaccessonvpnfailure', $networkaccessonvpnfailure) } if ( $PSBoundParameters.ContainsKey('clientcontrol') ) { $payload.Add('clientcontrol', $clientcontrol) } if ( $PSBoundParameters.ContainsKey('locationbasedvpn') ) { $payload.Add('locationbasedvpn', $locationbasedvpn) } if ( $PSCmdlet.ShouldProcess("vpnalwaysonprofile", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type vpnalwaysonprofile -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-NSGetVpnalwaysonprofile -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnalwaysonprofile: Finished" } } function Invoke-NSDeleteVpnalwaysonprofile { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for AlwyasON profile resource. .PARAMETER Name name of AlwaysON profile. .EXAMPLE PS C:\>Invoke-NSDeleteVpnalwaysonprofile -Name <string> An example how to delete vpnalwaysonprofile config Object(s). .NOTES File Name : Invoke-NSDeleteVpnalwaysonprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnalwaysonprofile/ Requires : PowerShell v5.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-NSDeleteVpnalwaysonprofile: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnalwaysonprofile -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-NSDeleteVpnalwaysonprofile: Finished" } } function Invoke-NSUpdateVpnalwaysonprofile { <# .SYNOPSIS Update Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for AlwyasON profile resource. .PARAMETER Name name of AlwaysON profile. .PARAMETER Networkaccessonvpnfailure Option to block network traffic when tunnel is not established(and the config requires that tunnel be established). When set to onlyToGateway, the network traffic to and from the client (except Gateway IP) is blocked. When set to fullAccess, the network traffic is not blocked. Possible values = onlyToGateway, fullAccess .PARAMETER Clientcontrol Allow/Deny user to log off and connect to another Gateway. Possible values = ALLOW, DENY .PARAMETER Locationbasedvpn Option to decide if tunnel should be established when in enterprise network. When locationBasedVPN is remote, client tries to detect if it is located in enterprise network or not and establishes the tunnel if not in enterprise network. Dns suffixes configured using -add dns suffix- are used to decide if the client is in the enterprise network or not. If the resolution of the DNS suffix results in private IP, client is said to be in enterprise network. When set to EveryWhere, the client skips the check to detect if it is on the enterprise network and tries to establish the tunnel. Possible values = Remote, Everywhere .PARAMETER PassThru Return details about the created vpnalwaysonprofile item. .EXAMPLE PS C:\>Invoke-NSUpdateVpnalwaysonprofile -name <string> An example how to update vpnalwaysonprofile config Object(s). .NOTES File Name : Invoke-NSUpdateVpnalwaysonprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnalwaysonprofile/ Requires : PowerShell v5.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('onlyToGateway', 'fullAccess')] [string]$Networkaccessonvpnfailure, [ValidateSet('ALLOW', 'DENY')] [string]$Clientcontrol, [ValidateSet('Remote', 'Everywhere')] [string]$Locationbasedvpn, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateVpnalwaysonprofile: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('networkaccessonvpnfailure') ) { $payload.Add('networkaccessonvpnfailure', $networkaccessonvpnfailure) } if ( $PSBoundParameters.ContainsKey('clientcontrol') ) { $payload.Add('clientcontrol', $clientcontrol) } if ( $PSBoundParameters.ContainsKey('locationbasedvpn') ) { $payload.Add('locationbasedvpn', $locationbasedvpn) } if ( $PSCmdlet.ShouldProcess("vpnalwaysonprofile", "Update Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnalwaysonprofile -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-NSGetVpnalwaysonprofile -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateVpnalwaysonprofile: Finished" } } function Invoke-NSUnsetVpnalwaysonprofile { <# .SYNOPSIS Unset Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for AlwyasON profile resource. .PARAMETER Name name of AlwaysON profile. .PARAMETER Networkaccessonvpnfailure Option to block network traffic when tunnel is not established(and the config requires that tunnel be established). When set to onlyToGateway, the network traffic to and from the client (except Gateway IP) is blocked. When set to fullAccess, the network traffic is not blocked. Possible values = onlyToGateway, fullAccess .PARAMETER Clientcontrol Allow/Deny user to log off and connect to another Gateway. Possible values = ALLOW, DENY .PARAMETER Locationbasedvpn Option to decide if tunnel should be established when in enterprise network. When locationBasedVPN is remote, client tries to detect if it is located in enterprise network or not and establishes the tunnel if not in enterprise network. Dns suffixes configured using -add dns suffix- are used to decide if the client is in the enterprise network or not. If the resolution of the DNS suffix results in private IP, client is said to be in enterprise network. When set to EveryWhere, the client skips the check to detect if it is on the enterprise network and tries to establish the tunnel. Possible values = Remote, Everywhere .EXAMPLE PS C:\>Invoke-NSUnsetVpnalwaysonprofile -name <string> An example how to unset vpnalwaysonprofile config Object(s). .NOTES File Name : Invoke-NSUnsetVpnalwaysonprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnalwaysonprofile Requires : PowerShell v5.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]$networkaccessonvpnfailure, [Boolean]$clientcontrol, [Boolean]$locationbasedvpn ) begin { Write-Verbose "Invoke-NSUnsetVpnalwaysonprofile: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('networkaccessonvpnfailure') ) { $payload.Add('networkaccessonvpnfailure', $networkaccessonvpnfailure) } if ( $PSBoundParameters.ContainsKey('clientcontrol') ) { $payload.Add('clientcontrol', $clientcontrol) } if ( $PSBoundParameters.ContainsKey('locationbasedvpn') ) { $payload.Add('locationbasedvpn', $locationbasedvpn) } if ( $PSCmdlet.ShouldProcess("$name", "Unset Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type vpnalwaysonprofile -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-NSUnsetVpnalwaysonprofile: Finished" } } function Invoke-NSGetVpnalwaysonprofile { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Configuration for AlwyasON profile resource. .PARAMETER Name name of AlwaysON profile. .PARAMETER GetAll Retrieve all vpnalwaysonprofile object(s). .PARAMETER Count If specified, the count of the vpnalwaysonprofile 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-NSGetVpnalwaysonprofile Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnalwaysonprofile -GetAll Get all vpnalwaysonprofile data. .EXAMPLE PS C:\>Invoke-NSGetVpnalwaysonprofile -Count Get the number of vpnalwaysonprofile objects. .EXAMPLE PS C:\>Invoke-NSGetVpnalwaysonprofile -name <string> Get vpnalwaysonprofile object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnalwaysonprofile -Filter @{ 'name'='<value>' } Get vpnalwaysonprofile data with a filter. .NOTES File Name : Invoke-NSGetVpnalwaysonprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnalwaysonprofile/ Requires : PowerShell v5.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-NSGetVpnalwaysonprofile: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all vpnalwaysonprofile objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnalwaysonprofile -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 vpnalwaysonprofile objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnalwaysonprofile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnalwaysonprofile objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnalwaysonprofile -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnalwaysonprofile configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnalwaysonprofile -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnalwaysonprofile configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnalwaysonprofile -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-NSGetVpnalwaysonprofile: Ended" } } function Invoke-NSAddVpnclientlessaccesspolicy { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for Clientless VPN rewrite policy resource. .PARAMETER Name Name of the new clientless access policy. .PARAMETER Rule Expression, or name of a named expression, specifying the traffic that matches the policy. The following requirements apply only to the Citrix ADC CLI: * If the expression includes one or more spaces, enclose the entire expression in double quotation marks. * If the expression itself includes double quotation marks, escape the quotations by using the \ character. * Alternatively, you can use single quotation marks to enclose the rule, in which case you do not have to escape the double quotation marks. .PARAMETER Profilename Name of the profile to invoke for the clientless access. .PARAMETER PassThru Return details about the created vpnclientlessaccesspolicy item. .EXAMPLE PS C:\>Invoke-NSAddVpnclientlessaccesspolicy -name <string> -rule <string> -profilename <string> An example how to add vpnclientlessaccesspolicy config Object(s). .NOTES File Name : Invoke-NSAddVpnclientlessaccesspolicy Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnclientlessaccesspolicy/ Requires : PowerShell v5.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]$Rule, [Parameter(Mandatory)] [string]$Profilename, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnclientlessaccesspolicy: Starting" } process { try { $payload = @{ name = $name rule = $rule profilename = $profilename } if ( $PSCmdlet.ShouldProcess("vpnclientlessaccesspolicy", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type vpnclientlessaccesspolicy -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-NSGetVpnclientlessaccesspolicy -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnclientlessaccesspolicy: Finished" } } function Invoke-NSDeleteVpnclientlessaccesspolicy { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for Clientless VPN rewrite policy resource. .PARAMETER Name Name of the new clientless access policy. .EXAMPLE PS C:\>Invoke-NSDeleteVpnclientlessaccesspolicy -Name <string> An example how to delete vpnclientlessaccesspolicy config Object(s). .NOTES File Name : Invoke-NSDeleteVpnclientlessaccesspolicy Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnclientlessaccesspolicy/ Requires : PowerShell v5.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-NSDeleteVpnclientlessaccesspolicy: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnclientlessaccesspolicy -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-NSDeleteVpnclientlessaccesspolicy: Finished" } } function Invoke-NSUpdateVpnclientlessaccesspolicy { <# .SYNOPSIS Update Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for Clientless VPN rewrite policy resource. .PARAMETER Name Name of the new clientless access policy. .PARAMETER Rule Expression, or name of a named expression, specifying the traffic that matches the policy. The following requirements apply only to the Citrix ADC CLI: * If the expression includes one or more spaces, enclose the entire expression in double quotation marks. * If the expression itself includes double quotation marks, escape the quotations by using the \ character. * Alternatively, you can use single quotation marks to enclose the rule, in which case you do not have to escape the double quotation marks. .PARAMETER Profilename Name of the profile to invoke for the clientless access. .PARAMETER PassThru Return details about the created vpnclientlessaccesspolicy item. .EXAMPLE PS C:\>Invoke-NSUpdateVpnclientlessaccesspolicy -name <string> An example how to update vpnclientlessaccesspolicy config Object(s). .NOTES File Name : Invoke-NSUpdateVpnclientlessaccesspolicy Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnclientlessaccesspolicy/ Requires : PowerShell v5.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, [string]$Rule, [string]$Profilename, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateVpnclientlessaccesspolicy: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('rule') ) { $payload.Add('rule', $rule) } if ( $PSBoundParameters.ContainsKey('profilename') ) { $payload.Add('profilename', $profilename) } if ( $PSCmdlet.ShouldProcess("vpnclientlessaccesspolicy", "Update Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnclientlessaccesspolicy -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-NSGetVpnclientlessaccesspolicy -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateVpnclientlessaccesspolicy: Finished" } } function Invoke-NSGetVpnclientlessaccesspolicy { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Configuration for Clientless VPN rewrite policy resource. .PARAMETER Name Name of the new clientless access policy. .PARAMETER GetAll Retrieve all vpnclientlessaccesspolicy object(s). .PARAMETER Count If specified, the count of the vpnclientlessaccesspolicy 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-NSGetVpnclientlessaccesspolicy Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnclientlessaccesspolicy -GetAll Get all vpnclientlessaccesspolicy data. .EXAMPLE PS C:\>Invoke-NSGetVpnclientlessaccesspolicy -Count Get the number of vpnclientlessaccesspolicy objects. .EXAMPLE PS C:\>Invoke-NSGetVpnclientlessaccesspolicy -name <string> Get vpnclientlessaccesspolicy object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnclientlessaccesspolicy -Filter @{ 'name'='<value>' } Get vpnclientlessaccesspolicy data with a filter. .NOTES File Name : Invoke-NSGetVpnclientlessaccesspolicy Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnclientlessaccesspolicy/ Requires : PowerShell v5.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-NSGetVpnclientlessaccesspolicy: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all vpnclientlessaccesspolicy objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnclientlessaccesspolicy -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 vpnclientlessaccesspolicy objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnclientlessaccesspolicy -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnclientlessaccesspolicy objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnclientlessaccesspolicy -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnclientlessaccesspolicy configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnclientlessaccesspolicy -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnclientlessaccesspolicy configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnclientlessaccesspolicy -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-NSGetVpnclientlessaccesspolicy: Ended" } } function Invoke-NSGetVpnclientlessaccesspolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object which returns the resources bound to vpnclientlessaccesspolicy. .PARAMETER Name Name of the clientless access policy to display. .PARAMETER GetAll Retrieve all vpnclientlessaccesspolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnclientlessaccesspolicy_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-NSGetVpnclientlessaccesspolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnclientlessaccesspolicyBinding -GetAll Get all vpnclientlessaccesspolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnclientlessaccesspolicyBinding -name <string> Get vpnclientlessaccesspolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnclientlessaccesspolicyBinding -Filter @{ 'name'='<value>' } Get vpnclientlessaccesspolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnclientlessaccesspolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnclientlessaccesspolicy_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-NSGetVpnclientlessaccesspolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnclientlessaccesspolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnclientlessaccesspolicy_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 vpnclientlessaccesspolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnclientlessaccesspolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnclientlessaccesspolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnclientlessaccesspolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnclientlessaccesspolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnclientlessaccesspolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnclientlessaccesspolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnclientlessaccesspolicy_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-NSGetVpnclientlessaccesspolicyBinding: Ended" } } function Invoke-NSGetVpnclientlessaccesspolicyVpnglobalBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the vpnglobal that can be bound to vpnclientlessaccesspolicy. .PARAMETER Name Name of the clientless access policy to display. .PARAMETER GetAll Retrieve all vpnclientlessaccesspolicy_vpnglobal_binding object(s). .PARAMETER Count If specified, the count of the vpnclientlessaccesspolicy_vpnglobal_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-NSGetVpnclientlessaccesspolicyVpnglobalBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnclientlessaccesspolicyVpnglobalBinding -GetAll Get all vpnclientlessaccesspolicy_vpnglobal_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnclientlessaccesspolicyVpnglobalBinding -Count Get the number of vpnclientlessaccesspolicy_vpnglobal_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnclientlessaccesspolicyVpnglobalBinding -name <string> Get vpnclientlessaccesspolicy_vpnglobal_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnclientlessaccesspolicyVpnglobalBinding -Filter @{ 'name'='<value>' } Get vpnclientlessaccesspolicy_vpnglobal_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnclientlessaccesspolicyVpnglobalBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnclientlessaccesspolicy_vpnglobal_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-NSGetVpnclientlessaccesspolicyVpnglobalBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnclientlessaccesspolicy_vpnglobal_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnclientlessaccesspolicy_vpnglobal_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 vpnclientlessaccesspolicy_vpnglobal_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnclientlessaccesspolicy_vpnglobal_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnclientlessaccesspolicy_vpnglobal_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnclientlessaccesspolicy_vpnglobal_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnclientlessaccesspolicy_vpnglobal_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnclientlessaccesspolicy_vpnglobal_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnclientlessaccesspolicy_vpnglobal_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnclientlessaccesspolicy_vpnglobal_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-NSGetVpnclientlessaccesspolicyVpnglobalBinding: Ended" } } function Invoke-NSGetVpnclientlessaccesspolicyVpnvserverBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the vpnvserver that can be bound to vpnclientlessaccesspolicy. .PARAMETER Name Name of the clientless access policy to display. .PARAMETER GetAll Retrieve all vpnclientlessaccesspolicy_vpnvserver_binding object(s). .PARAMETER Count If specified, the count of the vpnclientlessaccesspolicy_vpnvserver_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-NSGetVpnclientlessaccesspolicyVpnvserverBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnclientlessaccesspolicyVpnvserverBinding -GetAll Get all vpnclientlessaccesspolicy_vpnvserver_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnclientlessaccesspolicyVpnvserverBinding -Count Get the number of vpnclientlessaccesspolicy_vpnvserver_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnclientlessaccesspolicyVpnvserverBinding -name <string> Get vpnclientlessaccesspolicy_vpnvserver_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnclientlessaccesspolicyVpnvserverBinding -Filter @{ 'name'='<value>' } Get vpnclientlessaccesspolicy_vpnvserver_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnclientlessaccesspolicyVpnvserverBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnclientlessaccesspolicy_vpnvserver_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-NSGetVpnclientlessaccesspolicyVpnvserverBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnclientlessaccesspolicy_vpnvserver_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnclientlessaccesspolicy_vpnvserver_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 vpnclientlessaccesspolicy_vpnvserver_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnclientlessaccesspolicy_vpnvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnclientlessaccesspolicy_vpnvserver_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnclientlessaccesspolicy_vpnvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnclientlessaccesspolicy_vpnvserver_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnclientlessaccesspolicy_vpnvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnclientlessaccesspolicy_vpnvserver_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnclientlessaccesspolicy_vpnvserver_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-NSGetVpnclientlessaccesspolicyVpnvserverBinding: Ended" } } function Invoke-NSAddVpnclientlessaccessprofile { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for Clientless VPN rewrite profile resource. .PARAMETER Profilename Name for the Citrix Gateway clientless access profile. Must begin with an ASCII alphabetic or underscore (_) character, and must consist only of ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the profile is created. .PARAMETER PassThru Return details about the created vpnclientlessaccessprofile item. .EXAMPLE PS C:\>Invoke-NSAddVpnclientlessaccessprofile -profilename <string> An example how to add vpnclientlessaccessprofile config Object(s). .NOTES File Name : Invoke-NSAddVpnclientlessaccessprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnclientlessaccessprofile/ Requires : PowerShell v5.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]$Profilename, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnclientlessaccessprofile: Starting" } process { try { $payload = @{ profilename = $profilename } if ( $PSCmdlet.ShouldProcess("vpnclientlessaccessprofile", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type vpnclientlessaccessprofile -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-NSGetVpnclientlessaccessprofile -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnclientlessaccessprofile: Finished" } } function Invoke-NSDeleteVpnclientlessaccessprofile { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for Clientless VPN rewrite profile resource. .PARAMETER Profilename Name for the Citrix Gateway clientless access profile. Must begin with an ASCII alphabetic or underscore (_) character, and must consist only of ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the profile is created. .EXAMPLE PS C:\>Invoke-NSDeleteVpnclientlessaccessprofile -Profilename <string> An example how to delete vpnclientlessaccessprofile config Object(s). .NOTES File Name : Invoke-NSDeleteVpnclientlessaccessprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnclientlessaccessprofile/ Requires : PowerShell v5.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]$Profilename ) begin { Write-Verbose "Invoke-NSDeleteVpnclientlessaccessprofile: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$profilename", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnclientlessaccessprofile -NitroPath nitro/v1/config -Resource $profilename -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-NSDeleteVpnclientlessaccessprofile: Finished" } } function Invoke-NSUpdateVpnclientlessaccessprofile { <# .SYNOPSIS Update Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for Clientless VPN rewrite profile resource. .PARAMETER Profilename Name for the Citrix Gateway clientless access profile. Must begin with an ASCII alphabetic or underscore (_) character, and must consist only of ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the profile is created. .PARAMETER Urlrewritepolicylabel Name of the configured URL rewrite policy label. If you do not specify a policy label name, then URLs are not rewritten. .PARAMETER Javascriptrewritepolicylabel Name of the configured JavaScript rewrite policy label. If you do not specify a policy label name, then JAVA scripts are not rewritten. .PARAMETER Reqhdrrewritepolicylabel Name of the configured Request rewrite policy label. If you do not specify a policy label name, then requests are not rewritten. .PARAMETER Reshdrrewritepolicylabel Name of the configured Response rewrite policy label. .PARAMETER Regexforfindingurlinjavascript Name of the pattern set that contains the regular expressions, which match the URL in Java script. .PARAMETER Regexforfindingurlincss Name of the pattern set that contains the regular expressions, which match the URL in the CSS. .PARAMETER Regexforfindingurlinxcomponent Name of the pattern set that contains the regular expressions, which match the URL in X Component. .PARAMETER Regexforfindingurlinxml Name of the pattern set that contains the regular expressions, which match the URL in XML. .PARAMETER Regexforfindingcustomurls Name of the pattern set that contains the regular expressions, which match the URLs in the custom content type other than HTML, CSS, XML, XCOMP, and JavaScript. The custom content type should be included in the patset ns_cvpn_custom_content_types. .PARAMETER Clientconsumedcookies Specify the name of the pattern set containing the names of the cookies, which are allowed between the client and the server. If a pattern set is not specified, Citrix Gateway does not allow any cookies between the client and the server. A cookie that is not specified in the pattern set is handled by Citrix Gateway on behalf of the client. .PARAMETER Requirepersistentcookie Specify whether a persistent session cookie is set and accepted for clientless access. If this parameter is set to ON, COM objects, such as MSOffice, which are invoked by the browser can access the files using clientless access. Use caution because the persistent cookie is stored on the disk. Possible values = ON, OFF .PARAMETER PassThru Return details about the created vpnclientlessaccessprofile item. .EXAMPLE PS C:\>Invoke-NSUpdateVpnclientlessaccessprofile -profilename <string> An example how to update vpnclientlessaccessprofile config Object(s). .NOTES File Name : Invoke-NSUpdateVpnclientlessaccessprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnclientlessaccessprofile/ Requires : PowerShell v5.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]$Profilename, [ValidateScript({ $_.Length -gt 1 })] [string]$Urlrewritepolicylabel, [ValidateScript({ $_.Length -gt 1 })] [string]$Javascriptrewritepolicylabel, [ValidateScript({ $_.Length -gt 1 })] [string]$Reqhdrrewritepolicylabel, [ValidateScript({ $_.Length -gt 1 })] [string]$Reshdrrewritepolicylabel, [ValidateScript({ $_.Length -gt 1 })] [string]$Regexforfindingurlinjavascript, [ValidateScript({ $_.Length -gt 1 })] [string]$Regexforfindingurlincss, [ValidateScript({ $_.Length -gt 1 })] [string]$Regexforfindingurlinxcomponent, [ValidateScript({ $_.Length -gt 1 })] [string]$Regexforfindingurlinxml, [ValidateScript({ $_.Length -gt 1 })] [string]$Regexforfindingcustomurls, [ValidateScript({ $_.Length -gt 1 })] [string]$Clientconsumedcookies, [ValidateSet('ON', 'OFF')] [string]$Requirepersistentcookie, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateVpnclientlessaccessprofile: Starting" } process { try { $payload = @{ profilename = $profilename } if ( $PSBoundParameters.ContainsKey('urlrewritepolicylabel') ) { $payload.Add('urlrewritepolicylabel', $urlrewritepolicylabel) } if ( $PSBoundParameters.ContainsKey('javascriptrewritepolicylabel') ) { $payload.Add('javascriptrewritepolicylabel', $javascriptrewritepolicylabel) } if ( $PSBoundParameters.ContainsKey('reqhdrrewritepolicylabel') ) { $payload.Add('reqhdrrewritepolicylabel', $reqhdrrewritepolicylabel) } if ( $PSBoundParameters.ContainsKey('reshdrrewritepolicylabel') ) { $payload.Add('reshdrrewritepolicylabel', $reshdrrewritepolicylabel) } if ( $PSBoundParameters.ContainsKey('regexforfindingurlinjavascript') ) { $payload.Add('regexforfindingurlinjavascript', $regexforfindingurlinjavascript) } if ( $PSBoundParameters.ContainsKey('regexforfindingurlincss') ) { $payload.Add('regexforfindingurlincss', $regexforfindingurlincss) } if ( $PSBoundParameters.ContainsKey('regexforfindingurlinxcomponent') ) { $payload.Add('regexforfindingurlinxcomponent', $regexforfindingurlinxcomponent) } if ( $PSBoundParameters.ContainsKey('regexforfindingurlinxml') ) { $payload.Add('regexforfindingurlinxml', $regexforfindingurlinxml) } if ( $PSBoundParameters.ContainsKey('regexforfindingcustomurls') ) { $payload.Add('regexforfindingcustomurls', $regexforfindingcustomurls) } if ( $PSBoundParameters.ContainsKey('clientconsumedcookies') ) { $payload.Add('clientconsumedcookies', $clientconsumedcookies) } if ( $PSBoundParameters.ContainsKey('requirepersistentcookie') ) { $payload.Add('requirepersistentcookie', $requirepersistentcookie) } if ( $PSCmdlet.ShouldProcess("vpnclientlessaccessprofile", "Update Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnclientlessaccessprofile -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-NSGetVpnclientlessaccessprofile -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateVpnclientlessaccessprofile: Finished" } } function Invoke-NSUnsetVpnclientlessaccessprofile { <# .SYNOPSIS Unset Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for Clientless VPN rewrite profile resource. .PARAMETER Profilename Name for the Citrix Gateway clientless access profile. Must begin with an ASCII alphabetic or underscore (_) character, and must consist only of ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the profile is created. .PARAMETER Urlrewritepolicylabel Name of the configured URL rewrite policy label. If you do not specify a policy label name, then URLs are not rewritten. .PARAMETER Javascriptrewritepolicylabel Name of the configured JavaScript rewrite policy label. If you do not specify a policy label name, then JAVA scripts are not rewritten. .PARAMETER Reqhdrrewritepolicylabel Name of the configured Request rewrite policy label. If you do not specify a policy label name, then requests are not rewritten. .PARAMETER Reshdrrewritepolicylabel Name of the configured Response rewrite policy label. .PARAMETER Regexforfindingurlinjavascript Name of the pattern set that contains the regular expressions, which match the URL in Java script. .PARAMETER Regexforfindingurlincss Name of the pattern set that contains the regular expressions, which match the URL in the CSS. .PARAMETER Regexforfindingurlinxcomponent Name of the pattern set that contains the regular expressions, which match the URL in X Component. .PARAMETER Regexforfindingurlinxml Name of the pattern set that contains the regular expressions, which match the URL in XML. .PARAMETER Regexforfindingcustomurls Name of the pattern set that contains the regular expressions, which match the URLs in the custom content type other than HTML, CSS, XML, XCOMP, and JavaScript. The custom content type should be included in the patset ns_cvpn_custom_content_types. .PARAMETER Clientconsumedcookies Specify the name of the pattern set containing the names of the cookies, which are allowed between the client and the server. If a pattern set is not specified, Citrix Gateway does not allow any cookies between the client and the server. A cookie that is not specified in the pattern set is handled by Citrix Gateway on behalf of the client. .PARAMETER Requirepersistentcookie Specify whether a persistent session cookie is set and accepted for clientless access. If this parameter is set to ON, COM objects, such as MSOffice, which are invoked by the browser can access the files using clientless access. Use caution because the persistent cookie is stored on the disk. Possible values = ON, OFF .EXAMPLE PS C:\>Invoke-NSUnsetVpnclientlessaccessprofile -profilename <string> An example how to unset vpnclientlessaccessprofile config Object(s). .NOTES File Name : Invoke-NSUnsetVpnclientlessaccessprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnclientlessaccessprofile Requires : PowerShell v5.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]$Profilename, [Boolean]$urlrewritepolicylabel, [Boolean]$javascriptrewritepolicylabel, [Boolean]$reqhdrrewritepolicylabel, [Boolean]$reshdrrewritepolicylabel, [Boolean]$regexforfindingurlinjavascript, [Boolean]$regexforfindingurlincss, [Boolean]$regexforfindingurlinxcomponent, [Boolean]$regexforfindingurlinxml, [Boolean]$regexforfindingcustomurls, [Boolean]$clientconsumedcookies, [Boolean]$requirepersistentcookie ) begin { Write-Verbose "Invoke-NSUnsetVpnclientlessaccessprofile: Starting" } process { try { $payload = @{ profilename = $profilename } if ( $PSBoundParameters.ContainsKey('urlrewritepolicylabel') ) { $payload.Add('urlrewritepolicylabel', $urlrewritepolicylabel) } if ( $PSBoundParameters.ContainsKey('javascriptrewritepolicylabel') ) { $payload.Add('javascriptrewritepolicylabel', $javascriptrewritepolicylabel) } if ( $PSBoundParameters.ContainsKey('reqhdrrewritepolicylabel') ) { $payload.Add('reqhdrrewritepolicylabel', $reqhdrrewritepolicylabel) } if ( $PSBoundParameters.ContainsKey('reshdrrewritepolicylabel') ) { $payload.Add('reshdrrewritepolicylabel', $reshdrrewritepolicylabel) } if ( $PSBoundParameters.ContainsKey('regexforfindingurlinjavascript') ) { $payload.Add('regexforfindingurlinjavascript', $regexforfindingurlinjavascript) } if ( $PSBoundParameters.ContainsKey('regexforfindingurlincss') ) { $payload.Add('regexforfindingurlincss', $regexforfindingurlincss) } if ( $PSBoundParameters.ContainsKey('regexforfindingurlinxcomponent') ) { $payload.Add('regexforfindingurlinxcomponent', $regexforfindingurlinxcomponent) } if ( $PSBoundParameters.ContainsKey('regexforfindingurlinxml') ) { $payload.Add('regexforfindingurlinxml', $regexforfindingurlinxml) } if ( $PSBoundParameters.ContainsKey('regexforfindingcustomurls') ) { $payload.Add('regexforfindingcustomurls', $regexforfindingcustomurls) } if ( $PSBoundParameters.ContainsKey('clientconsumedcookies') ) { $payload.Add('clientconsumedcookies', $clientconsumedcookies) } if ( $PSBoundParameters.ContainsKey('requirepersistentcookie') ) { $payload.Add('requirepersistentcookie', $requirepersistentcookie) } if ( $PSCmdlet.ShouldProcess("$profilename", "Unset Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type vpnclientlessaccessprofile -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-NSUnsetVpnclientlessaccessprofile: Finished" } } function Invoke-NSGetVpnclientlessaccessprofile { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Configuration for Clientless VPN rewrite profile resource. .PARAMETER Profilename Name for the Citrix Gateway clientless access profile. Must begin with an ASCII alphabetic or underscore (_) character, and must consist only of ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the profile is created. .PARAMETER GetAll Retrieve all vpnclientlessaccessprofile object(s). .PARAMETER Count If specified, the count of the vpnclientlessaccessprofile 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-NSGetVpnclientlessaccessprofile Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnclientlessaccessprofile -GetAll Get all vpnclientlessaccessprofile data. .EXAMPLE PS C:\>Invoke-NSGetVpnclientlessaccessprofile -Count Get the number of vpnclientlessaccessprofile objects. .EXAMPLE PS C:\>Invoke-NSGetVpnclientlessaccessprofile -name <string> Get vpnclientlessaccessprofile object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnclientlessaccessprofile -Filter @{ 'name'='<value>' } Get vpnclientlessaccessprofile data with a filter. .NOTES File Name : Invoke-NSGetVpnclientlessaccessprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnclientlessaccessprofile/ Requires : PowerShell v5.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]$Profilename, [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-NSGetVpnclientlessaccessprofile: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all vpnclientlessaccessprofile objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnclientlessaccessprofile -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 vpnclientlessaccessprofile objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnclientlessaccessprofile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnclientlessaccessprofile objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnclientlessaccessprofile -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnclientlessaccessprofile configuration for property 'profilename'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnclientlessaccessprofile -NitroPath nitro/v1/config -Resource $profilename -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnclientlessaccessprofile configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnclientlessaccessprofile -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-NSGetVpnclientlessaccessprofile: Ended" } } function Invoke-NSAddVpnepaprofile { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for Epa profile resource. .PARAMETER Name name of device profile. .PARAMETER Filename filename of the deviceprofile data xml. .PARAMETER Data deviceprofile data xml. .PARAMETER PassThru Return details about the created vpnepaprofile item. .EXAMPLE PS C:\>Invoke-NSAddVpnepaprofile -name <string> An example how to add vpnepaprofile config Object(s). .NOTES File Name : Invoke-NSAddVpnepaprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnepaprofile/ Requires : PowerShell v5.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]$Filename, [ValidateScript({ $_.Length -gt 1 })] [string]$Data, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnepaprofile: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('filename') ) { $payload.Add('filename', $filename) } if ( $PSBoundParameters.ContainsKey('data') ) { $payload.Add('data', $data) } if ( $PSCmdlet.ShouldProcess("vpnepaprofile", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type vpnepaprofile -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-NSGetVpnepaprofile -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnepaprofile: Finished" } } function Invoke-NSDeleteVpnepaprofile { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for Epa profile resource. .PARAMETER Name name of device profile. .EXAMPLE PS C:\>Invoke-NSDeleteVpnepaprofile -Name <string> An example how to delete vpnepaprofile config Object(s). .NOTES File Name : Invoke-NSDeleteVpnepaprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnepaprofile/ Requires : PowerShell v5.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-NSDeleteVpnepaprofile: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnepaprofile -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-NSDeleteVpnepaprofile: Finished" } } function Invoke-NSGetVpnepaprofile { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Configuration for Epa profile resource. .PARAMETER Name name of device profile. .PARAMETER GetAll Retrieve all vpnepaprofile object(s). .PARAMETER Count If specified, the count of the vpnepaprofile 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-NSGetVpnepaprofile Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnepaprofile -GetAll Get all vpnepaprofile data. .EXAMPLE PS C:\>Invoke-NSGetVpnepaprofile -Count Get the number of vpnepaprofile objects. .EXAMPLE PS C:\>Invoke-NSGetVpnepaprofile -name <string> Get vpnepaprofile object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnepaprofile -Filter @{ 'name'='<value>' } Get vpnepaprofile data with a filter. .NOTES File Name : Invoke-NSGetVpnepaprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnepaprofile/ Requires : PowerShell v5.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-NSGetVpnepaprofile: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all vpnepaprofile objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnepaprofile -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 vpnepaprofile objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnepaprofile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnepaprofile objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnepaprofile -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnepaprofile configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnepaprofile -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnepaprofile configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnepaprofile -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-NSGetVpnepaprofile: Ended" } } function Invoke-NSAddVpneula { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for EULA for vservers resource. .PARAMETER Name Name for the eula. .PARAMETER PassThru Return details about the created vpneula item. .EXAMPLE PS C:\>Invoke-NSAddVpneula -name <string> An example how to add vpneula config Object(s). .NOTES File Name : Invoke-NSAddVpneula Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpneula/ Requires : PowerShell v5.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, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpneula: Starting" } process { try { $payload = @{ name = $name } if ( $PSCmdlet.ShouldProcess("vpneula", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type vpneula -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-NSGetVpneula -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpneula: Finished" } } function Invoke-NSDeleteVpneula { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for EULA for vservers resource. .PARAMETER Name Name for the eula. .EXAMPLE PS C:\>Invoke-NSDeleteVpneula -Name <string> An example how to delete vpneula config Object(s). .NOTES File Name : Invoke-NSDeleteVpneula Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpneula/ Requires : PowerShell v5.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-NSDeleteVpneula: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpneula -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-NSDeleteVpneula: Finished" } } function Invoke-NSGetVpneula { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Configuration for EULA for vservers resource. .PARAMETER Name Name for the eula. .PARAMETER GetAll Retrieve all vpneula object(s). .PARAMETER Count If specified, the count of the vpneula 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-NSGetVpneula Get data. .EXAMPLE PS C:\>Invoke-NSGetVpneula -GetAll Get all vpneula data. .EXAMPLE PS C:\>Invoke-NSGetVpneula -Count Get the number of vpneula objects. .EXAMPLE PS C:\>Invoke-NSGetVpneula -name <string> Get vpneula object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpneula -Filter @{ 'name'='<value>' } Get vpneula data with a filter. .NOTES File Name : Invoke-NSGetVpneula Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpneula/ Requires : PowerShell v5.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-NSGetVpneula: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all vpneula objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpneula -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 vpneula objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpneula -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpneula objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpneula -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpneula configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpneula -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpneula configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpneula -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-NSGetVpneula: Ended" } } function Invoke-NSAddVpnformssoaction { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for Form sso action resource. .PARAMETER Name Name for the form based single sign-on profile. .PARAMETER Actionurl Root-relative URL to which the completed form is submitted. .PARAMETER Userfield Name of the form field in which the user types in the user ID. .PARAMETER Passwdfield Name of the form field in which the user types in the password. .PARAMETER Ssosuccessrule Expression that defines the criteria for SSO success. Expression such as checking for cookie in the response is a common example. .PARAMETER Namevaluepair Other name-value pair attributes to send to the server, in addition to sending the user name and password. Value names are separated by an ampersand (&), such as in name1=value1&name2=value2. .PARAMETER Responsesize Maximum number of bytes to allow in the response size. Specifies the number of bytes in the response to be parsed for extracting the forms. .PARAMETER Nvtype How to process the name-value pair. Available settings function as follows: * STATIC - The administrator-configured values are used. * DYNAMIC - The response is parsed, the form is extracted, and then submitted. Possible values = STATIC, DYNAMIC .PARAMETER Submitmethod HTTP method (GET or POST) used by the single sign-on form to send the logon credentials to the logon server. Possible values = GET, POST .PARAMETER PassThru Return details about the created vpnformssoaction item. .EXAMPLE PS C:\>Invoke-NSAddVpnformssoaction -name <string> -actionurl <string> -userfield <string> -passwdfield <string> -ssosuccessrule <string> An example how to add vpnformssoaction config Object(s). .NOTES File Name : Invoke-NSAddVpnformssoaction Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnformssoaction/ Requires : PowerShell v5.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]$Actionurl, [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Userfield, [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Passwdfield, [Parameter(Mandatory)] [string]$Ssosuccessrule, [string]$Namevaluepair, [double]$Responsesize = '8096', [ValidateSet('STATIC', 'DYNAMIC')] [string]$Nvtype = 'DYNAMIC', [ValidateSet('GET', 'POST')] [string]$Submitmethod = 'GET', [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnformssoaction: Starting" } process { try { $payload = @{ name = $name actionurl = $actionurl userfield = $userfield passwdfield = $passwdfield ssosuccessrule = $ssosuccessrule } if ( $PSBoundParameters.ContainsKey('namevaluepair') ) { $payload.Add('namevaluepair', $namevaluepair) } if ( $PSBoundParameters.ContainsKey('responsesize') ) { $payload.Add('responsesize', $responsesize) } if ( $PSBoundParameters.ContainsKey('nvtype') ) { $payload.Add('nvtype', $nvtype) } if ( $PSBoundParameters.ContainsKey('submitmethod') ) { $payload.Add('submitmethod', $submitmethod) } if ( $PSCmdlet.ShouldProcess("vpnformssoaction", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type vpnformssoaction -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-NSGetVpnformssoaction -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnformssoaction: Finished" } } function Invoke-NSDeleteVpnformssoaction { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for Form sso action resource. .PARAMETER Name Name for the form based single sign-on profile. .EXAMPLE PS C:\>Invoke-NSDeleteVpnformssoaction -Name <string> An example how to delete vpnformssoaction config Object(s). .NOTES File Name : Invoke-NSDeleteVpnformssoaction Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnformssoaction/ Requires : PowerShell v5.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-NSDeleteVpnformssoaction: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnformssoaction -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-NSDeleteVpnformssoaction: Finished" } } function Invoke-NSUpdateVpnformssoaction { <# .SYNOPSIS Update Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for Form sso action resource. .PARAMETER Name Name for the form based single sign-on profile. .PARAMETER Actionurl Root-relative URL to which the completed form is submitted. .PARAMETER Userfield Name of the form field in which the user types in the user ID. .PARAMETER Passwdfield Name of the form field in which the user types in the password. .PARAMETER Ssosuccessrule Expression that defines the criteria for SSO success. Expression such as checking for cookie in the response is a common example. .PARAMETER Responsesize Maximum number of bytes to allow in the response size. Specifies the number of bytes in the response to be parsed for extracting the forms. .PARAMETER Namevaluepair Other name-value pair attributes to send to the server, in addition to sending the user name and password. Value names are separated by an ampersand (&), such as in name1=value1&name2=value2. .PARAMETER Nvtype How to process the name-value pair. Available settings function as follows: * STATIC - The administrator-configured values are used. * DYNAMIC - The response is parsed, the form is extracted, and then submitted. Possible values = STATIC, DYNAMIC .PARAMETER Submitmethod HTTP method (GET or POST) used by the single sign-on form to send the logon credentials to the logon server. Possible values = GET, POST .PARAMETER PassThru Return details about the created vpnformssoaction item. .EXAMPLE PS C:\>Invoke-NSUpdateVpnformssoaction -name <string> An example how to update vpnformssoaction config Object(s). .NOTES File Name : Invoke-NSUpdateVpnformssoaction Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnformssoaction/ Requires : PowerShell v5.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]$Actionurl, [ValidateScript({ $_.Length -gt 1 })] [string]$Userfield, [ValidateScript({ $_.Length -gt 1 })] [string]$Passwdfield, [string]$Ssosuccessrule, [double]$Responsesize, [string]$Namevaluepair, [ValidateSet('STATIC', 'DYNAMIC')] [string]$Nvtype, [ValidateSet('GET', 'POST')] [string]$Submitmethod, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateVpnformssoaction: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('actionurl') ) { $payload.Add('actionurl', $actionurl) } if ( $PSBoundParameters.ContainsKey('userfield') ) { $payload.Add('userfield', $userfield) } if ( $PSBoundParameters.ContainsKey('passwdfield') ) { $payload.Add('passwdfield', $passwdfield) } if ( $PSBoundParameters.ContainsKey('ssosuccessrule') ) { $payload.Add('ssosuccessrule', $ssosuccessrule) } if ( $PSBoundParameters.ContainsKey('responsesize') ) { $payload.Add('responsesize', $responsesize) } if ( $PSBoundParameters.ContainsKey('namevaluepair') ) { $payload.Add('namevaluepair', $namevaluepair) } if ( $PSBoundParameters.ContainsKey('nvtype') ) { $payload.Add('nvtype', $nvtype) } if ( $PSBoundParameters.ContainsKey('submitmethod') ) { $payload.Add('submitmethod', $submitmethod) } if ( $PSCmdlet.ShouldProcess("vpnformssoaction", "Update Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnformssoaction -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-NSGetVpnformssoaction -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateVpnformssoaction: Finished" } } function Invoke-NSUnsetVpnformssoaction { <# .SYNOPSIS Unset Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for Form sso action resource. .PARAMETER Name Name for the form based single sign-on profile. .PARAMETER Responsesize Maximum number of bytes to allow in the response size. Specifies the number of bytes in the response to be parsed for extracting the forms. .PARAMETER Namevaluepair Other name-value pair attributes to send to the server, in addition to sending the user name and password. Value names are separated by an ampersand (&), such as in name1=value1&name2=value2. .PARAMETER Nvtype How to process the name-value pair. Available settings function as follows: * STATIC - The administrator-configured values are used. * DYNAMIC - The response is parsed, the form is extracted, and then submitted. Possible values = STATIC, DYNAMIC .PARAMETER Submitmethod HTTP method (GET or POST) used by the single sign-on form to send the logon credentials to the logon server. Possible values = GET, POST .EXAMPLE PS C:\>Invoke-NSUnsetVpnformssoaction -name <string> An example how to unset vpnformssoaction config Object(s). .NOTES File Name : Invoke-NSUnsetVpnformssoaction Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnformssoaction Requires : PowerShell v5.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]$responsesize, [Boolean]$namevaluepair, [Boolean]$nvtype, [Boolean]$submitmethod ) begin { Write-Verbose "Invoke-NSUnsetVpnformssoaction: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('responsesize') ) { $payload.Add('responsesize', $responsesize) } if ( $PSBoundParameters.ContainsKey('namevaluepair') ) { $payload.Add('namevaluepair', $namevaluepair) } if ( $PSBoundParameters.ContainsKey('nvtype') ) { $payload.Add('nvtype', $nvtype) } if ( $PSBoundParameters.ContainsKey('submitmethod') ) { $payload.Add('submitmethod', $submitmethod) } if ( $PSCmdlet.ShouldProcess("$name", "Unset Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type vpnformssoaction -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-NSUnsetVpnformssoaction: Finished" } } function Invoke-NSGetVpnformssoaction { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Configuration for Form sso action resource. .PARAMETER Name Name for the form based single sign-on profile. .PARAMETER GetAll Retrieve all vpnformssoaction object(s). .PARAMETER Count If specified, the count of the vpnformssoaction 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-NSGetVpnformssoaction Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnformssoaction -GetAll Get all vpnformssoaction data. .EXAMPLE PS C:\>Invoke-NSGetVpnformssoaction -Count Get the number of vpnformssoaction objects. .EXAMPLE PS C:\>Invoke-NSGetVpnformssoaction -name <string> Get vpnformssoaction object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnformssoaction -Filter @{ 'name'='<value>' } Get vpnformssoaction data with a filter. .NOTES File Name : Invoke-NSGetVpnformssoaction Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnformssoaction/ Requires : PowerShell v5.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-NSGetVpnformssoaction: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all vpnformssoaction objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnformssoaction -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 vpnformssoaction objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnformssoaction -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnformssoaction objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnformssoaction -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnformssoaction configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnformssoaction -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnformssoaction configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnformssoaction -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-NSGetVpnformssoaction: Ended" } } function Invoke-NSAddVpnglobalAppcontrollerBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the appcontroller that can be bound to vpnglobal. .PARAMETER Appcontroller Configured App Controller server. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. An expression or other value specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE. .PARAMETER PassThru Return details about the created vpnglobal_appcontroller_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnglobalAppcontrollerBinding An example how to add vpnglobal_appcontroller_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnglobalAppcontrollerBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_appcontroller_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), [string]$Appcontroller, [string]$Gotopriorityexpression, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnglobalAppcontrollerBinding: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('appcontroller') ) { $payload.Add('appcontroller', $appcontroller) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSCmdlet.ShouldProcess("vpnglobal_appcontroller_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnglobal_appcontroller_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-NSGetVpnglobalAppcontrollerBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnglobalAppcontrollerBinding: Finished" } } function Invoke-NSDeleteVpnglobalAppcontrollerBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the appcontroller that can be bound to vpnglobal. .PARAMETER Appcontroller Configured App Controller server. .EXAMPLE PS C:\>Invoke-NSDeleteVpnglobalAppcontrollerBinding An example how to delete vpnglobal_appcontroller_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnglobalAppcontrollerBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_appcontroller_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), [string]$Appcontroller ) begin { Write-Verbose "Invoke-NSDeleteVpnglobalAppcontrollerBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Appcontroller') ) { $arguments.Add('appcontroller', $Appcontroller) } if ( $PSCmdlet.ShouldProcess("vpnglobal_appcontroller_binding", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnglobal_appcontroller_binding -NitroPath nitro/v1/config -Resource $ -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-NSDeleteVpnglobalAppcontrollerBinding: Finished" } } function Invoke-NSGetVpnglobalAppcontrollerBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the appcontroller that can be bound to vpnglobal. .PARAMETER GetAll Retrieve all vpnglobal_appcontroller_binding object(s). .PARAMETER Count If specified, the count of the vpnglobal_appcontroller_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-NSGetVpnglobalAppcontrollerBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAppcontrollerBinding -GetAll Get all vpnglobal_appcontroller_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAppcontrollerBinding -Count Get the number of vpnglobal_appcontroller_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAppcontrollerBinding -name <string> Get vpnglobal_appcontroller_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAppcontrollerBinding -Filter @{ 'name'='<value>' } Get vpnglobal_appcontroller_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnglobalAppcontrollerBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_appcontroller_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 = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetVpnglobalAppcontrollerBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnglobal_appcontroller_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_appcontroller_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 vpnglobal_appcontroller_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_appcontroller_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnglobal_appcontroller_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_appcontroller_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnglobal_appcontroller_binding configuration for property ''" } else { Write-Verbose "Retrieving vpnglobal_appcontroller_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_appcontroller_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-NSGetVpnglobalAppcontrollerBinding: Ended" } } function Invoke-NSAddVpnglobalAppfwpolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the appfwpolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Priority Integer specifying the policy's priority. The lower the priority number, the higher the policy's priority. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. An expression or other value specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE. .PARAMETER PassThru Return details about the created vpnglobal_appfwpolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnglobalAppfwpolicyBinding An example how to add vpnglobal_appfwpolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnglobalAppfwpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_appfwpolicy_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), [string]$Policyname, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnglobalAppfwpolicyBinding: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('policyname') ) { $payload.Add('policyname', $policyname) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSCmdlet.ShouldProcess("vpnglobal_appfwpolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnglobal_appfwpolicy_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-NSGetVpnglobalAppfwpolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnglobalAppfwpolicyBinding: Finished" } } function Invoke-NSDeleteVpnglobalAppfwpolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the appfwpolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .EXAMPLE PS C:\>Invoke-NSDeleteVpnglobalAppfwpolicyBinding An example how to delete vpnglobal_appfwpolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnglobalAppfwpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_appfwpolicy_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), [string]$Policyname, [boolean]$Secondary, [boolean]$Groupextraction ) begin { Write-Verbose "Invoke-NSDeleteVpnglobalAppfwpolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policyname') ) { $arguments.Add('policyname', $Policyname) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSCmdlet.ShouldProcess("vpnglobal_appfwpolicy_binding", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnglobal_appfwpolicy_binding -NitroPath nitro/v1/config -Resource $ -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-NSDeleteVpnglobalAppfwpolicyBinding: Finished" } } function Invoke-NSGetVpnglobalAppfwpolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the appfwpolicy that can be bound to vpnglobal. .PARAMETER GetAll Retrieve all vpnglobal_appfwpolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnglobal_appfwpolicy_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-NSGetVpnglobalAppfwpolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAppfwpolicyBinding -GetAll Get all vpnglobal_appfwpolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAppfwpolicyBinding -Count Get the number of vpnglobal_appfwpolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAppfwpolicyBinding -name <string> Get vpnglobal_appfwpolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAppfwpolicyBinding -Filter @{ 'name'='<value>' } Get vpnglobal_appfwpolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnglobalAppfwpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_appfwpolicy_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 = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetVpnglobalAppfwpolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnglobal_appfwpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_appfwpolicy_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 vpnglobal_appfwpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_appfwpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnglobal_appfwpolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_appfwpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnglobal_appfwpolicy_binding configuration for property ''" } else { Write-Verbose "Retrieving vpnglobal_appfwpolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_appfwpolicy_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-NSGetVpnglobalAppfwpolicyBinding: Ended" } } function Invoke-NSAddVpnglobalAuditnslogpolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the auditnslogpolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Priority Integer specifying the policy's priority. The lower the priority number, the higher the policy's priority. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. An expression or other value specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE. .PARAMETER PassThru Return details about the created vpnglobal_auditnslogpolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnglobalAuditnslogpolicyBinding An example how to add vpnglobal_auditnslogpolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnglobalAuditnslogpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_auditnslogpolicy_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), [string]$Policyname, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnglobalAuditnslogpolicyBinding: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('policyname') ) { $payload.Add('policyname', $policyname) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSCmdlet.ShouldProcess("vpnglobal_auditnslogpolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnglobal_auditnslogpolicy_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-NSGetVpnglobalAuditnslogpolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnglobalAuditnslogpolicyBinding: Finished" } } function Invoke-NSDeleteVpnglobalAuditnslogpolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the auditnslogpolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .EXAMPLE PS C:\>Invoke-NSDeleteVpnglobalAuditnslogpolicyBinding An example how to delete vpnglobal_auditnslogpolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnglobalAuditnslogpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_auditnslogpolicy_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), [string]$Policyname, [boolean]$Secondary, [boolean]$Groupextraction ) begin { Write-Verbose "Invoke-NSDeleteVpnglobalAuditnslogpolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policyname') ) { $arguments.Add('policyname', $Policyname) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSCmdlet.ShouldProcess("vpnglobal_auditnslogpolicy_binding", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnglobal_auditnslogpolicy_binding -NitroPath nitro/v1/config -Resource $ -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-NSDeleteVpnglobalAuditnslogpolicyBinding: Finished" } } function Invoke-NSGetVpnglobalAuditnslogpolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the auditnslogpolicy that can be bound to vpnglobal. .PARAMETER GetAll Retrieve all vpnglobal_auditnslogpolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnglobal_auditnslogpolicy_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-NSGetVpnglobalAuditnslogpolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuditnslogpolicyBinding -GetAll Get all vpnglobal_auditnslogpolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuditnslogpolicyBinding -Count Get the number of vpnglobal_auditnslogpolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuditnslogpolicyBinding -name <string> Get vpnglobal_auditnslogpolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuditnslogpolicyBinding -Filter @{ 'name'='<value>' } Get vpnglobal_auditnslogpolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnglobalAuditnslogpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_auditnslogpolicy_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 = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetVpnglobalAuditnslogpolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnglobal_auditnslogpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_auditnslogpolicy_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 vpnglobal_auditnslogpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_auditnslogpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnglobal_auditnslogpolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_auditnslogpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnglobal_auditnslogpolicy_binding configuration for property ''" } else { Write-Verbose "Retrieving vpnglobal_auditnslogpolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_auditnslogpolicy_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-NSGetVpnglobalAuditnslogpolicyBinding: Ended" } } function Invoke-NSAddVpnglobalAuditsyslogpolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the auditsyslogpolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Priority Integer specifying the policy's priority. The lower the priority number, the higher the policy's priority. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. An expression or other value specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE. .PARAMETER PassThru Return details about the created vpnglobal_auditsyslogpolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnglobalAuditsyslogpolicyBinding An example how to add vpnglobal_auditsyslogpolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnglobalAuditsyslogpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_auditsyslogpolicy_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), [string]$Policyname, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnglobalAuditsyslogpolicyBinding: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('policyname') ) { $payload.Add('policyname', $policyname) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSCmdlet.ShouldProcess("vpnglobal_auditsyslogpolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnglobal_auditsyslogpolicy_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-NSGetVpnglobalAuditsyslogpolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnglobalAuditsyslogpolicyBinding: Finished" } } function Invoke-NSDeleteVpnglobalAuditsyslogpolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the auditsyslogpolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .EXAMPLE PS C:\>Invoke-NSDeleteVpnglobalAuditsyslogpolicyBinding An example how to delete vpnglobal_auditsyslogpolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnglobalAuditsyslogpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_auditsyslogpolicy_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), [string]$Policyname, [boolean]$Secondary, [boolean]$Groupextraction ) begin { Write-Verbose "Invoke-NSDeleteVpnglobalAuditsyslogpolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policyname') ) { $arguments.Add('policyname', $Policyname) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSCmdlet.ShouldProcess("vpnglobal_auditsyslogpolicy_binding", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnglobal_auditsyslogpolicy_binding -NitroPath nitro/v1/config -Resource $ -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-NSDeleteVpnglobalAuditsyslogpolicyBinding: Finished" } } function Invoke-NSGetVpnglobalAuditsyslogpolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the auditsyslogpolicy that can be bound to vpnglobal. .PARAMETER GetAll Retrieve all vpnglobal_auditsyslogpolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnglobal_auditsyslogpolicy_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-NSGetVpnglobalAuditsyslogpolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuditsyslogpolicyBinding -GetAll Get all vpnglobal_auditsyslogpolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuditsyslogpolicyBinding -Count Get the number of vpnglobal_auditsyslogpolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuditsyslogpolicyBinding -name <string> Get vpnglobal_auditsyslogpolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuditsyslogpolicyBinding -Filter @{ 'name'='<value>' } Get vpnglobal_auditsyslogpolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnglobalAuditsyslogpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_auditsyslogpolicy_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 = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetVpnglobalAuditsyslogpolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnglobal_auditsyslogpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_auditsyslogpolicy_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 vpnglobal_auditsyslogpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_auditsyslogpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnglobal_auditsyslogpolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_auditsyslogpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnglobal_auditsyslogpolicy_binding configuration for property ''" } else { Write-Verbose "Retrieving vpnglobal_auditsyslogpolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_auditsyslogpolicy_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-NSGetVpnglobalAuditsyslogpolicyBinding: Ended" } } function Invoke-NSAddVpnglobalAuthenticationcertpolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationcertpolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Priority Integer specifying the policy's priority. The lower the priority number, the higher the policy's priority. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. An expression or other value specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE. .PARAMETER PassThru Return details about the created vpnglobal_authenticationcertpolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnglobalAuthenticationcertpolicyBinding An example how to add vpnglobal_authenticationcertpolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnglobalAuthenticationcertpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_authenticationcertpolicy_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), [string]$Policyname, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnglobalAuthenticationcertpolicyBinding: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('policyname') ) { $payload.Add('policyname', $policyname) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSCmdlet.ShouldProcess("vpnglobal_authenticationcertpolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnglobal_authenticationcertpolicy_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-NSGetVpnglobalAuthenticationcertpolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnglobalAuthenticationcertpolicyBinding: Finished" } } function Invoke-NSDeleteVpnglobalAuthenticationcertpolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationcertpolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .EXAMPLE PS C:\>Invoke-NSDeleteVpnglobalAuthenticationcertpolicyBinding An example how to delete vpnglobal_authenticationcertpolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnglobalAuthenticationcertpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_authenticationcertpolicy_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), [string]$Policyname, [boolean]$Secondary, [boolean]$Groupextraction ) begin { Write-Verbose "Invoke-NSDeleteVpnglobalAuthenticationcertpolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policyname') ) { $arguments.Add('policyname', $Policyname) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSCmdlet.ShouldProcess("vpnglobal_authenticationcertpolicy_binding", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnglobal_authenticationcertpolicy_binding -NitroPath nitro/v1/config -Resource $ -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-NSDeleteVpnglobalAuthenticationcertpolicyBinding: Finished" } } function Invoke-NSGetVpnglobalAuthenticationcertpolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the authenticationcertpolicy that can be bound to vpnglobal. .PARAMETER GetAll Retrieve all vpnglobal_authenticationcertpolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnglobal_authenticationcertpolicy_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-NSGetVpnglobalAuthenticationcertpolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationcertpolicyBinding -GetAll Get all vpnglobal_authenticationcertpolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationcertpolicyBinding -Count Get the number of vpnglobal_authenticationcertpolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationcertpolicyBinding -name <string> Get vpnglobal_authenticationcertpolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationcertpolicyBinding -Filter @{ 'name'='<value>' } Get vpnglobal_authenticationcertpolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnglobalAuthenticationcertpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_authenticationcertpolicy_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 = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetVpnglobalAuthenticationcertpolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnglobal_authenticationcertpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationcertpolicy_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 vpnglobal_authenticationcertpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationcertpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnglobal_authenticationcertpolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationcertpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnglobal_authenticationcertpolicy_binding configuration for property ''" } else { Write-Verbose "Retrieving vpnglobal_authenticationcertpolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationcertpolicy_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-NSGetVpnglobalAuthenticationcertpolicyBinding: Ended" } } function Invoke-NSAddVpnglobalAuthenticationldappolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationldappolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Priority Integer specifying the policy's priority. The lower the priority number, the higher the policy's priority. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. An expression or other value specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE. .PARAMETER PassThru Return details about the created vpnglobal_authenticationldappolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnglobalAuthenticationldappolicyBinding An example how to add vpnglobal_authenticationldappolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnglobalAuthenticationldappolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_authenticationldappolicy_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), [string]$Policyname, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnglobalAuthenticationldappolicyBinding: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('policyname') ) { $payload.Add('policyname', $policyname) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSCmdlet.ShouldProcess("vpnglobal_authenticationldappolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnglobal_authenticationldappolicy_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-NSGetVpnglobalAuthenticationldappolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnglobalAuthenticationldappolicyBinding: Finished" } } function Invoke-NSDeleteVpnglobalAuthenticationldappolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationldappolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .EXAMPLE PS C:\>Invoke-NSDeleteVpnglobalAuthenticationldappolicyBinding An example how to delete vpnglobal_authenticationldappolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnglobalAuthenticationldappolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_authenticationldappolicy_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), [string]$Policyname, [boolean]$Secondary, [boolean]$Groupextraction ) begin { Write-Verbose "Invoke-NSDeleteVpnglobalAuthenticationldappolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policyname') ) { $arguments.Add('policyname', $Policyname) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSCmdlet.ShouldProcess("vpnglobal_authenticationldappolicy_binding", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnglobal_authenticationldappolicy_binding -NitroPath nitro/v1/config -Resource $ -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-NSDeleteVpnglobalAuthenticationldappolicyBinding: Finished" } } function Invoke-NSGetVpnglobalAuthenticationldappolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the authenticationldappolicy that can be bound to vpnglobal. .PARAMETER GetAll Retrieve all vpnglobal_authenticationldappolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnglobal_authenticationldappolicy_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-NSGetVpnglobalAuthenticationldappolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationldappolicyBinding -GetAll Get all vpnglobal_authenticationldappolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationldappolicyBinding -Count Get the number of vpnglobal_authenticationldappolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationldappolicyBinding -name <string> Get vpnglobal_authenticationldappolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationldappolicyBinding -Filter @{ 'name'='<value>' } Get vpnglobal_authenticationldappolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnglobalAuthenticationldappolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_authenticationldappolicy_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 = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetVpnglobalAuthenticationldappolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnglobal_authenticationldappolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationldappolicy_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 vpnglobal_authenticationldappolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationldappolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnglobal_authenticationldappolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationldappolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnglobal_authenticationldappolicy_binding configuration for property ''" } else { Write-Verbose "Retrieving vpnglobal_authenticationldappolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationldappolicy_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-NSGetVpnglobalAuthenticationldappolicyBinding: Ended" } } function Invoke-NSAddVpnglobalAuthenticationlocalpolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationlocalpolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Priority Integer specifying the policy's priority. The lower the priority number, the higher the policy's priority. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. An expression or other value specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE. .PARAMETER PassThru Return details about the created vpnglobal_authenticationlocalpolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnglobalAuthenticationlocalpolicyBinding An example how to add vpnglobal_authenticationlocalpolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnglobalAuthenticationlocalpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_authenticationlocalpolicy_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), [string]$Policyname, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnglobalAuthenticationlocalpolicyBinding: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('policyname') ) { $payload.Add('policyname', $policyname) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSCmdlet.ShouldProcess("vpnglobal_authenticationlocalpolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnglobal_authenticationlocalpolicy_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-NSGetVpnglobalAuthenticationlocalpolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnglobalAuthenticationlocalpolicyBinding: Finished" } } function Invoke-NSDeleteVpnglobalAuthenticationlocalpolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationlocalpolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .EXAMPLE PS C:\>Invoke-NSDeleteVpnglobalAuthenticationlocalpolicyBinding An example how to delete vpnglobal_authenticationlocalpolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnglobalAuthenticationlocalpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_authenticationlocalpolicy_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), [string]$Policyname, [boolean]$Secondary, [boolean]$Groupextraction ) begin { Write-Verbose "Invoke-NSDeleteVpnglobalAuthenticationlocalpolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policyname') ) { $arguments.Add('policyname', $Policyname) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSCmdlet.ShouldProcess("vpnglobal_authenticationlocalpolicy_binding", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnglobal_authenticationlocalpolicy_binding -NitroPath nitro/v1/config -Resource $ -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-NSDeleteVpnglobalAuthenticationlocalpolicyBinding: Finished" } } function Invoke-NSGetVpnglobalAuthenticationlocalpolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the authenticationlocalpolicy that can be bound to vpnglobal. .PARAMETER GetAll Retrieve all vpnglobal_authenticationlocalpolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnglobal_authenticationlocalpolicy_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-NSGetVpnglobalAuthenticationlocalpolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationlocalpolicyBinding -GetAll Get all vpnglobal_authenticationlocalpolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationlocalpolicyBinding -Count Get the number of vpnglobal_authenticationlocalpolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationlocalpolicyBinding -name <string> Get vpnglobal_authenticationlocalpolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationlocalpolicyBinding -Filter @{ 'name'='<value>' } Get vpnglobal_authenticationlocalpolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnglobalAuthenticationlocalpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_authenticationlocalpolicy_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 = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetVpnglobalAuthenticationlocalpolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnglobal_authenticationlocalpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationlocalpolicy_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 vpnglobal_authenticationlocalpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationlocalpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnglobal_authenticationlocalpolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationlocalpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnglobal_authenticationlocalpolicy_binding configuration for property ''" } else { Write-Verbose "Retrieving vpnglobal_authenticationlocalpolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationlocalpolicy_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-NSGetVpnglobalAuthenticationlocalpolicyBinding: Ended" } } function Invoke-NSAddVpnglobalAuthenticationnegotiatepolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationnegotiatepolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Priority Integer specifying the policy's priority. The lower the priority number, the higher the policy's priority. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. An expression or other value specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE. .PARAMETER PassThru Return details about the created vpnglobal_authenticationnegotiatepolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnglobalAuthenticationnegotiatepolicyBinding An example how to add vpnglobal_authenticationnegotiatepolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnglobalAuthenticationnegotiatepolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_authenticationnegotiatepolicy_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), [string]$Policyname, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnglobalAuthenticationnegotiatepolicyBinding: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('policyname') ) { $payload.Add('policyname', $policyname) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSCmdlet.ShouldProcess("vpnglobal_authenticationnegotiatepolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnglobal_authenticationnegotiatepolicy_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-NSGetVpnglobalAuthenticationnegotiatepolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnglobalAuthenticationnegotiatepolicyBinding: Finished" } } function Invoke-NSDeleteVpnglobalAuthenticationnegotiatepolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationnegotiatepolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .EXAMPLE PS C:\>Invoke-NSDeleteVpnglobalAuthenticationnegotiatepolicyBinding An example how to delete vpnglobal_authenticationnegotiatepolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnglobalAuthenticationnegotiatepolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_authenticationnegotiatepolicy_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), [string]$Policyname, [boolean]$Secondary, [boolean]$Groupextraction ) begin { Write-Verbose "Invoke-NSDeleteVpnglobalAuthenticationnegotiatepolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policyname') ) { $arguments.Add('policyname', $Policyname) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSCmdlet.ShouldProcess("vpnglobal_authenticationnegotiatepolicy_binding", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnglobal_authenticationnegotiatepolicy_binding -NitroPath nitro/v1/config -Resource $ -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-NSDeleteVpnglobalAuthenticationnegotiatepolicyBinding: Finished" } } function Invoke-NSGetVpnglobalAuthenticationnegotiatepolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the authenticationnegotiatepolicy that can be bound to vpnglobal. .PARAMETER GetAll Retrieve all vpnglobal_authenticationnegotiatepolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnglobal_authenticationnegotiatepolicy_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-NSGetVpnglobalAuthenticationnegotiatepolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationnegotiatepolicyBinding -GetAll Get all vpnglobal_authenticationnegotiatepolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationnegotiatepolicyBinding -Count Get the number of vpnglobal_authenticationnegotiatepolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationnegotiatepolicyBinding -name <string> Get vpnglobal_authenticationnegotiatepolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationnegotiatepolicyBinding -Filter @{ 'name'='<value>' } Get vpnglobal_authenticationnegotiatepolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnglobalAuthenticationnegotiatepolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_authenticationnegotiatepolicy_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 = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetVpnglobalAuthenticationnegotiatepolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnglobal_authenticationnegotiatepolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationnegotiatepolicy_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 vpnglobal_authenticationnegotiatepolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationnegotiatepolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnglobal_authenticationnegotiatepolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationnegotiatepolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnglobal_authenticationnegotiatepolicy_binding configuration for property ''" } else { Write-Verbose "Retrieving vpnglobal_authenticationnegotiatepolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationnegotiatepolicy_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-NSGetVpnglobalAuthenticationnegotiatepolicyBinding: Ended" } } function Invoke-NSAddVpnglobalAuthenticationpolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationpolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Priority Integer specifying the policy's priority. The lower the priority number, the higher the policy's priority. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. An expression or other value specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE. .PARAMETER PassThru Return details about the created vpnglobal_authenticationpolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnglobalAuthenticationpolicyBinding An example how to add vpnglobal_authenticationpolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnglobalAuthenticationpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_authenticationpolicy_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), [string]$Policyname, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnglobalAuthenticationpolicyBinding: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('policyname') ) { $payload.Add('policyname', $policyname) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSCmdlet.ShouldProcess("vpnglobal_authenticationpolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnglobal_authenticationpolicy_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-NSGetVpnglobalAuthenticationpolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnglobalAuthenticationpolicyBinding: Finished" } } function Invoke-NSDeleteVpnglobalAuthenticationpolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationpolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .EXAMPLE PS C:\>Invoke-NSDeleteVpnglobalAuthenticationpolicyBinding An example how to delete vpnglobal_authenticationpolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnglobalAuthenticationpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_authenticationpolicy_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), [string]$Policyname, [boolean]$Secondary, [boolean]$Groupextraction ) begin { Write-Verbose "Invoke-NSDeleteVpnglobalAuthenticationpolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policyname') ) { $arguments.Add('policyname', $Policyname) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSCmdlet.ShouldProcess("vpnglobal_authenticationpolicy_binding", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnglobal_authenticationpolicy_binding -NitroPath nitro/v1/config -Resource $ -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-NSDeleteVpnglobalAuthenticationpolicyBinding: Finished" } } function Invoke-NSGetVpnglobalAuthenticationpolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the authenticationpolicy that can be bound to vpnglobal. .PARAMETER GetAll Retrieve all vpnglobal_authenticationpolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnglobal_authenticationpolicy_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-NSGetVpnglobalAuthenticationpolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationpolicyBinding -GetAll Get all vpnglobal_authenticationpolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationpolicyBinding -Count Get the number of vpnglobal_authenticationpolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationpolicyBinding -name <string> Get vpnglobal_authenticationpolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationpolicyBinding -Filter @{ 'name'='<value>' } Get vpnglobal_authenticationpolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnglobalAuthenticationpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_authenticationpolicy_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 = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetVpnglobalAuthenticationpolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnglobal_authenticationpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationpolicy_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 vpnglobal_authenticationpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnglobal_authenticationpolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnglobal_authenticationpolicy_binding configuration for property ''" } else { Write-Verbose "Retrieving vpnglobal_authenticationpolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationpolicy_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-NSGetVpnglobalAuthenticationpolicyBinding: Ended" } } function Invoke-NSAddVpnglobalAuthenticationradiuspolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationradiuspolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Priority Integer specifying the policy's priority. The lower the priority number, the higher the policy's priority. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. An expression or other value specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE. .PARAMETER PassThru Return details about the created vpnglobal_authenticationradiuspolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnglobalAuthenticationradiuspolicyBinding An example how to add vpnglobal_authenticationradiuspolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnglobalAuthenticationradiuspolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_authenticationradiuspolicy_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), [string]$Policyname, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnglobalAuthenticationradiuspolicyBinding: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('policyname') ) { $payload.Add('policyname', $policyname) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSCmdlet.ShouldProcess("vpnglobal_authenticationradiuspolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnglobal_authenticationradiuspolicy_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-NSGetVpnglobalAuthenticationradiuspolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnglobalAuthenticationradiuspolicyBinding: Finished" } } function Invoke-NSDeleteVpnglobalAuthenticationradiuspolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationradiuspolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .EXAMPLE PS C:\>Invoke-NSDeleteVpnglobalAuthenticationradiuspolicyBinding An example how to delete vpnglobal_authenticationradiuspolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnglobalAuthenticationradiuspolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_authenticationradiuspolicy_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), [string]$Policyname, [boolean]$Secondary, [boolean]$Groupextraction ) begin { Write-Verbose "Invoke-NSDeleteVpnglobalAuthenticationradiuspolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policyname') ) { $arguments.Add('policyname', $Policyname) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSCmdlet.ShouldProcess("vpnglobal_authenticationradiuspolicy_binding", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnglobal_authenticationradiuspolicy_binding -NitroPath nitro/v1/config -Resource $ -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-NSDeleteVpnglobalAuthenticationradiuspolicyBinding: Finished" } } function Invoke-NSGetVpnglobalAuthenticationradiuspolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the authenticationradiuspolicy that can be bound to vpnglobal. .PARAMETER GetAll Retrieve all vpnglobal_authenticationradiuspolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnglobal_authenticationradiuspolicy_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-NSGetVpnglobalAuthenticationradiuspolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationradiuspolicyBinding -GetAll Get all vpnglobal_authenticationradiuspolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationradiuspolicyBinding -Count Get the number of vpnglobal_authenticationradiuspolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationradiuspolicyBinding -name <string> Get vpnglobal_authenticationradiuspolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationradiuspolicyBinding -Filter @{ 'name'='<value>' } Get vpnglobal_authenticationradiuspolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnglobalAuthenticationradiuspolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_authenticationradiuspolicy_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 = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetVpnglobalAuthenticationradiuspolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnglobal_authenticationradiuspolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationradiuspolicy_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 vpnglobal_authenticationradiuspolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationradiuspolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnglobal_authenticationradiuspolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationradiuspolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnglobal_authenticationradiuspolicy_binding configuration for property ''" } else { Write-Verbose "Retrieving vpnglobal_authenticationradiuspolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationradiuspolicy_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-NSGetVpnglobalAuthenticationradiuspolicyBinding: Ended" } } function Invoke-NSAddVpnglobalAuthenticationsamlpolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationsamlpolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Priority Integer specifying the policy's priority. The lower the priority number, the higher the policy's priority. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. An expression or other value specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE. .PARAMETER PassThru Return details about the created vpnglobal_authenticationsamlpolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnglobalAuthenticationsamlpolicyBinding An example how to add vpnglobal_authenticationsamlpolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnglobalAuthenticationsamlpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_authenticationsamlpolicy_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), [string]$Policyname, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnglobalAuthenticationsamlpolicyBinding: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('policyname') ) { $payload.Add('policyname', $policyname) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSCmdlet.ShouldProcess("vpnglobal_authenticationsamlpolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnglobal_authenticationsamlpolicy_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-NSGetVpnglobalAuthenticationsamlpolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnglobalAuthenticationsamlpolicyBinding: Finished" } } function Invoke-NSDeleteVpnglobalAuthenticationsamlpolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationsamlpolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .EXAMPLE PS C:\>Invoke-NSDeleteVpnglobalAuthenticationsamlpolicyBinding An example how to delete vpnglobal_authenticationsamlpolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnglobalAuthenticationsamlpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_authenticationsamlpolicy_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), [string]$Policyname, [boolean]$Secondary, [boolean]$Groupextraction ) begin { Write-Verbose "Invoke-NSDeleteVpnglobalAuthenticationsamlpolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policyname') ) { $arguments.Add('policyname', $Policyname) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSCmdlet.ShouldProcess("vpnglobal_authenticationsamlpolicy_binding", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnglobal_authenticationsamlpolicy_binding -NitroPath nitro/v1/config -Resource $ -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-NSDeleteVpnglobalAuthenticationsamlpolicyBinding: Finished" } } function Invoke-NSGetVpnglobalAuthenticationsamlpolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the authenticationsamlpolicy that can be bound to vpnglobal. .PARAMETER GetAll Retrieve all vpnglobal_authenticationsamlpolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnglobal_authenticationsamlpolicy_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-NSGetVpnglobalAuthenticationsamlpolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationsamlpolicyBinding -GetAll Get all vpnglobal_authenticationsamlpolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationsamlpolicyBinding -Count Get the number of vpnglobal_authenticationsamlpolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationsamlpolicyBinding -name <string> Get vpnglobal_authenticationsamlpolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationsamlpolicyBinding -Filter @{ 'name'='<value>' } Get vpnglobal_authenticationsamlpolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnglobalAuthenticationsamlpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_authenticationsamlpolicy_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 = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetVpnglobalAuthenticationsamlpolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnglobal_authenticationsamlpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationsamlpolicy_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 vpnglobal_authenticationsamlpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationsamlpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnglobal_authenticationsamlpolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationsamlpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnglobal_authenticationsamlpolicy_binding configuration for property ''" } else { Write-Verbose "Retrieving vpnglobal_authenticationsamlpolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationsamlpolicy_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-NSGetVpnglobalAuthenticationsamlpolicyBinding: Ended" } } function Invoke-NSAddVpnglobalAuthenticationtacacspolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationtacacspolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Priority Integer specifying the policy's priority. The lower the priority number, the higher the policy's priority. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. An expression or other value specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE. .PARAMETER PassThru Return details about the created vpnglobal_authenticationtacacspolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnglobalAuthenticationtacacspolicyBinding An example how to add vpnglobal_authenticationtacacspolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnglobalAuthenticationtacacspolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_authenticationtacacspolicy_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), [string]$Policyname, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnglobalAuthenticationtacacspolicyBinding: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('policyname') ) { $payload.Add('policyname', $policyname) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSCmdlet.ShouldProcess("vpnglobal_authenticationtacacspolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnglobal_authenticationtacacspolicy_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-NSGetVpnglobalAuthenticationtacacspolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnglobalAuthenticationtacacspolicyBinding: Finished" } } function Invoke-NSDeleteVpnglobalAuthenticationtacacspolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationtacacspolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .EXAMPLE PS C:\>Invoke-NSDeleteVpnglobalAuthenticationtacacspolicyBinding An example how to delete vpnglobal_authenticationtacacspolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnglobalAuthenticationtacacspolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_authenticationtacacspolicy_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), [string]$Policyname, [boolean]$Secondary, [boolean]$Groupextraction ) begin { Write-Verbose "Invoke-NSDeleteVpnglobalAuthenticationtacacspolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policyname') ) { $arguments.Add('policyname', $Policyname) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSCmdlet.ShouldProcess("vpnglobal_authenticationtacacspolicy_binding", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnglobal_authenticationtacacspolicy_binding -NitroPath nitro/v1/config -Resource $ -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-NSDeleteVpnglobalAuthenticationtacacspolicyBinding: Finished" } } function Invoke-NSGetVpnglobalAuthenticationtacacspolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the authenticationtacacspolicy that can be bound to vpnglobal. .PARAMETER GetAll Retrieve all vpnglobal_authenticationtacacspolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnglobal_authenticationtacacspolicy_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-NSGetVpnglobalAuthenticationtacacspolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationtacacspolicyBinding -GetAll Get all vpnglobal_authenticationtacacspolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationtacacspolicyBinding -Count Get the number of vpnglobal_authenticationtacacspolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationtacacspolicyBinding -name <string> Get vpnglobal_authenticationtacacspolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalAuthenticationtacacspolicyBinding -Filter @{ 'name'='<value>' } Get vpnglobal_authenticationtacacspolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnglobalAuthenticationtacacspolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_authenticationtacacspolicy_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 = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetVpnglobalAuthenticationtacacspolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnglobal_authenticationtacacspolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationtacacspolicy_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 vpnglobal_authenticationtacacspolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationtacacspolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnglobal_authenticationtacacspolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationtacacspolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnglobal_authenticationtacacspolicy_binding configuration for property ''" } else { Write-Verbose "Retrieving vpnglobal_authenticationtacacspolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_authenticationtacacspolicy_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-NSGetVpnglobalAuthenticationtacacspolicyBinding: Ended" } } function Invoke-NSGetVpnglobalBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object which returns the resources bound to vpnglobal. .PARAMETER GetAll Retrieve all vpnglobal_binding object(s). .PARAMETER Count If specified, the count of the vpnglobal_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-NSGetVpnglobalBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalBinding -GetAll Get all vpnglobal_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalBinding -name <string> Get vpnglobal_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalBinding -Filter @{ 'name'='<value>' } Get vpnglobal_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnglobalBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_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), [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetVpnglobalBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnglobal_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_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 vpnglobal_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnglobal_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnglobal_binding configuration for property ''" } else { Write-Verbose "Retrieving vpnglobal_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_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-NSGetVpnglobalBinding: Ended" } } function Invoke-NSAddVpnglobalDomainBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the domain that can be bound to vpnglobal. .PARAMETER Intranetdomain The conflicting intranet domain name. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. An expression or other value specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE. .PARAMETER PassThru Return details about the created vpnglobal_domain_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnglobalDomainBinding An example how to add vpnglobal_domain_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnglobalDomainBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_domain_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), [string]$Intranetdomain, [string]$Gotopriorityexpression, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnglobalDomainBinding: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('intranetdomain') ) { $payload.Add('intranetdomain', $intranetdomain) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSCmdlet.ShouldProcess("vpnglobal_domain_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnglobal_domain_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-NSGetVpnglobalDomainBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnglobalDomainBinding: Finished" } } function Invoke-NSDeleteVpnglobalDomainBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the domain that can be bound to vpnglobal. .PARAMETER Intranetdomain The conflicting intranet domain name. .EXAMPLE PS C:\>Invoke-NSDeleteVpnglobalDomainBinding An example how to delete vpnglobal_domain_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnglobalDomainBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_domain_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), [string]$Intranetdomain ) begin { Write-Verbose "Invoke-NSDeleteVpnglobalDomainBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Intranetdomain') ) { $arguments.Add('intranetdomain', $Intranetdomain) } if ( $PSCmdlet.ShouldProcess("vpnglobal_domain_binding", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnglobal_domain_binding -NitroPath nitro/v1/config -Resource $ -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-NSDeleteVpnglobalDomainBinding: Finished" } } function Invoke-NSGetVpnglobalDomainBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the domain that can be bound to vpnglobal. .PARAMETER GetAll Retrieve all vpnglobal_domain_binding object(s). .PARAMETER Count If specified, the count of the vpnglobal_domain_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-NSGetVpnglobalDomainBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalDomainBinding -GetAll Get all vpnglobal_domain_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalDomainBinding -Count Get the number of vpnglobal_domain_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalDomainBinding -name <string> Get vpnglobal_domain_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalDomainBinding -Filter @{ 'name'='<value>' } Get vpnglobal_domain_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnglobalDomainBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_domain_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 = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetVpnglobalDomainBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnglobal_domain_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_domain_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 vpnglobal_domain_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_domain_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnglobal_domain_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_domain_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnglobal_domain_binding configuration for property ''" } else { Write-Verbose "Retrieving vpnglobal_domain_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_domain_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-NSGetVpnglobalDomainBinding: Ended" } } function Invoke-NSAddVpnglobalIntranetip6Binding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the intranetip6 that can be bound to vpnglobal. .PARAMETER Intranetip6 The intranet ip address or range. .PARAMETER Numaddr The intranet ip address or range's netmask. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. An expression or other value specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE. .PARAMETER PassThru Return details about the created vpnglobal_intranetip6_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnglobalIntranetip6Binding An example how to add vpnglobal_intranetip6_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnglobalIntranetip6Binding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_intranetip6_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), [string]$Intranetip6, [double]$Numaddr, [string]$Gotopriorityexpression, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnglobalIntranetip6Binding: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('intranetip6') ) { $payload.Add('intranetip6', $intranetip6) } if ( $PSBoundParameters.ContainsKey('numaddr') ) { $payload.Add('numaddr', $numaddr) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSCmdlet.ShouldProcess("vpnglobal_intranetip6_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnglobal_intranetip6_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-NSGetVpnglobalIntranetip6Binding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnglobalIntranetip6Binding: Finished" } } function Invoke-NSDeleteVpnglobalIntranetip6Binding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the intranetip6 that can be bound to vpnglobal. .PARAMETER Intranetip6 The intranet ip address or range. .PARAMETER Numaddr The intranet ip address or range's netmask. .EXAMPLE PS C:\>Invoke-NSDeleteVpnglobalIntranetip6Binding An example how to delete vpnglobal_intranetip6_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnglobalIntranetip6Binding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_intranetip6_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), [string]$Intranetip6, [double]$Numaddr ) begin { Write-Verbose "Invoke-NSDeleteVpnglobalIntranetip6Binding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Intranetip6') ) { $arguments.Add('intranetip6', $Intranetip6) } if ( $PSBoundParameters.ContainsKey('Numaddr') ) { $arguments.Add('numaddr', $Numaddr) } if ( $PSCmdlet.ShouldProcess("vpnglobal_intranetip6_binding", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnglobal_intranetip6_binding -NitroPath nitro/v1/config -Resource $ -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-NSDeleteVpnglobalIntranetip6Binding: Finished" } } function Invoke-NSGetVpnglobalIntranetip6Binding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the intranetip6 that can be bound to vpnglobal. .PARAMETER GetAll Retrieve all vpnglobal_intranetip6_binding object(s). .PARAMETER Count If specified, the count of the vpnglobal_intranetip6_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-NSGetVpnglobalIntranetip6Binding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalIntranetip6Binding -GetAll Get all vpnglobal_intranetip6_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalIntranetip6Binding -Count Get the number of vpnglobal_intranetip6_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalIntranetip6Binding -name <string> Get vpnglobal_intranetip6_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalIntranetip6Binding -Filter @{ 'name'='<value>' } Get vpnglobal_intranetip6_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnglobalIntranetip6Binding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_intranetip6_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 = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetVpnglobalIntranetip6Binding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnglobal_intranetip6_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_intranetip6_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 vpnglobal_intranetip6_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_intranetip6_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnglobal_intranetip6_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_intranetip6_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnglobal_intranetip6_binding configuration for property ''" } else { Write-Verbose "Retrieving vpnglobal_intranetip6_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_intranetip6_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-NSGetVpnglobalIntranetip6Binding: Ended" } } function Invoke-NSAddVpnglobalIntranetipBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the intranetip that can be bound to vpnglobal. .PARAMETER Intranetip The intranet ip address or range. .PARAMETER Netmask The intranet ip address or range's netmask. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. An expression or other value specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE. .PARAMETER PassThru Return details about the created vpnglobal_intranetip_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnglobalIntranetipBinding An example how to add vpnglobal_intranetip_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnglobalIntranetipBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_intranetip_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), [string]$Intranetip, [string]$Netmask, [string]$Gotopriorityexpression, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnglobalIntranetipBinding: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('intranetip') ) { $payload.Add('intranetip', $intranetip) } if ( $PSBoundParameters.ContainsKey('netmask') ) { $payload.Add('netmask', $netmask) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSCmdlet.ShouldProcess("vpnglobal_intranetip_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnglobal_intranetip_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-NSGetVpnglobalIntranetipBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnglobalIntranetipBinding: Finished" } } function Invoke-NSDeleteVpnglobalIntranetipBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the intranetip that can be bound to vpnglobal. .PARAMETER Intranetip The intranet ip address or range. .PARAMETER Netmask The intranet ip address or range's netmask. .EXAMPLE PS C:\>Invoke-NSDeleteVpnglobalIntranetipBinding An example how to delete vpnglobal_intranetip_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnglobalIntranetipBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_intranetip_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), [string]$Intranetip, [string]$Netmask ) begin { Write-Verbose "Invoke-NSDeleteVpnglobalIntranetipBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Intranetip') ) { $arguments.Add('intranetip', $Intranetip) } if ( $PSBoundParameters.ContainsKey('Netmask') ) { $arguments.Add('netmask', $Netmask) } if ( $PSCmdlet.ShouldProcess("vpnglobal_intranetip_binding", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnglobal_intranetip_binding -NitroPath nitro/v1/config -Resource $ -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-NSDeleteVpnglobalIntranetipBinding: Finished" } } function Invoke-NSGetVpnglobalIntranetipBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the intranetip that can be bound to vpnglobal. .PARAMETER GetAll Retrieve all vpnglobal_intranetip_binding object(s). .PARAMETER Count If specified, the count of the vpnglobal_intranetip_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-NSGetVpnglobalIntranetipBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalIntranetipBinding -GetAll Get all vpnglobal_intranetip_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalIntranetipBinding -Count Get the number of vpnglobal_intranetip_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalIntranetipBinding -name <string> Get vpnglobal_intranetip_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalIntranetipBinding -Filter @{ 'name'='<value>' } Get vpnglobal_intranetip_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnglobalIntranetipBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_intranetip_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 = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetVpnglobalIntranetipBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnglobal_intranetip_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_intranetip_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 vpnglobal_intranetip_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_intranetip_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnglobal_intranetip_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_intranetip_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnglobal_intranetip_binding configuration for property ''" } else { Write-Verbose "Retrieving vpnglobal_intranetip_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_intranetip_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-NSGetVpnglobalIntranetipBinding: Ended" } } function Invoke-NSAddVpnglobalSharefileserverBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the sharefileserver that can be bound to vpnglobal. .PARAMETER Sharefile Configured Sharefile server, in the format IP:PORT / FQDN:PORT. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. An expression or other value specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE. .PARAMETER PassThru Return details about the created vpnglobal_sharefileserver_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnglobalSharefileserverBinding An example how to add vpnglobal_sharefileserver_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnglobalSharefileserverBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_sharefileserver_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), [string]$Sharefile, [string]$Gotopriorityexpression, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnglobalSharefileserverBinding: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('sharefile') ) { $payload.Add('sharefile', $sharefile) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSCmdlet.ShouldProcess("vpnglobal_sharefileserver_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnglobal_sharefileserver_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-NSGetVpnglobalSharefileserverBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnglobalSharefileserverBinding: Finished" } } function Invoke-NSDeleteVpnglobalSharefileserverBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the sharefileserver that can be bound to vpnglobal. .PARAMETER Sharefile Configured Sharefile server, in the format IP:PORT / FQDN:PORT. .EXAMPLE PS C:\>Invoke-NSDeleteVpnglobalSharefileserverBinding An example how to delete vpnglobal_sharefileserver_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnglobalSharefileserverBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_sharefileserver_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), [string]$Sharefile ) begin { Write-Verbose "Invoke-NSDeleteVpnglobalSharefileserverBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Sharefile') ) { $arguments.Add('sharefile', $Sharefile) } if ( $PSCmdlet.ShouldProcess("vpnglobal_sharefileserver_binding", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnglobal_sharefileserver_binding -NitroPath nitro/v1/config -Resource $ -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-NSDeleteVpnglobalSharefileserverBinding: Finished" } } function Invoke-NSGetVpnglobalSharefileserverBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the sharefileserver that can be bound to vpnglobal. .PARAMETER GetAll Retrieve all vpnglobal_sharefileserver_binding object(s). .PARAMETER Count If specified, the count of the vpnglobal_sharefileserver_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-NSGetVpnglobalSharefileserverBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalSharefileserverBinding -GetAll Get all vpnglobal_sharefileserver_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalSharefileserverBinding -Count Get the number of vpnglobal_sharefileserver_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalSharefileserverBinding -name <string> Get vpnglobal_sharefileserver_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalSharefileserverBinding -Filter @{ 'name'='<value>' } Get vpnglobal_sharefileserver_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnglobalSharefileserverBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_sharefileserver_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 = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetVpnglobalSharefileserverBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnglobal_sharefileserver_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_sharefileserver_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 vpnglobal_sharefileserver_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_sharefileserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnglobal_sharefileserver_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_sharefileserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnglobal_sharefileserver_binding configuration for property ''" } else { Write-Verbose "Retrieving vpnglobal_sharefileserver_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_sharefileserver_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-NSGetVpnglobalSharefileserverBinding: Ended" } } function Invoke-NSAddVpnglobalSslcertkeyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the sslcertkey that can be bound to vpnglobal. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. An expression or other value specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE. .PARAMETER Certkeyname SSL certkey to use in signing tokens. Only RSA cert key is allowed. .PARAMETER Userdataencryptionkey Certificate to be used for encrypting user data like KB Question and Answers, Alternate Email Address, etc. .PARAMETER Cacert The name of the CA certificate binding. .PARAMETER Crlcheck The state of the CRL check parameter (Mandatory/Optional). Possible values = Mandatory, Optional .PARAMETER Ocspcheck The state of the OCSP check parameter (Mandatory/Optional). Possible values = Mandatory, Optional .PARAMETER PassThru Return details about the created vpnglobal_sslcertkey_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnglobalSslcertkeyBinding An example how to add vpnglobal_sslcertkey_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnglobalSslcertkeyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_sslcertkey_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), [string]$Gotopriorityexpression, [string]$Certkeyname, [string]$Userdataencryptionkey, [string]$Cacert, [ValidateSet('Mandatory', 'Optional')] [string]$Crlcheck, [ValidateSet('Mandatory', 'Optional')] [string]$Ocspcheck, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnglobalSslcertkeyBinding: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('certkeyname') ) { $payload.Add('certkeyname', $certkeyname) } if ( $PSBoundParameters.ContainsKey('userdataencryptionkey') ) { $payload.Add('userdataencryptionkey', $userdataencryptionkey) } if ( $PSBoundParameters.ContainsKey('cacert') ) { $payload.Add('cacert', $cacert) } if ( $PSBoundParameters.ContainsKey('crlcheck') ) { $payload.Add('crlcheck', $crlcheck) } if ( $PSBoundParameters.ContainsKey('ocspcheck') ) { $payload.Add('ocspcheck', $ocspcheck) } if ( $PSCmdlet.ShouldProcess("vpnglobal_sslcertkey_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnglobal_sslcertkey_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-NSGetVpnglobalSslcertkeyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnglobalSslcertkeyBinding: Finished" } } function Invoke-NSDeleteVpnglobalSslcertkeyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the sslcertkey that can be bound to vpnglobal. .PARAMETER Certkeyname SSL certkey to use in signing tokens. Only RSA cert key is allowed. .PARAMETER Userdataencryptionkey Certificate to be used for encrypting user data like KB Question and Answers, Alternate Email Address, etc. .PARAMETER Cacert The name of the CA certificate binding. .EXAMPLE PS C:\>Invoke-NSDeleteVpnglobalSslcertkeyBinding An example how to delete vpnglobal_sslcertkey_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnglobalSslcertkeyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_sslcertkey_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), [string]$Certkeyname, [string]$Userdataencryptionkey, [string]$Cacert ) begin { Write-Verbose "Invoke-NSDeleteVpnglobalSslcertkeyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Certkeyname') ) { $arguments.Add('certkeyname', $Certkeyname) } if ( $PSBoundParameters.ContainsKey('Userdataencryptionkey') ) { $arguments.Add('userdataencryptionkey', $Userdataencryptionkey) } if ( $PSBoundParameters.ContainsKey('Cacert') ) { $arguments.Add('cacert', $Cacert) } if ( $PSCmdlet.ShouldProcess("vpnglobal_sslcertkey_binding", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnglobal_sslcertkey_binding -NitroPath nitro/v1/config -Resource $ -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-NSDeleteVpnglobalSslcertkeyBinding: Finished" } } function Invoke-NSGetVpnglobalSslcertkeyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the sslcertkey that can be bound to vpnglobal. .PARAMETER GetAll Retrieve all vpnglobal_sslcertkey_binding object(s). .PARAMETER Count If specified, the count of the vpnglobal_sslcertkey_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-NSGetVpnglobalSslcertkeyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalSslcertkeyBinding -GetAll Get all vpnglobal_sslcertkey_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalSslcertkeyBinding -Count Get the number of vpnglobal_sslcertkey_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalSslcertkeyBinding -name <string> Get vpnglobal_sslcertkey_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalSslcertkeyBinding -Filter @{ 'name'='<value>' } Get vpnglobal_sslcertkey_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnglobalSslcertkeyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_sslcertkey_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 = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetVpnglobalSslcertkeyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnglobal_sslcertkey_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_sslcertkey_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 vpnglobal_sslcertkey_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_sslcertkey_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnglobal_sslcertkey_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_sslcertkey_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnglobal_sslcertkey_binding configuration for property ''" } else { Write-Verbose "Retrieving vpnglobal_sslcertkey_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_sslcertkey_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-NSGetVpnglobalSslcertkeyBinding: Ended" } } function Invoke-NSAddVpnglobalStaserverBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the staserver that can be bound to vpnglobal. .PARAMETER Staserver Configured Secure Ticketing Authority (STA) server. .PARAMETER Staaddresstype Type of the STA server address(ipv4/v6). Possible values = IPV4, IPV6 .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. An expression or other value specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE. .PARAMETER PassThru Return details about the created vpnglobal_staserver_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnglobalStaserverBinding An example how to add vpnglobal_staserver_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnglobalStaserverBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_staserver_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), [string]$Staserver, [ValidateSet('IPV4', 'IPV6')] [string]$Staaddresstype, [string]$Gotopriorityexpression, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnglobalStaserverBinding: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('staserver') ) { $payload.Add('staserver', $staserver) } if ( $PSBoundParameters.ContainsKey('staaddresstype') ) { $payload.Add('staaddresstype', $staaddresstype) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSCmdlet.ShouldProcess("vpnglobal_staserver_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnglobal_staserver_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-NSGetVpnglobalStaserverBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnglobalStaserverBinding: Finished" } } function Invoke-NSDeleteVpnglobalStaserverBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the staserver that can be bound to vpnglobal. .PARAMETER Staserver Configured Secure Ticketing Authority (STA) server. .EXAMPLE PS C:\>Invoke-NSDeleteVpnglobalStaserverBinding An example how to delete vpnglobal_staserver_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnglobalStaserverBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_staserver_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), [string]$Staserver ) begin { Write-Verbose "Invoke-NSDeleteVpnglobalStaserverBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Staserver') ) { $arguments.Add('staserver', $Staserver) } if ( $PSCmdlet.ShouldProcess("vpnglobal_staserver_binding", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnglobal_staserver_binding -NitroPath nitro/v1/config -Resource $ -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-NSDeleteVpnglobalStaserverBinding: Finished" } } function Invoke-NSGetVpnglobalStaserverBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the staserver that can be bound to vpnglobal. .PARAMETER GetAll Retrieve all vpnglobal_staserver_binding object(s). .PARAMETER Count If specified, the count of the vpnglobal_staserver_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-NSGetVpnglobalStaserverBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalStaserverBinding -GetAll Get all vpnglobal_staserver_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalStaserverBinding -Count Get the number of vpnglobal_staserver_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalStaserverBinding -name <string> Get vpnglobal_staserver_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalStaserverBinding -Filter @{ 'name'='<value>' } Get vpnglobal_staserver_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnglobalStaserverBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_staserver_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 = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetVpnglobalStaserverBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnglobal_staserver_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_staserver_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 vpnglobal_staserver_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_staserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnglobal_staserver_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_staserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnglobal_staserver_binding configuration for property ''" } else { Write-Verbose "Retrieving vpnglobal_staserver_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_staserver_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-NSGetVpnglobalStaserverBinding: Ended" } } function Invoke-NSAddVpnglobalVpnclientlessaccesspolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnclientlessaccesspolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Priority Integer specifying the policy's priority. The lower the priority number, the higher the policy's priority. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. An expression or other value specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE. .PARAMETER PassThru Return details about the created vpnglobal_vpnclientlessaccesspolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnglobalVpnclientlessaccesspolicyBinding An example how to add vpnglobal_vpnclientlessaccesspolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnglobalVpnclientlessaccesspolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_vpnclientlessaccesspolicy_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), [string]$Policyname, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnglobalVpnclientlessaccesspolicyBinding: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('policyname') ) { $payload.Add('policyname', $policyname) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSCmdlet.ShouldProcess("vpnglobal_vpnclientlessaccesspolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnglobal_vpnclientlessaccesspolicy_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-NSGetVpnglobalVpnclientlessaccesspolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnglobalVpnclientlessaccesspolicyBinding: Finished" } } function Invoke-NSDeleteVpnglobalVpnclientlessaccesspolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnclientlessaccesspolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .EXAMPLE PS C:\>Invoke-NSDeleteVpnglobalVpnclientlessaccesspolicyBinding An example how to delete vpnglobal_vpnclientlessaccesspolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnglobalVpnclientlessaccesspolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_vpnclientlessaccesspolicy_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), [string]$Policyname, [boolean]$Secondary, [boolean]$Groupextraction ) begin { Write-Verbose "Invoke-NSDeleteVpnglobalVpnclientlessaccesspolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policyname') ) { $arguments.Add('policyname', $Policyname) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSCmdlet.ShouldProcess("vpnglobal_vpnclientlessaccesspolicy_binding", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnglobal_vpnclientlessaccesspolicy_binding -NitroPath nitro/v1/config -Resource $ -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-NSDeleteVpnglobalVpnclientlessaccesspolicyBinding: Finished" } } function Invoke-NSGetVpnglobalVpnclientlessaccesspolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the vpnclientlessaccesspolicy that can be bound to vpnglobal. .PARAMETER GetAll Retrieve all vpnglobal_vpnclientlessaccesspolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnglobal_vpnclientlessaccesspolicy_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-NSGetVpnglobalVpnclientlessaccesspolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpnclientlessaccesspolicyBinding -GetAll Get all vpnglobal_vpnclientlessaccesspolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpnclientlessaccesspolicyBinding -Count Get the number of vpnglobal_vpnclientlessaccesspolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpnclientlessaccesspolicyBinding -name <string> Get vpnglobal_vpnclientlessaccesspolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpnclientlessaccesspolicyBinding -Filter @{ 'name'='<value>' } Get vpnglobal_vpnclientlessaccesspolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnglobalVpnclientlessaccesspolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_vpnclientlessaccesspolicy_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 = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetVpnglobalVpnclientlessaccesspolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnglobal_vpnclientlessaccesspolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpnclientlessaccesspolicy_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 vpnglobal_vpnclientlessaccesspolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpnclientlessaccesspolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnglobal_vpnclientlessaccesspolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpnclientlessaccesspolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnglobal_vpnclientlessaccesspolicy_binding configuration for property ''" } else { Write-Verbose "Retrieving vpnglobal_vpnclientlessaccesspolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpnclientlessaccesspolicy_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-NSGetVpnglobalVpnclientlessaccesspolicyBinding: Ended" } } function Invoke-NSAddVpnglobalVpneulaBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpneula that can be bound to vpnglobal. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. An expression or other value specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE. .PARAMETER Eula Name of the EULA bound to vpnglobal. .PARAMETER PassThru Return details about the created vpnglobal_vpneula_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnglobalVpneulaBinding An example how to add vpnglobal_vpneula_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnglobalVpneulaBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_vpneula_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), [string]$Gotopriorityexpression, [string]$Eula, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnglobalVpneulaBinding: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('eula') ) { $payload.Add('eula', $eula) } if ( $PSCmdlet.ShouldProcess("vpnglobal_vpneula_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnglobal_vpneula_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-NSGetVpnglobalVpneulaBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnglobalVpneulaBinding: Finished" } } function Invoke-NSDeleteVpnglobalVpneulaBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpneula that can be bound to vpnglobal. .PARAMETER Eula Name of the EULA bound to vpnglobal. .EXAMPLE PS C:\>Invoke-NSDeleteVpnglobalVpneulaBinding An example how to delete vpnglobal_vpneula_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnglobalVpneulaBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_vpneula_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), [string]$Eula ) begin { Write-Verbose "Invoke-NSDeleteVpnglobalVpneulaBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Eula') ) { $arguments.Add('eula', $Eula) } if ( $PSCmdlet.ShouldProcess("vpnglobal_vpneula_binding", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnglobal_vpneula_binding -NitroPath nitro/v1/config -Resource $ -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-NSDeleteVpnglobalVpneulaBinding: Finished" } } function Invoke-NSGetVpnglobalVpneulaBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the vpneula that can be bound to vpnglobal. .PARAMETER GetAll Retrieve all vpnglobal_vpneula_binding object(s). .PARAMETER Count If specified, the count of the vpnglobal_vpneula_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-NSGetVpnglobalVpneulaBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpneulaBinding -GetAll Get all vpnglobal_vpneula_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpneulaBinding -Count Get the number of vpnglobal_vpneula_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpneulaBinding -name <string> Get vpnglobal_vpneula_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpneulaBinding -Filter @{ 'name'='<value>' } Get vpnglobal_vpneula_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnglobalVpneulaBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_vpneula_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 = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetVpnglobalVpneulaBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnglobal_vpneula_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpneula_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 vpnglobal_vpneula_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpneula_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnglobal_vpneula_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpneula_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnglobal_vpneula_binding configuration for property ''" } else { Write-Verbose "Retrieving vpnglobal_vpneula_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpneula_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-NSGetVpnglobalVpneulaBinding: Ended" } } function Invoke-NSAddVpnglobalVpnintranetapplicationBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnintranetapplication that can be bound to vpnglobal. .PARAMETER Intranetapplication The intranet vpn application. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. An expression or other value specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE. .PARAMETER PassThru Return details about the created vpnglobal_vpnintranetapplication_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnglobalVpnintranetapplicationBinding An example how to add vpnglobal_vpnintranetapplication_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnglobalVpnintranetapplicationBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_vpnintranetapplication_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), [string]$Intranetapplication, [string]$Gotopriorityexpression, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnglobalVpnintranetapplicationBinding: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('intranetapplication') ) { $payload.Add('intranetapplication', $intranetapplication) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSCmdlet.ShouldProcess("vpnglobal_vpnintranetapplication_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnglobal_vpnintranetapplication_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-NSGetVpnglobalVpnintranetapplicationBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnglobalVpnintranetapplicationBinding: Finished" } } function Invoke-NSDeleteVpnglobalVpnintranetapplicationBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnintranetapplication that can be bound to vpnglobal. .PARAMETER Intranetapplication The intranet vpn application. .EXAMPLE PS C:\>Invoke-NSDeleteVpnglobalVpnintranetapplicationBinding An example how to delete vpnglobal_vpnintranetapplication_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnglobalVpnintranetapplicationBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_vpnintranetapplication_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), [string]$Intranetapplication ) begin { Write-Verbose "Invoke-NSDeleteVpnglobalVpnintranetapplicationBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Intranetapplication') ) { $arguments.Add('intranetapplication', $Intranetapplication) } if ( $PSCmdlet.ShouldProcess("vpnglobal_vpnintranetapplication_binding", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnglobal_vpnintranetapplication_binding -NitroPath nitro/v1/config -Resource $ -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-NSDeleteVpnglobalVpnintranetapplicationBinding: Finished" } } function Invoke-NSGetVpnglobalVpnintranetapplicationBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the vpnintranetapplication that can be bound to vpnglobal. .PARAMETER GetAll Retrieve all vpnglobal_vpnintranetapplication_binding object(s). .PARAMETER Count If specified, the count of the vpnglobal_vpnintranetapplication_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-NSGetVpnglobalVpnintranetapplicationBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpnintranetapplicationBinding -GetAll Get all vpnglobal_vpnintranetapplication_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpnintranetapplicationBinding -Count Get the number of vpnglobal_vpnintranetapplication_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpnintranetapplicationBinding -name <string> Get vpnglobal_vpnintranetapplication_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpnintranetapplicationBinding -Filter @{ 'name'='<value>' } Get vpnglobal_vpnintranetapplication_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnglobalVpnintranetapplicationBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_vpnintranetapplication_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 = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetVpnglobalVpnintranetapplicationBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnglobal_vpnintranetapplication_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpnintranetapplication_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 vpnglobal_vpnintranetapplication_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpnintranetapplication_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnglobal_vpnintranetapplication_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpnintranetapplication_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnglobal_vpnintranetapplication_binding configuration for property ''" } else { Write-Verbose "Retrieving vpnglobal_vpnintranetapplication_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpnintranetapplication_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-NSGetVpnglobalVpnintranetapplicationBinding: Ended" } } function Invoke-NSAddVpnglobalVpnnexthopserverBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnnexthopserver that can be bound to vpnglobal. .PARAMETER Nexthopserver The name of the next hop server bound to vpn global. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. An expression or other value specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE. .PARAMETER PassThru Return details about the created vpnglobal_vpnnexthopserver_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnglobalVpnnexthopserverBinding An example how to add vpnglobal_vpnnexthopserver_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnglobalVpnnexthopserverBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_vpnnexthopserver_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), [string]$Nexthopserver, [string]$Gotopriorityexpression, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnglobalVpnnexthopserverBinding: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('nexthopserver') ) { $payload.Add('nexthopserver', $nexthopserver) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSCmdlet.ShouldProcess("vpnglobal_vpnnexthopserver_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnglobal_vpnnexthopserver_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-NSGetVpnglobalVpnnexthopserverBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnglobalVpnnexthopserverBinding: Finished" } } function Invoke-NSDeleteVpnglobalVpnnexthopserverBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnnexthopserver that can be bound to vpnglobal. .PARAMETER Nexthopserver The name of the next hop server bound to vpn global. .EXAMPLE PS C:\>Invoke-NSDeleteVpnglobalVpnnexthopserverBinding An example how to delete vpnglobal_vpnnexthopserver_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnglobalVpnnexthopserverBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_vpnnexthopserver_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), [string]$Nexthopserver ) begin { Write-Verbose "Invoke-NSDeleteVpnglobalVpnnexthopserverBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Nexthopserver') ) { $arguments.Add('nexthopserver', $Nexthopserver) } if ( $PSCmdlet.ShouldProcess("vpnglobal_vpnnexthopserver_binding", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnglobal_vpnnexthopserver_binding -NitroPath nitro/v1/config -Resource $ -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-NSDeleteVpnglobalVpnnexthopserverBinding: Finished" } } function Invoke-NSGetVpnglobalVpnnexthopserverBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the vpnnexthopserver that can be bound to vpnglobal. .PARAMETER GetAll Retrieve all vpnglobal_vpnnexthopserver_binding object(s). .PARAMETER Count If specified, the count of the vpnglobal_vpnnexthopserver_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-NSGetVpnglobalVpnnexthopserverBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpnnexthopserverBinding -GetAll Get all vpnglobal_vpnnexthopserver_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpnnexthopserverBinding -Count Get the number of vpnglobal_vpnnexthopserver_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpnnexthopserverBinding -name <string> Get vpnglobal_vpnnexthopserver_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpnnexthopserverBinding -Filter @{ 'name'='<value>' } Get vpnglobal_vpnnexthopserver_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnglobalVpnnexthopserverBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_vpnnexthopserver_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 = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetVpnglobalVpnnexthopserverBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnglobal_vpnnexthopserver_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpnnexthopserver_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 vpnglobal_vpnnexthopserver_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpnnexthopserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnglobal_vpnnexthopserver_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpnnexthopserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnglobal_vpnnexthopserver_binding configuration for property ''" } else { Write-Verbose "Retrieving vpnglobal_vpnnexthopserver_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpnnexthopserver_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-NSGetVpnglobalVpnnexthopserverBinding: Ended" } } function Invoke-NSAddVpnglobalVpnportalthemeBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnportaltheme that can be bound to vpnglobal. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. An expression or other value specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE. .PARAMETER Portaltheme Name of the portal theme bound to vpnglobal. .PARAMETER PassThru Return details about the created vpnglobal_vpnportaltheme_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnglobalVpnportalthemeBinding An example how to add vpnglobal_vpnportaltheme_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnglobalVpnportalthemeBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_vpnportaltheme_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), [string]$Gotopriorityexpression, [string]$Portaltheme, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnglobalVpnportalthemeBinding: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('portaltheme') ) { $payload.Add('portaltheme', $portaltheme) } if ( $PSCmdlet.ShouldProcess("vpnglobal_vpnportaltheme_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnglobal_vpnportaltheme_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-NSGetVpnglobalVpnportalthemeBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnglobalVpnportalthemeBinding: Finished" } } function Invoke-NSDeleteVpnglobalVpnportalthemeBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnportaltheme that can be bound to vpnglobal. .PARAMETER Portaltheme Name of the portal theme bound to vpnglobal. .EXAMPLE PS C:\>Invoke-NSDeleteVpnglobalVpnportalthemeBinding An example how to delete vpnglobal_vpnportaltheme_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnglobalVpnportalthemeBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_vpnportaltheme_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), [string]$Portaltheme ) begin { Write-Verbose "Invoke-NSDeleteVpnglobalVpnportalthemeBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Portaltheme') ) { $arguments.Add('portaltheme', $Portaltheme) } if ( $PSCmdlet.ShouldProcess("vpnglobal_vpnportaltheme_binding", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnglobal_vpnportaltheme_binding -NitroPath nitro/v1/config -Resource $ -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-NSDeleteVpnglobalVpnportalthemeBinding: Finished" } } function Invoke-NSGetVpnglobalVpnportalthemeBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the vpnportaltheme that can be bound to vpnglobal. .PARAMETER GetAll Retrieve all vpnglobal_vpnportaltheme_binding object(s). .PARAMETER Count If specified, the count of the vpnglobal_vpnportaltheme_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-NSGetVpnglobalVpnportalthemeBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpnportalthemeBinding -GetAll Get all vpnglobal_vpnportaltheme_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpnportalthemeBinding -Count Get the number of vpnglobal_vpnportaltheme_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpnportalthemeBinding -name <string> Get vpnglobal_vpnportaltheme_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpnportalthemeBinding -Filter @{ 'name'='<value>' } Get vpnglobal_vpnportaltheme_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnglobalVpnportalthemeBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_vpnportaltheme_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 = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetVpnglobalVpnportalthemeBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnglobal_vpnportaltheme_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpnportaltheme_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 vpnglobal_vpnportaltheme_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpnportaltheme_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnglobal_vpnportaltheme_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpnportaltheme_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnglobal_vpnportaltheme_binding configuration for property ''" } else { Write-Verbose "Retrieving vpnglobal_vpnportaltheme_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpnportaltheme_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-NSGetVpnglobalVpnportalthemeBinding: Ended" } } function Invoke-NSAddVpnglobalVpnsessionpolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnsessionpolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Priority Integer specifying the policy's priority. The lower the priority number, the higher the policy's priority. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. An expression or other value specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE. .PARAMETER PassThru Return details about the created vpnglobal_vpnsessionpolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnglobalVpnsessionpolicyBinding An example how to add vpnglobal_vpnsessionpolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnglobalVpnsessionpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_vpnsessionpolicy_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), [string]$Policyname, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnglobalVpnsessionpolicyBinding: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('policyname') ) { $payload.Add('policyname', $policyname) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSCmdlet.ShouldProcess("vpnglobal_vpnsessionpolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnglobal_vpnsessionpolicy_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-NSGetVpnglobalVpnsessionpolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnglobalVpnsessionpolicyBinding: Finished" } } function Invoke-NSDeleteVpnglobalVpnsessionpolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnsessionpolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .EXAMPLE PS C:\>Invoke-NSDeleteVpnglobalVpnsessionpolicyBinding An example how to delete vpnglobal_vpnsessionpolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnglobalVpnsessionpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_vpnsessionpolicy_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), [string]$Policyname, [boolean]$Secondary, [boolean]$Groupextraction ) begin { Write-Verbose "Invoke-NSDeleteVpnglobalVpnsessionpolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policyname') ) { $arguments.Add('policyname', $Policyname) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSCmdlet.ShouldProcess("vpnglobal_vpnsessionpolicy_binding", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnglobal_vpnsessionpolicy_binding -NitroPath nitro/v1/config -Resource $ -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-NSDeleteVpnglobalVpnsessionpolicyBinding: Finished" } } function Invoke-NSGetVpnglobalVpnsessionpolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the vpnsessionpolicy that can be bound to vpnglobal. .PARAMETER GetAll Retrieve all vpnglobal_vpnsessionpolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnglobal_vpnsessionpolicy_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-NSGetVpnglobalVpnsessionpolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpnsessionpolicyBinding -GetAll Get all vpnglobal_vpnsessionpolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpnsessionpolicyBinding -Count Get the number of vpnglobal_vpnsessionpolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpnsessionpolicyBinding -name <string> Get vpnglobal_vpnsessionpolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpnsessionpolicyBinding -Filter @{ 'name'='<value>' } Get vpnglobal_vpnsessionpolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnglobalVpnsessionpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_vpnsessionpolicy_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 = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetVpnglobalVpnsessionpolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnglobal_vpnsessionpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpnsessionpolicy_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 vpnglobal_vpnsessionpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpnsessionpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnglobal_vpnsessionpolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpnsessionpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnglobal_vpnsessionpolicy_binding configuration for property ''" } else { Write-Verbose "Retrieving vpnglobal_vpnsessionpolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpnsessionpolicy_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-NSGetVpnglobalVpnsessionpolicyBinding: Ended" } } function Invoke-NSAddVpnglobalVpntrafficpolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpntrafficpolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Priority Integer specifying the policy's priority. The lower the priority number, the higher the policy's priority. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. An expression or other value specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE. .PARAMETER PassThru Return details about the created vpnglobal_vpntrafficpolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnglobalVpntrafficpolicyBinding An example how to add vpnglobal_vpntrafficpolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnglobalVpntrafficpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_vpntrafficpolicy_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), [string]$Policyname, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnglobalVpntrafficpolicyBinding: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('policyname') ) { $payload.Add('policyname', $policyname) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSCmdlet.ShouldProcess("vpnglobal_vpntrafficpolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnglobal_vpntrafficpolicy_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-NSGetVpnglobalVpntrafficpolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnglobalVpntrafficpolicyBinding: Finished" } } function Invoke-NSDeleteVpnglobalVpntrafficpolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpntrafficpolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .EXAMPLE PS C:\>Invoke-NSDeleteVpnglobalVpntrafficpolicyBinding An example how to delete vpnglobal_vpntrafficpolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnglobalVpntrafficpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_vpntrafficpolicy_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), [string]$Policyname, [boolean]$Secondary, [boolean]$Groupextraction ) begin { Write-Verbose "Invoke-NSDeleteVpnglobalVpntrafficpolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policyname') ) { $arguments.Add('policyname', $Policyname) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSCmdlet.ShouldProcess("vpnglobal_vpntrafficpolicy_binding", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnglobal_vpntrafficpolicy_binding -NitroPath nitro/v1/config -Resource $ -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-NSDeleteVpnglobalVpntrafficpolicyBinding: Finished" } } function Invoke-NSGetVpnglobalVpntrafficpolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the vpntrafficpolicy that can be bound to vpnglobal. .PARAMETER GetAll Retrieve all vpnglobal_vpntrafficpolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnglobal_vpntrafficpolicy_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-NSGetVpnglobalVpntrafficpolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpntrafficpolicyBinding -GetAll Get all vpnglobal_vpntrafficpolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpntrafficpolicyBinding -Count Get the number of vpnglobal_vpntrafficpolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpntrafficpolicyBinding -name <string> Get vpnglobal_vpntrafficpolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpntrafficpolicyBinding -Filter @{ 'name'='<value>' } Get vpnglobal_vpntrafficpolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnglobalVpntrafficpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_vpntrafficpolicy_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 = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetVpnglobalVpntrafficpolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnglobal_vpntrafficpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpntrafficpolicy_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 vpnglobal_vpntrafficpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpntrafficpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnglobal_vpntrafficpolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpntrafficpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnglobal_vpntrafficpolicy_binding configuration for property ''" } else { Write-Verbose "Retrieving vpnglobal_vpntrafficpolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpntrafficpolicy_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-NSGetVpnglobalVpntrafficpolicyBinding: Ended" } } function Invoke-NSAddVpnglobalVpnurlBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnurl that can be bound to vpnglobal. .PARAMETER Urlname The intranet url. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. An expression or other value specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE. .PARAMETER PassThru Return details about the created vpnglobal_vpnurl_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnglobalVpnurlBinding An example how to add vpnglobal_vpnurl_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnglobalVpnurlBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_vpnurl_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), [string]$Urlname, [string]$Gotopriorityexpression, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnglobalVpnurlBinding: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('urlname') ) { $payload.Add('urlname', $urlname) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSCmdlet.ShouldProcess("vpnglobal_vpnurl_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnglobal_vpnurl_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-NSGetVpnglobalVpnurlBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnglobalVpnurlBinding: Finished" } } function Invoke-NSDeleteVpnglobalVpnurlBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnurl that can be bound to vpnglobal. .PARAMETER Urlname The intranet url. .EXAMPLE PS C:\>Invoke-NSDeleteVpnglobalVpnurlBinding An example how to delete vpnglobal_vpnurl_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnglobalVpnurlBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_vpnurl_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), [string]$Urlname ) begin { Write-Verbose "Invoke-NSDeleteVpnglobalVpnurlBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Urlname') ) { $arguments.Add('urlname', $Urlname) } if ( $PSCmdlet.ShouldProcess("vpnglobal_vpnurl_binding", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnglobal_vpnurl_binding -NitroPath nitro/v1/config -Resource $ -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-NSDeleteVpnglobalVpnurlBinding: Finished" } } function Invoke-NSGetVpnglobalVpnurlBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the vpnurl that can be bound to vpnglobal. .PARAMETER GetAll Retrieve all vpnglobal_vpnurl_binding object(s). .PARAMETER Count If specified, the count of the vpnglobal_vpnurl_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-NSGetVpnglobalVpnurlBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpnurlBinding -GetAll Get all vpnglobal_vpnurl_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpnurlBinding -Count Get the number of vpnglobal_vpnurl_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpnurlBinding -name <string> Get vpnglobal_vpnurl_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpnurlBinding -Filter @{ 'name'='<value>' } Get vpnglobal_vpnurl_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnglobalVpnurlBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_vpnurl_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 = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetVpnglobalVpnurlBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnglobal_vpnurl_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpnurl_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 vpnglobal_vpnurl_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpnurl_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnglobal_vpnurl_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpnurl_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnglobal_vpnurl_binding configuration for property ''" } else { Write-Verbose "Retrieving vpnglobal_vpnurl_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpnurl_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-NSGetVpnglobalVpnurlBinding: Ended" } } function Invoke-NSAddVpnglobalVpnurlpolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnurlpolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Priority Integer specifying the policy's priority. The lower the priority number, the higher the policy's priority. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. An expression or other value specifying the priority of the next policy which will get evaluated if the current policy rule evaluates to TRUE. .PARAMETER PassThru Return details about the created vpnglobal_vpnurlpolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnglobalVpnurlpolicyBinding An example how to add vpnglobal_vpnurlpolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnglobalVpnurlpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_vpnurlpolicy_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), [string]$Policyname, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnglobalVpnurlpolicyBinding: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('policyname') ) { $payload.Add('policyname', $policyname) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSCmdlet.ShouldProcess("vpnglobal_vpnurlpolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnglobal_vpnurlpolicy_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-NSGetVpnglobalVpnurlpolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnglobalVpnurlpolicyBinding: Finished" } } function Invoke-NSDeleteVpnglobalVpnurlpolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnurlpolicy that can be bound to vpnglobal. .PARAMETER Policyname The name of the policy. .PARAMETER Secondary Bind the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only to a primary authentication server but also to a secondary authentication server. User groups are aggregated across both authentication servers. The user name must be exactly the same on both authentication servers, but the authentication servers can require different passwords. .PARAMETER Groupextraction Bind the Authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called it primary and/or secondary authentication has succeeded. .EXAMPLE PS C:\>Invoke-NSDeleteVpnglobalVpnurlpolicyBinding An example how to delete vpnglobal_vpnurlpolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnglobalVpnurlpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_vpnurlpolicy_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), [string]$Policyname, [boolean]$Secondary, [boolean]$Groupextraction ) begin { Write-Verbose "Invoke-NSDeleteVpnglobalVpnurlpolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policyname') ) { $arguments.Add('policyname', $Policyname) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSCmdlet.ShouldProcess("vpnglobal_vpnurlpolicy_binding", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnglobal_vpnurlpolicy_binding -NitroPath nitro/v1/config -Resource $ -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-NSDeleteVpnglobalVpnurlpolicyBinding: Finished" } } function Invoke-NSGetVpnglobalVpnurlpolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the vpnurlpolicy that can be bound to vpnglobal. .PARAMETER GetAll Retrieve all vpnglobal_vpnurlpolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnglobal_vpnurlpolicy_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-NSGetVpnglobalVpnurlpolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpnurlpolicyBinding -GetAll Get all vpnglobal_vpnurlpolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpnurlpolicyBinding -Count Get the number of vpnglobal_vpnurlpolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpnurlpolicyBinding -name <string> Get vpnglobal_vpnurlpolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnglobalVpnurlpolicyBinding -Filter @{ 'name'='<value>' } Get vpnglobal_vpnurlpolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnglobalVpnurlpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnglobal_vpnurlpolicy_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 = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll ) begin { Write-Verbose "Invoke-NSGetVpnglobalVpnurlpolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnglobal_vpnurlpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpnurlpolicy_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 vpnglobal_vpnurlpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpnurlpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnglobal_vpnurlpolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpnurlpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnglobal_vpnurlpolicy_binding configuration for property ''" } else { Write-Verbose "Retrieving vpnglobal_vpnurlpolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnglobal_vpnurlpolicy_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-NSGetVpnglobalVpnurlpolicyBinding: Ended" } } function Invoke-NSKillVpnicaconnection { <# .SYNOPSIS Kill Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for active ica connections resource. .PARAMETER Username User name for which to display connections. .PARAMETER Transproto Transport type for the existing Existing ICA conenction. Possible values = TCP, UDP .PARAMETER All Terminate all active icaconnections. .EXAMPLE PS C:\>Invoke-NSKillVpnicaconnection An example how to kill vpnicaconnection config Object(s). .NOTES File Name : Invoke-NSKillVpnicaconnection Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnicaconnection/ Requires : PowerShell v5.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]$Username, [ValidateSet('TCP', 'UDP')] [string]$Transproto, [boolean]$All ) begin { Write-Verbose "Invoke-NSKillVpnicaconnection: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('username') ) { $payload.Add('username', $username) } if ( $PSBoundParameters.ContainsKey('transproto') ) { $payload.Add('transproto', $transproto) } if ( $PSBoundParameters.ContainsKey('all') ) { $payload.Add('all', $all) } if ( $PSCmdlet.ShouldProcess($Name, "Kill Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type vpnicaconnection -Action kill -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-NSKillVpnicaconnection: Finished" } } function Invoke-NSGetVpnicaconnection { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Configuration for active ica connections resource. .PARAMETER Username User name for which to display connections. .PARAMETER Transproto Transport type for the existing Existing ICA conenction. Possible values = TCP, UDP .PARAMETER Nodeid Unique number that identifies the cluster node. Maximum value = 31 .PARAMETER GetAll Retrieve all vpnicaconnection object(s). .PARAMETER Count If specified, the count of the vpnicaconnection 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-NSGetVpnicaconnection Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnicaconnection -GetAll Get all vpnicaconnection data. .EXAMPLE PS C:\>Invoke-NSGetVpnicaconnection -Count Get the number of vpnicaconnection objects. .EXAMPLE PS C:\>Invoke-NSGetVpnicaconnection -name <string> Get vpnicaconnection object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnicaconnection -Filter @{ 'name'='<value>' } Get vpnicaconnection data with a filter. .NOTES File Name : Invoke-NSGetVpnicaconnection Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnicaconnection/ Requires : PowerShell v5.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]$Username, [Parameter(ParameterSetName = 'GetByArgument')] [ValidateSet('TCP', 'UDP')] [string]$Transproto, [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-NSGetVpnicaconnection: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all vpnicaconnection objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnicaconnection -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 vpnicaconnection objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnicaconnection -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnicaconnection objects by arguments" $arguments = @{ } if ( $PSBoundParameters.ContainsKey('username') ) { $arguments.Add('username', $username) } if ( $PSBoundParameters.ContainsKey('transproto') ) { $arguments.Add('transproto', $transproto) } if ( $PSBoundParameters.ContainsKey('nodeid') ) { $arguments.Add('nodeid', $nodeid) } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnicaconnection -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnicaconnection configuration for property ''" } else { Write-Verbose "Retrieving vpnicaconnection configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnicaconnection -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-NSGetVpnicaconnection: Ended" } } function Invoke-NSGetVpnicadtlsconnection { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Configuration for active ica connections resource. .PARAMETER Username User name for which to display connections. .PARAMETER Nodeid Unique number that identifies the cluster node. Maximum value = 31 .PARAMETER GetAll Retrieve all vpnicadtlsconnection object(s). .PARAMETER Count If specified, the count of the vpnicadtlsconnection 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-NSGetVpnicadtlsconnection Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnicadtlsconnection -GetAll Get all vpnicadtlsconnection data. .EXAMPLE PS C:\>Invoke-NSGetVpnicadtlsconnection -Count Get the number of vpnicadtlsconnection objects. .EXAMPLE PS C:\>Invoke-NSGetVpnicadtlsconnection -name <string> Get vpnicadtlsconnection object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnicadtlsconnection -Filter @{ 'name'='<value>' } Get vpnicadtlsconnection data with a filter. .NOTES File Name : Invoke-NSGetVpnicadtlsconnection Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnicadtlsconnection/ Requires : PowerShell v5.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]$Username, [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-NSGetVpnicadtlsconnection: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all vpnicadtlsconnection objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnicadtlsconnection -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 vpnicadtlsconnection objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnicadtlsconnection -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnicadtlsconnection objects by arguments" $arguments = @{ } if ( $PSBoundParameters.ContainsKey('username') ) { $arguments.Add('username', $username) } if ( $PSBoundParameters.ContainsKey('nodeid') ) { $arguments.Add('nodeid', $nodeid) } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnicadtlsconnection -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnicadtlsconnection configuration for property ''" } else { Write-Verbose "Retrieving vpnicadtlsconnection configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnicadtlsconnection -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-NSGetVpnicadtlsconnection: Ended" } } function Invoke-NSAddVpnintranetapplication { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for SSLVPN intranet application resource. .PARAMETER Intranetapplication Name of the intranet application. .PARAMETER Protocol Protocol used by the intranet application. If protocol is set to BOTH, TCP and UDP traffic is allowed. Possible values = TCP, UDP, ANY .PARAMETER Destip Destination IP address, IP range, or host name of the intranet application. This address is the server IP address. .PARAMETER Netmask Destination subnet mask for the intranet application. .PARAMETER Iprange If you have multiple servers in your network, such as web, email, and file shares, configure an intranet application that includes the IP range for all the network applications. This allows users to access all the intranet applications contained in the IP address range. .PARAMETER Hostname Name of the host for which to configure interception. The names are resolved during interception when users log on with the Citrix Gateway Plug-in. .PARAMETER Clientapplication Names of the client applications, such as PuTTY and Xshell. .PARAMETER Spoofiip IP address that the intranet application will use to route the connection through the virtual adapter. Possible values = ON, OFF .PARAMETER Destport Destination TCP or UDP port number for the intranet application. Use a hyphen to specify a range of port numbers, for example 90-95. .PARAMETER Interception Interception mode for the intranet application or resource. Correct value depends on the type of client software used to make connections. If the interception mode is set to TRANSPARENT, users connect with the Citrix Gateway Plug-in for Windows. With the PROXY setting, users connect with the Citrix Gateway Plug-in for Java. Possible values = PROXY, TRANSPARENT .PARAMETER Srcip Source IP address. Required if interception mode is set to PROXY. Default is the loopback address, 127.0.0.1. .PARAMETER Srcport Source port for the application for which the Citrix Gateway virtual server proxies the traffic. If users are connecting from a device that uses the Citrix Gateway Plug-in for Java, applications must be configured manually by using the source IP address and TCP port values specified in the intranet application profile. If a port value is not set, the destination port value is used. .PARAMETER PassThru Return details about the created vpnintranetapplication item. .EXAMPLE PS C:\>Invoke-NSAddVpnintranetapplication -intranetapplication <string> An example how to add vpnintranetapplication config Object(s). .NOTES File Name : Invoke-NSAddVpnintranetapplication Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnintranetapplication/ Requires : PowerShell v5.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]$Intranetapplication, [ValidateSet('TCP', 'UDP', 'ANY')] [string]$Protocol, [ValidateScript({ $_.Length -gt 1 })] [string]$Destip, [string]$Netmask, [ValidateScript({ $_.Length -gt 1 })] [string]$Iprange, [ValidateScript({ $_.Length -gt 1 })] [string]$Hostname, [ValidateScript({ $_.Length -gt 1 })] [string[]]$Clientapplication, [ValidateSet('ON', 'OFF')] [string]$Spoofiip = 'ON', [ValidateScript({ $_.Length -gt 1 })] [string]$Destport, [ValidateSet('PROXY', 'TRANSPARENT')] [string]$Interception, [ValidateScript({ $_.Length -gt 1 })] [string]$Srcip, [int]$Srcport, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnintranetapplication: Starting" } process { try { $payload = @{ intranetapplication = $intranetapplication } if ( $PSBoundParameters.ContainsKey('protocol') ) { $payload.Add('protocol', $protocol) } if ( $PSBoundParameters.ContainsKey('destip') ) { $payload.Add('destip', $destip) } if ( $PSBoundParameters.ContainsKey('netmask') ) { $payload.Add('netmask', $netmask) } if ( $PSBoundParameters.ContainsKey('iprange') ) { $payload.Add('iprange', $iprange) } if ( $PSBoundParameters.ContainsKey('hostname') ) { $payload.Add('hostname', $hostname) } if ( $PSBoundParameters.ContainsKey('clientapplication') ) { $payload.Add('clientapplication', $clientapplication) } if ( $PSBoundParameters.ContainsKey('spoofiip') ) { $payload.Add('spoofiip', $spoofiip) } if ( $PSBoundParameters.ContainsKey('destport') ) { $payload.Add('destport', $destport) } if ( $PSBoundParameters.ContainsKey('interception') ) { $payload.Add('interception', $interception) } if ( $PSBoundParameters.ContainsKey('srcip') ) { $payload.Add('srcip', $srcip) } if ( $PSBoundParameters.ContainsKey('srcport') ) { $payload.Add('srcport', $srcport) } if ( $PSCmdlet.ShouldProcess("vpnintranetapplication", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type vpnintranetapplication -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-NSGetVpnintranetapplication -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnintranetapplication: Finished" } } function Invoke-NSDeleteVpnintranetapplication { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for SSLVPN intranet application resource. .PARAMETER Intranetapplication Name of the intranet application. .EXAMPLE PS C:\>Invoke-NSDeleteVpnintranetapplication -Intranetapplication <string> An example how to delete vpnintranetapplication config Object(s). .NOTES File Name : Invoke-NSDeleteVpnintranetapplication Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnintranetapplication/ Requires : PowerShell v5.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]$Intranetapplication ) begin { Write-Verbose "Invoke-NSDeleteVpnintranetapplication: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$intranetapplication", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnintranetapplication -NitroPath nitro/v1/config -Resource $intranetapplication -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-NSDeleteVpnintranetapplication: Finished" } } function Invoke-NSGetVpnintranetapplication { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Configuration for SSLVPN intranet application resource. .PARAMETER Intranetapplication Name of the intranet application. .PARAMETER GetAll Retrieve all vpnintranetapplication object(s). .PARAMETER Count If specified, the count of the vpnintranetapplication 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-NSGetVpnintranetapplication Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnintranetapplication -GetAll Get all vpnintranetapplication data. .EXAMPLE PS C:\>Invoke-NSGetVpnintranetapplication -Count Get the number of vpnintranetapplication objects. .EXAMPLE PS C:\>Invoke-NSGetVpnintranetapplication -name <string> Get vpnintranetapplication object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnintranetapplication -Filter @{ 'name'='<value>' } Get vpnintranetapplication data with a filter. .NOTES File Name : Invoke-NSGetVpnintranetapplication Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnintranetapplication/ Requires : PowerShell v5.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]$Intranetapplication, [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-NSGetVpnintranetapplication: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all vpnintranetapplication objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnintranetapplication -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 vpnintranetapplication objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnintranetapplication -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnintranetapplication objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnintranetapplication -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnintranetapplication configuration for property 'intranetapplication'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnintranetapplication -NitroPath nitro/v1/config -Resource $intranetapplication -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnintranetapplication configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnintranetapplication -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-NSGetVpnintranetapplication: Ended" } } function Invoke-NSAddVpnnexthopserver { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for Next Hop Server resource. .PARAMETER Name Name for the Citrix Gateway appliance in the first DMZ. .PARAMETER Nexthopip IP address of the Citrix Gateway proxy in the second DMZ. .PARAMETER Nexthopfqdn FQDN of the Citrix Gateway proxy in the second DMZ. .PARAMETER Resaddresstype Address Type (IPV4/IPv6) of DNS name of nextHopServer FQDN. Possible values = IPV4, IPV6 .PARAMETER Nexthopport Port number of the Citrix Gateway proxy in the second DMZ. Maximum value = 65535 .PARAMETER Secure Use of a secure port, such as 443, for the double-hop configuration. Possible values = ON, OFF .PARAMETER PassThru Return details about the created vpnnexthopserver item. .EXAMPLE PS C:\>Invoke-NSAddVpnnexthopserver -name <string> -nexthopport <int> An example how to add vpnnexthopserver config Object(s). .NOTES File Name : Invoke-NSAddVpnnexthopserver Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnnexthopserver/ Requires : PowerShell v5.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, 32)] [string]$Name, [string]$Nexthopip, [ValidateScript({ $_.Length -gt 1 })] [string]$Nexthopfqdn, [ValidateScript({ $_.Length -gt 1 })] [ValidateSet('IPV4', 'IPV6')] [string]$Resaddresstype, [Parameter(Mandatory)] [int]$Nexthopport, [ValidateSet('ON', 'OFF')] [string]$Secure = 'OFF', [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnnexthopserver: Starting" } process { try { $payload = @{ name = $name nexthopport = $nexthopport } if ( $PSBoundParameters.ContainsKey('nexthopip') ) { $payload.Add('nexthopip', $nexthopip) } if ( $PSBoundParameters.ContainsKey('nexthopfqdn') ) { $payload.Add('nexthopfqdn', $nexthopfqdn) } if ( $PSBoundParameters.ContainsKey('resaddresstype') ) { $payload.Add('resaddresstype', $resaddresstype) } if ( $PSBoundParameters.ContainsKey('secure') ) { $payload.Add('secure', $secure) } if ( $PSCmdlet.ShouldProcess("vpnnexthopserver", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type vpnnexthopserver -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-NSGetVpnnexthopserver -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnnexthopserver: Finished" } } function Invoke-NSDeleteVpnnexthopserver { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for Next Hop Server resource. .PARAMETER Name Name for the Citrix Gateway appliance in the first DMZ. .EXAMPLE PS C:\>Invoke-NSDeleteVpnnexthopserver -Name <string> An example how to delete vpnnexthopserver config Object(s). .NOTES File Name : Invoke-NSDeleteVpnnexthopserver Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnnexthopserver/ Requires : PowerShell v5.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-NSDeleteVpnnexthopserver: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnnexthopserver -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-NSDeleteVpnnexthopserver: Finished" } } function Invoke-NSGetVpnnexthopserver { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Configuration for Next Hop Server resource. .PARAMETER Name Name for the Citrix Gateway appliance in the first DMZ. .PARAMETER GetAll Retrieve all vpnnexthopserver object(s). .PARAMETER Count If specified, the count of the vpnnexthopserver 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-NSGetVpnnexthopserver Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnnexthopserver -GetAll Get all vpnnexthopserver data. .EXAMPLE PS C:\>Invoke-NSGetVpnnexthopserver -Count Get the number of vpnnexthopserver objects. .EXAMPLE PS C:\>Invoke-NSGetVpnnexthopserver -name <string> Get vpnnexthopserver object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnnexthopserver -Filter @{ 'name'='<value>' } Get vpnnexthopserver data with a filter. .NOTES File Name : Invoke-NSGetVpnnexthopserver Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnnexthopserver/ Requires : PowerShell v5.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, 32)] [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-NSGetVpnnexthopserver: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all vpnnexthopserver objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnnexthopserver -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 vpnnexthopserver objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnnexthopserver -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnnexthopserver objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnnexthopserver -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnnexthopserver configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnnexthopserver -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnnexthopserver configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnnexthopserver -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-NSGetVpnnexthopserver: Ended" } } function Invoke-NSUpdateVpnparameter { <# .SYNOPSIS Update Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN parameter resource. .PARAMETER Httpport Destination port numbers other than port 80, added as a comma-separated list. Traffic to these ports is processed as HTTP traffic, which allows functionality, such as HTTP authorization and single sign-on to a web application to work. .PARAMETER Winsip WINS server IP address to add to Citrix Gateway for name resolution. .PARAMETER Dnsvservername Name of the DNS virtual server for the user session. .PARAMETER Splitdns Route the DNS requests to the local DNS server configured on the user device, or Citrix Gateway (remote), or both. Possible values = LOCAL, REMOTE, BOTH .PARAMETER Icauseraccounting The name of the radiusPolicy to use for RADIUS user accounting info on the session. .PARAMETER Sesstimeout Number of minutes after which the session times out. Maximum value = 65535 .PARAMETER Clientsecurity Specify the client security check for the user device to permit a Citrix Gateway session. The web address or IP address is not included in the expression for the client security check. .PARAMETER Clientsecuritygroup The client security group that will be assigned on failure of the client security check. Users can in general be organized into Groups. In this case, the Client Security Group may have a more restrictive security policy. .PARAMETER Clientsecuritymessage The client security message that will be displayed on failure of the client security check. .PARAMETER Clientsecuritylog Specifies whether or not to display all failed Client Security scans to the end user. Possible values = ON, OFF .PARAMETER Smartgroup This is the default group that is chosen when the authentication succeeds in addition to extracted groups. .PARAMETER Splittunnel Send, through the tunnel, traffic only for intranet applications that are defined in Citrix Gateway. Route all other traffic directly to the Internet. The OFF setting routes all traffic through Citrix Gateway. With the REVERSE setting, intranet applications define the network traffic that is not intercepted. All network traffic directed to internal IP addresses bypasses the VPN tunnel, while other traffic goes through Citrix Gateway. Reverse split tunneling can be used to log all non-local LAN traffic. For example, if users have a home network and are logged on through the Citrix Gateway Plug-in, network traffic destined to a printer or another device within the home network is not intercepted. Possible values = ON, OFF, REVERSE .PARAMETER Locallanaccess Set local LAN access. If split tunneling is OFF, and you set local LAN access to ON, the local client can route traffic to its local interface. When the local area network switch is specified, this combination of switches is useful. The client can allow local LAN access to devices that commonly have non-routable addresses, such as local printers or local file servers. Possible values = ON, OFF, FORCED .PARAMETER Rfc1918 As defined in the local area network, allow only the following local area network addresses to bypass the VPN tunnel when the local LAN access feature is enabled: * 10.*.*.*, * 172.16.*.*, * 192.168.*.*. Possible values = ON, OFF .PARAMETER Spoofiip Indicate whether or not the application requires IP spoofing, which routes the connection to the intranet application through the virtual adapter. Possible values = ON, OFF .PARAMETER Killconnections Specify whether the Citrix Gateway Plug-in should disconnect all preexisting connections, such as the connections existing before the user logged on to Citrix Gateway, and prevent new incoming connections on the Citrix Gateway Plug-in for Windows and MAC when the user is connected to Citrix Gateway and split tunneling is disabled. Possible values = ON, OFF .PARAMETER Transparentinterception Allow access to network resources by using a single IP address and subnet mask or a range of IP addresses. The OFF setting sets the mode to proxy, in which you configure destination and source IP addresses and port numbers. If you are using the Citrix Gateway Plug-in for Windows, set this parameter to ON, in which the mode is set to transparent. If you are using the Citrix Gateway Plug-in for Java, set this parameter to OFF. Possible values = ON, OFF .PARAMETER Windowsclienttype The Windows client type. Choose between two types of Windows Client\ a) Application Agent - which always runs in the task bar as a standalone application and also has a supporting service which runs permanently when installed\ b) Activex Control - ActiveX control run by Microsoft Internet Explorer. Possible values = AGENT, PLUGIN .PARAMETER Defaultauthorizationaction Specify the network resources that users have access to when they log on to the internal network. The default setting for authorization is to deny access to all network resources. Citrix recommends using the default global setting and then creating authorization policies to define the network resources users can access. If you set the default authorization policy to DENY, you must explicitly authorize access to any network resource, which improves security. Possible values = ALLOW, DENY .PARAMETER Authorizationgroup Comma-separated list of groups in which the user is placed when none of the groups that the user is a part of is configured on Citrix Gateway. The authorization policy can be bound to these groups to control access to the resources. .PARAMETER Clientidletimeout Time, in minutes, after which to time out the user session if Citrix Gateway does not detect mouse or keyboard activity. Maximum value = 9999 .PARAMETER Proxy Set options to apply proxy for accessing the internal resources. Available settings function as follows: * BROWSER - Proxy settings are configured only in Internet Explorer and Firefox browsers. * NS - Proxy settings are configured on the Citrix ADC. * OFF - Proxy settings are not configured. Possible values = BROWSER, NS, OFF .PARAMETER Allprotocolproxy IP address of the proxy server to use for all protocols supported by Citrix Gateway. .PARAMETER Httpproxy IP address of the proxy server to be used for HTTP access for all subsequent connections to the internal network. .PARAMETER Ftpproxy IP address of the proxy server to be used for FTP access for all subsequent connections to the internal network. .PARAMETER Socksproxy IP address of the proxy server to be used for SOCKS access for all subsequent connections to the internal network. .PARAMETER Gopherproxy IP address of the proxy server to be used for GOPHER access for all subsequent connections to the internal network. .PARAMETER Sslproxy IP address of the proxy server to be used for SSL access for all subsequent connections to the internal network. .PARAMETER Proxyexception Proxy exception string that will be configured in the browser for bypassing the previously configured proxies. Allowed only if proxy type is Browser. .PARAMETER Proxylocalbypass Bypass proxy server for local addresses option in Internet Explorer and Firefox proxy server settings. Possible values = ENABLED, DISABLED .PARAMETER Clientcleanupprompt Prompt for client-side cache clean-up when a client-initiated session closes. Possible values = ON, OFF .PARAMETER Forcecleanup Force cache clean-up when the user closes a session. You can specify all, none, or any combination of the client-side items. Possible values = none, all, cookie, addressbar, plugin, filesystemapplication, application, applicationdata, clientcertificate, autocomplete, cache .PARAMETER Clientoptions Display only the configured menu options when you select the "Configure Citrix Gateway" option in the Citrix Gateway Plug-in's system tray icon for Windows. Possible values = none, all, services, filetransfer, configuration .PARAMETER Clientconfiguration Allow users to change client Debug logging level in Configuration tab of the Citrix Gateway Plug-in for Windows. Possible values = none, trace .PARAMETER Sso Set single sign-on (SSO) for the session. When the user accesses a server, the user's logon credentials are passed to the server for authentication. NOTE : This configuration does not honor the following authentication types for security reason. BASIC, DIGEST, and NTLM (without Negotiate NTLM2 Key or Negotiate Sign Flag). Use VPN TrafficAction to configure SSO for these authentication types. Possible values = ON, OFF .PARAMETER Ssocredential Specify whether to use the primary or secondary authentication credentials for single sign-on to the server. Possible values = PRIMARY, SECONDARY .PARAMETER Windowsautologon Enable or disable the Windows Auto Logon for the session. If a VPN session is established after this setting is enabled, the user is automatically logged on by using Windows credentials after the system is restarted. Possible values = ON, OFF .PARAMETER Usemip Enable or disable the use of a unique IP address alias, or a mapped IP address, as the client IP address for each client session. Allow Citrix Gateway to use the mapped IP address as an intranet IP address when all other IP addresses are not available. When IP pooling is configured and the mapped IP is used as an intranet IP address, the mapped IP address is used when an intranet IP address cannot be assigned. Possible values = NS, OFF .PARAMETER Useiip Define IP address pool options. Available settings function as follows: * SPILLOVER - When an address pool is configured and the mapped IP is used as an intranet IP address, the mapped IP address is used when an intranet IP address cannot be assigned. * NOSPILLOVER - When intranet IP addresses are enabled and the mapped IP address is not used, the Transfer Login page appears for users who have used all available intranet IP addresses. * OFF - Address pool is not configured. Possible values = NOSPILLOVER, SPILLOVER, OFF .PARAMETER Clientdebug Set the trace level on Citrix Gateway. Technical support technicians use these debug logs for in-depth debugging and troubleshooting purposes. Available settings function as follows: * DEBUG - Detailed debug messages are collected and written into the specified file. * STATS - Application audit level error messages and debug statistic counters are written into the specified file. * EVENTS - Application audit-level error messages are written into the specified file. * OFF - Only critical events are logged into the Windows Application Log. Possible values = debug, stats, events, OFF .PARAMETER Loginscript Path to the logon script that is run when a session is established. Separate multiple scripts by using comma. A "$" in the path signifies that the word following the "$" is an environment variable. .PARAMETER Logoutscript Path to the logout script. Separate multiple scripts by using comma. A "$" in the path signifies that the word following the "$" is an environment variable. .PARAMETER Homepage Web address of the home page that appears when users log on. Otherwise, users receive the default home page for Citrix Gateway, which is the Access Interface. .PARAMETER Icaproxy Enable ICA proxy to configure secure Internet access to servers running Citrix XenApp or XenDesktop by using Citrix Receiver instead of the Citrix Gateway Plug-in. Possible values = ON, OFF .PARAMETER Wihome Web address of the Web Interface server, such as http://<ipAddress>/Citrix/XenApp, or Receiver for Web, which enumerates the virtualized resources, such as XenApp, XenDesktop, and cloud applications. This web address is used as the home page in ICA proxy mode. If Client Choices is ON, you must configure this setting. Because the user can choose between FullClient and ICAProxy, the user may see a different home page. An Internet web site may appear if the user gets the FullClient option, or a Web Interface site if the user gets the ICAProxy option. If the setting is not configured, the XenApp option does not appear as a client choice. .PARAMETER Wihomeaddresstype Type of the wihome address(IPV4/V6). Possible values = IPV4, IPV6 .PARAMETER Citrixreceiverhome Web address for the Citrix Receiver home page. Configure Citrix Gateway so that when users log on to the appliance, the Citrix Gateway Plug-in opens a web browser that allows single sign-on to the Citrix Receiver home page. .PARAMETER Wiportalmode Layout on the Access Interface. The COMPACT value indicates the use of small icons. Possible values = NORMAL, COMPACT .PARAMETER Clientchoices Provide users with multiple logon options. With client choices, users have the option of logging on by using the Citrix Gateway Plug-in for Windows, Citrix Gateway Plug-in for Java, the Web Interface, or clientless access from one location. Depending on how Citrix Gateway is configured, users are presented with up to three icons for logon choices. The most common are the Citrix Gateway Plug-in for Windows, Web Interface, and clientless access. Possible values = ON, OFF .PARAMETER Epaclienttype Choose between two types of End point Windows Client a) Application Agent - which always runs in the task bar as a standalone application and also has a supporting service which runs permanently when installed b) Activex Control - ActiveX control run by Microsoft Internet Explorer. Possible values = AGENT, PLUGIN .PARAMETER Iipdnssuffix An intranet IP DNS suffix. When a user logs on to Citrix Gateway and is assigned an IP address, a DNS record for the user name and IP address combination is added to the Citrix Gateway DNS cache. You can configure a DNS suffix to append to the user name when the DNS record is added to the cache. You can reach to the host from where the user is logged on by using the user's name, which can be easier to remember than an IP address. When the user logs off from Citrix Gateway, the record is removed from the DNS cache. .PARAMETER Forcedtimeout Force a disconnection from the Citrix Gateway Plug-in with Citrix Gateway after a specified number of minutes. If the session closes, the user must log on again. Maximum value = 65535 .PARAMETER Forcedtimeoutwarning Number of minutes to warn a user before the user session is disconnected. Maximum value = 255 .PARAMETER Ntdomain Single sign-on domain to use for single sign-on to applications in the internal network. This setting can be overwritten by the domain that users specify at the time of logon or by the domain that the authentication server returns. .PARAMETER Clientlessvpnmode Enable clientless access for web, XenApp or XenDesktop, and FileShare resources without installing the Citrix Gateway Plug-in. Available settings function as follows: * ON - Allow only clientless access. * OFF - Allow clientless access after users log on with the Citrix Gateway Plug-in. * DISABLED - Do not allow clientless access. Possible values = ON, OFF, DISABLED .PARAMETER Clientlessmodeurlencoding When clientless access is enabled, you can choose to encode the addresses of internal web applications or to leave the address as clear text. Available settings function as follows: * OPAQUE - Use standard encoding mechanisms to make the domain and protocol part of the resource unclear to users. * TRANSPARENT - Do not encode the web address and make it visible to users. * ENCRYPT - Allow the domain and protocol to be encrypted using a session key. When the web address is encrypted, the URL is different for each user session for the same web resource. If users bookmark the encoded web address, save it in the web browser and then log off, they cannot connect to the web address when they log on and use the bookmark. If users save the encrypted bookmark in the Access Interface during their session, the bookmark works each time the user logs on. Possible values = TRANSPARENT, OPAQUE, ENCRYPT .PARAMETER Clientlesspersistentcookie State of persistent cookies in clientless access mode. Persistent cookies are required for accessing certain features of SharePoint, such as opening and editing Microsoft Word, Excel, and PowerPoint documents hosted on the SharePoint server. A persistent cookie remains on the user device and is sent with each HTTP request. Citrix Gateway encrypts the persistent cookie before sending it to the plug-in on the user device, and refreshes the cookie periodically as long as the session exists. The cookie becomes stale if the session ends. Available settings function as follows: * ALLOW - Enable persistent cookies. Users can open and edit Microsoft documents stored in SharePoint. * DENY - Disable persistent cookies. Users cannot open and edit Microsoft documents stored in SharePoint. * PROMPT - Prompt users to allow or deny persistent cookies during the session. Persistent cookies are not required for clientless access if users do not connect to SharePoint. Possible values = ALLOW, DENY, PROMPT .PARAMETER Emailhome Web address for the web-based email, such as Outlook Web Access. .PARAMETER Allowedlogingroups Specify groups that have permission to log on to Citrix Gateway. Users who do not belong to this group or groups are denied access even if they have valid credentials. .PARAMETER Encryptcsecexp Enable encryption of client security expressions. Possible values = ENABLED, DISABLED .PARAMETER Apptokentimeout The timeout value in seconds for tokens to access XenMobile applications. Maximum value = 255 .PARAMETER Mdxtokentimeout Validity of MDX Token in minutes. This token is used for mdx services to access backend and valid HEAD and GET request. Maximum value = 1440 .PARAMETER Uitheme Set VPN UI Theme to Green-Bubble, Caxton or Custom; default is Caxton. Possible values = DEFAULT, GREENBUBBLE, CUSTOM .PARAMETER Securebrowse Allow users to connect through Citrix Gateway to network resources from iOS and Android mobile devices with Citrix Receiver. Users do not need to establish a full VPN tunnel to access resources in the secure network. Possible values = ENABLED, DISABLED .PARAMETER Storefronturl Web address for StoreFront to be used in this session for enumeration of resources from XenApp or XenDesktop. .PARAMETER Kcdaccount The KCD account details to be used in SSO. .PARAMETER Clientversions checkversion api. .PARAMETER Rdpclientprofilename Name of the RDP profile associated with the vserver. .PARAMETER Windowspluginupgrade Option to set plugin upgrade behaviour for Win. Possible values = Always, Essential, Never .PARAMETER Macpluginupgrade Option to set plugin upgrade behaviour for Mac. Possible values = Always, Essential, Never .PARAMETER Linuxpluginupgrade Option to set plugin upgrade behaviour for Linux. Possible values = Always, Essential, Never .PARAMETER Iconwithreceiver Option to decide whether to show plugin icon along with receiver icon. Possible values = ON, OFF .PARAMETER Userdomains List of user domains specified as comma seperated value. .PARAMETER Icasessiontimeout Enable or disable ica session timeout. If enabled and in case AAA session gets terminated, ICA connections associated with that will also get terminated. Possible values = ON, OFF .PARAMETER Alwaysonprofilename Name of the AlwaysON profile. The builtin profile named none can be used to explicitly disable AlwaysON. .PARAMETER Autoproxyurl URL to auto proxy config file. .PARAMETER Advancedclientlessvpnmode Option to enable/disable Advanced ClientlessVpnMode. Additionaly, it can be set to STRICT to block Classic ClientlessVpnMode while in AdvancedClientlessMode. Possible values = ENABLED, DISABLED, STRICT .PARAMETER Pcoipprofilename Name of the PCOIP profile. .PARAMETER Backendserversni enables sni extension for backend server handshakes. Possible values = ENABLED, DISABLED .PARAMETER Backendcertvalidation enables backend server certificate validation. Possible values = ENABLED, DISABLED .PARAMETER Fqdnspoofedip Spoofed IP address range that can be used by client for FQDN based split tunneling. .PARAMETER Netmask The netmask for the spoofed ip address. .PARAMETER Samesite SameSite attribute value for Cookies generated in VPN context. This attribute value will be appended only for the cookies which are specified in the builtin patset ns_cookies_samesite. Possible values = None, LAX, STRICT .EXAMPLE PS C:\>Invoke-NSUpdateVpnparameter An example how to update vpnparameter config Object(s). .NOTES File Name : Invoke-NSUpdateVpnparameter Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnparameter/ Requires : PowerShell v5.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, [ValidateScript({ $_.Length -gt 1 })] [string]$Winsip, [ValidateScript({ $_.Length -gt 1 })] [string]$Dnsvservername, [ValidateSet('LOCAL', 'REMOTE', 'BOTH')] [string]$Splitdns, [string]$Icauseraccounting, [double]$Sesstimeout, [string]$Clientsecurity, [ValidateScript({ $_.Length -gt 1 })] [string]$Clientsecuritygroup, [ValidateLength(1, 127)] [string]$Clientsecuritymessage, [ValidateSet('ON', 'OFF')] [string]$Clientsecuritylog, [ValidateLength(1, 64)] [string]$Smartgroup, [ValidateSet('ON', 'OFF', 'REVERSE')] [string]$Splittunnel, [ValidateSet('ON', 'OFF', 'FORCED')] [string]$Locallanaccess, [ValidateSet('ON', 'OFF')] [string]$Rfc1918, [ValidateSet('ON', 'OFF')] [string]$Spoofiip, [ValidateSet('ON', 'OFF')] [string]$Killconnections, [ValidateSet('ON', 'OFF')] [string]$Transparentinterception, [ValidateSet('AGENT', 'PLUGIN')] [string]$Windowsclienttype, [ValidateSet('ALLOW', 'DENY')] [string]$Defaultauthorizationaction, [ValidateScript({ $_.Length -gt 1 })] [string]$Authorizationgroup, [double]$Clientidletimeout, [ValidateSet('BROWSER', 'NS', 'OFF')] [string]$Proxy, [ValidateScript({ $_.Length -gt 1 })] [string]$Allprotocolproxy, [ValidateScript({ $_.Length -gt 1 })] [string]$Httpproxy, [ValidateScript({ $_.Length -gt 1 })] [string]$Ftpproxy, [ValidateScript({ $_.Length -gt 1 })] [string]$Socksproxy, [ValidateScript({ $_.Length -gt 1 })] [string]$Gopherproxy, [ValidateScript({ $_.Length -gt 1 })] [string]$Sslproxy, [ValidateScript({ $_.Length -gt 1 })] [string]$Proxyexception, [ValidateSet('ENABLED', 'DISABLED')] [string]$Proxylocalbypass, [ValidateSet('ON', 'OFF')] [string]$Clientcleanupprompt, [ValidateSet('none', 'all', 'cookie', 'addressbar', 'plugin', 'filesystemapplication', 'application', 'applicationdata', 'clientcertificate', 'autocomplete', 'cache')] [string[]]$Forcecleanup, [ValidateSet('none', 'all', 'services', 'filetransfer', 'configuration')] [string[]]$Clientoptions, [ValidateSet('none', 'trace')] [string[]]$Clientconfiguration, [ValidateSet('ON', 'OFF')] [string]$Sso, [ValidateSet('PRIMARY', 'SECONDARY')] [string]$Ssocredential, [ValidateSet('ON', 'OFF')] [string]$Windowsautologon, [ValidateSet('NS', 'OFF')] [string]$Usemip, [ValidateSet('NOSPILLOVER', 'SPILLOVER', 'OFF')] [string]$Useiip, [ValidateSet('debug', 'stats', 'events', 'OFF')] [string]$Clientdebug, [ValidateScript({ $_.Length -gt 1 })] [string]$Loginscript, [ValidateScript({ $_.Length -gt 1 })] [string]$Logoutscript, [string]$Homepage, [ValidateSet('ON', 'OFF')] [string]$Icaproxy, [string]$Wihome, [ValidateSet('IPV4', 'IPV6')] [string]$Wihomeaddresstype, [string]$Citrixreceiverhome, [ValidateSet('NORMAL', 'COMPACT')] [string]$Wiportalmode, [ValidateSet('ON', 'OFF')] [string]$Clientchoices, [ValidateSet('AGENT', 'PLUGIN')] [string]$Epaclienttype, [ValidateScript({ $_.Length -gt 1 })] [string]$Iipdnssuffix, [double]$Forcedtimeout, [double]$Forcedtimeoutwarning, [ValidateLength(1, 32)] [string]$Ntdomain, [ValidateSet('ON', 'OFF', 'DISABLED')] [string]$Clientlessvpnmode, [ValidateSet('TRANSPARENT', 'OPAQUE', 'ENCRYPT')] [string]$Clientlessmodeurlencoding, [ValidateSet('ALLOW', 'DENY', 'PROMPT')] [string]$Clientlesspersistentcookie, [string]$Emailhome, [ValidateLength(1, 511)] [string]$Allowedlogingroups, [ValidateSet('ENABLED', 'DISABLED')] [string]$Encryptcsecexp, [double]$Apptokentimeout, [double]$Mdxtokentimeout, [ValidateSet('DEFAULT', 'GREENBUBBLE', 'CUSTOM')] [string]$Uitheme, [ValidateSet('ENABLED', 'DISABLED')] [string]$Securebrowse, [ValidateLength(1, 255)] [string]$Storefronturl, [string]$Kcdaccount, [ValidateLength(1, 100)] [string]$Clientversions, [ValidateLength(1, 127)] [string]$Rdpclientprofilename, [ValidateSet('Always', 'Essential', 'Never')] [string]$Windowspluginupgrade, [ValidateSet('Always', 'Essential', 'Never')] [string]$Macpluginupgrade, [ValidateSet('Always', 'Essential', 'Never')] [string]$Linuxpluginupgrade, [ValidateSet('ON', 'OFF')] [string]$Iconwithreceiver, [string]$Userdomains, [ValidateSet('ON', 'OFF')] [string]$Icasessiontimeout, [ValidateLength(1, 127)] [string]$Alwaysonprofilename, [string]$Autoproxyurl, [ValidateSet('ENABLED', 'DISABLED', 'STRICT')] [string]$Advancedclientlessvpnmode, [ValidateLength(1, 127)] [string]$Pcoipprofilename, [ValidateSet('ENABLED', 'DISABLED')] [string]$Backendserversni, [ValidateSet('ENABLED', 'DISABLED')] [string]$Backendcertvalidation, [ValidateScript({ $_.Length -gt 1 })] [string]$Fqdnspoofedip, [ValidateScript({ $_.Length -gt 1 })] [string]$Netmask, [ValidateSet('None', 'LAX', 'STRICT')] [string]$Samesite ) begin { Write-Verbose "Invoke-NSUpdateVpnparameter: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('httpport') ) { $payload.Add('httpport', $httpport) } if ( $PSBoundParameters.ContainsKey('winsip') ) { $payload.Add('winsip', $winsip) } if ( $PSBoundParameters.ContainsKey('dnsvservername') ) { $payload.Add('dnsvservername', $dnsvservername) } if ( $PSBoundParameters.ContainsKey('splitdns') ) { $payload.Add('splitdns', $splitdns) } if ( $PSBoundParameters.ContainsKey('icauseraccounting') ) { $payload.Add('icauseraccounting', $icauseraccounting) } if ( $PSBoundParameters.ContainsKey('sesstimeout') ) { $payload.Add('sesstimeout', $sesstimeout) } if ( $PSBoundParameters.ContainsKey('clientsecurity') ) { $payload.Add('clientsecurity', $clientsecurity) } if ( $PSBoundParameters.ContainsKey('clientsecuritygroup') ) { $payload.Add('clientsecuritygroup', $clientsecuritygroup) } if ( $PSBoundParameters.ContainsKey('clientsecuritymessage') ) { $payload.Add('clientsecuritymessage', $clientsecuritymessage) } if ( $PSBoundParameters.ContainsKey('clientsecuritylog') ) { $payload.Add('clientsecuritylog', $clientsecuritylog) } if ( $PSBoundParameters.ContainsKey('smartgroup') ) { $payload.Add('smartgroup', $smartgroup) } if ( $PSBoundParameters.ContainsKey('splittunnel') ) { $payload.Add('splittunnel', $splittunnel) } if ( $PSBoundParameters.ContainsKey('locallanaccess') ) { $payload.Add('locallanaccess', $locallanaccess) } if ( $PSBoundParameters.ContainsKey('rfc1918') ) { $payload.Add('rfc1918', $rfc1918) } if ( $PSBoundParameters.ContainsKey('spoofiip') ) { $payload.Add('spoofiip', $spoofiip) } if ( $PSBoundParameters.ContainsKey('killconnections') ) { $payload.Add('killconnections', $killconnections) } if ( $PSBoundParameters.ContainsKey('transparentinterception') ) { $payload.Add('transparentinterception', $transparentinterception) } if ( $PSBoundParameters.ContainsKey('windowsclienttype') ) { $payload.Add('windowsclienttype', $windowsclienttype) } if ( $PSBoundParameters.ContainsKey('defaultauthorizationaction') ) { $payload.Add('defaultauthorizationaction', $defaultauthorizationaction) } if ( $PSBoundParameters.ContainsKey('authorizationgroup') ) { $payload.Add('authorizationgroup', $authorizationgroup) } if ( $PSBoundParameters.ContainsKey('clientidletimeout') ) { $payload.Add('clientidletimeout', $clientidletimeout) } if ( $PSBoundParameters.ContainsKey('proxy') ) { $payload.Add('proxy', $proxy) } if ( $PSBoundParameters.ContainsKey('allprotocolproxy') ) { $payload.Add('allprotocolproxy', $allprotocolproxy) } if ( $PSBoundParameters.ContainsKey('httpproxy') ) { $payload.Add('httpproxy', $httpproxy) } if ( $PSBoundParameters.ContainsKey('ftpproxy') ) { $payload.Add('ftpproxy', $ftpproxy) } if ( $PSBoundParameters.ContainsKey('socksproxy') ) { $payload.Add('socksproxy', $socksproxy) } if ( $PSBoundParameters.ContainsKey('gopherproxy') ) { $payload.Add('gopherproxy', $gopherproxy) } if ( $PSBoundParameters.ContainsKey('sslproxy') ) { $payload.Add('sslproxy', $sslproxy) } if ( $PSBoundParameters.ContainsKey('proxyexception') ) { $payload.Add('proxyexception', $proxyexception) } if ( $PSBoundParameters.ContainsKey('proxylocalbypass') ) { $payload.Add('proxylocalbypass', $proxylocalbypass) } if ( $PSBoundParameters.ContainsKey('clientcleanupprompt') ) { $payload.Add('clientcleanupprompt', $clientcleanupprompt) } if ( $PSBoundParameters.ContainsKey('forcecleanup') ) { $payload.Add('forcecleanup', $forcecleanup) } if ( $PSBoundParameters.ContainsKey('clientoptions') ) { $payload.Add('clientoptions', $clientoptions) } if ( $PSBoundParameters.ContainsKey('clientconfiguration') ) { $payload.Add('clientconfiguration', $clientconfiguration) } if ( $PSBoundParameters.ContainsKey('sso') ) { $payload.Add('sso', $sso) } if ( $PSBoundParameters.ContainsKey('ssocredential') ) { $payload.Add('ssocredential', $ssocredential) } if ( $PSBoundParameters.ContainsKey('windowsautologon') ) { $payload.Add('windowsautologon', $windowsautologon) } if ( $PSBoundParameters.ContainsKey('usemip') ) { $payload.Add('usemip', $usemip) } if ( $PSBoundParameters.ContainsKey('useiip') ) { $payload.Add('useiip', $useiip) } if ( $PSBoundParameters.ContainsKey('clientdebug') ) { $payload.Add('clientdebug', $clientdebug) } if ( $PSBoundParameters.ContainsKey('loginscript') ) { $payload.Add('loginscript', $loginscript) } if ( $PSBoundParameters.ContainsKey('logoutscript') ) { $payload.Add('logoutscript', $logoutscript) } if ( $PSBoundParameters.ContainsKey('homepage') ) { $payload.Add('homepage', $homepage) } if ( $PSBoundParameters.ContainsKey('icaproxy') ) { $payload.Add('icaproxy', $icaproxy) } if ( $PSBoundParameters.ContainsKey('wihome') ) { $payload.Add('wihome', $wihome) } if ( $PSBoundParameters.ContainsKey('wihomeaddresstype') ) { $payload.Add('wihomeaddresstype', $wihomeaddresstype) } if ( $PSBoundParameters.ContainsKey('citrixreceiverhome') ) { $payload.Add('citrixreceiverhome', $citrixreceiverhome) } if ( $PSBoundParameters.ContainsKey('wiportalmode') ) { $payload.Add('wiportalmode', $wiportalmode) } if ( $PSBoundParameters.ContainsKey('clientchoices') ) { $payload.Add('clientchoices', $clientchoices) } if ( $PSBoundParameters.ContainsKey('epaclienttype') ) { $payload.Add('epaclienttype', $epaclienttype) } if ( $PSBoundParameters.ContainsKey('iipdnssuffix') ) { $payload.Add('iipdnssuffix', $iipdnssuffix) } if ( $PSBoundParameters.ContainsKey('forcedtimeout') ) { $payload.Add('forcedtimeout', $forcedtimeout) } if ( $PSBoundParameters.ContainsKey('forcedtimeoutwarning') ) { $payload.Add('forcedtimeoutwarning', $forcedtimeoutwarning) } if ( $PSBoundParameters.ContainsKey('ntdomain') ) { $payload.Add('ntdomain', $ntdomain) } if ( $PSBoundParameters.ContainsKey('clientlessvpnmode') ) { $payload.Add('clientlessvpnmode', $clientlessvpnmode) } if ( $PSBoundParameters.ContainsKey('clientlessmodeurlencoding') ) { $payload.Add('clientlessmodeurlencoding', $clientlessmodeurlencoding) } if ( $PSBoundParameters.ContainsKey('clientlesspersistentcookie') ) { $payload.Add('clientlesspersistentcookie', $clientlesspersistentcookie) } if ( $PSBoundParameters.ContainsKey('emailhome') ) { $payload.Add('emailhome', $emailhome) } if ( $PSBoundParameters.ContainsKey('allowedlogingroups') ) { $payload.Add('allowedlogingroups', $allowedlogingroups) } if ( $PSBoundParameters.ContainsKey('encryptcsecexp') ) { $payload.Add('encryptcsecexp', $encryptcsecexp) } if ( $PSBoundParameters.ContainsKey('apptokentimeout') ) { $payload.Add('apptokentimeout', $apptokentimeout) } if ( $PSBoundParameters.ContainsKey('mdxtokentimeout') ) { $payload.Add('mdxtokentimeout', $mdxtokentimeout) } if ( $PSBoundParameters.ContainsKey('uitheme') ) { $payload.Add('uitheme', $uitheme) } if ( $PSBoundParameters.ContainsKey('securebrowse') ) { $payload.Add('securebrowse', $securebrowse) } if ( $PSBoundParameters.ContainsKey('storefronturl') ) { $payload.Add('storefronturl', $storefronturl) } if ( $PSBoundParameters.ContainsKey('kcdaccount') ) { $payload.Add('kcdaccount', $kcdaccount) } if ( $PSBoundParameters.ContainsKey('clientversions') ) { $payload.Add('clientversions', $clientversions) } if ( $PSBoundParameters.ContainsKey('rdpclientprofilename') ) { $payload.Add('rdpclientprofilename', $rdpclientprofilename) } if ( $PSBoundParameters.ContainsKey('windowspluginupgrade') ) { $payload.Add('windowspluginupgrade', $windowspluginupgrade) } if ( $PSBoundParameters.ContainsKey('macpluginupgrade') ) { $payload.Add('macpluginupgrade', $macpluginupgrade) } if ( $PSBoundParameters.ContainsKey('linuxpluginupgrade') ) { $payload.Add('linuxpluginupgrade', $linuxpluginupgrade) } if ( $PSBoundParameters.ContainsKey('iconwithreceiver') ) { $payload.Add('iconwithreceiver', $iconwithreceiver) } if ( $PSBoundParameters.ContainsKey('userdomains') ) { $payload.Add('userdomains', $userdomains) } if ( $PSBoundParameters.ContainsKey('icasessiontimeout') ) { $payload.Add('icasessiontimeout', $icasessiontimeout) } if ( $PSBoundParameters.ContainsKey('alwaysonprofilename') ) { $payload.Add('alwaysonprofilename', $alwaysonprofilename) } if ( $PSBoundParameters.ContainsKey('autoproxyurl') ) { $payload.Add('autoproxyurl', $autoproxyurl) } if ( $PSBoundParameters.ContainsKey('advancedclientlessvpnmode') ) { $payload.Add('advancedclientlessvpnmode', $advancedclientlessvpnmode) } if ( $PSBoundParameters.ContainsKey('pcoipprofilename') ) { $payload.Add('pcoipprofilename', $pcoipprofilename) } if ( $PSBoundParameters.ContainsKey('backendserversni') ) { $payload.Add('backendserversni', $backendserversni) } if ( $PSBoundParameters.ContainsKey('backendcertvalidation') ) { $payload.Add('backendcertvalidation', $backendcertvalidation) } if ( $PSBoundParameters.ContainsKey('fqdnspoofedip') ) { $payload.Add('fqdnspoofedip', $fqdnspoofedip) } if ( $PSBoundParameters.ContainsKey('netmask') ) { $payload.Add('netmask', $netmask) } if ( $PSBoundParameters.ContainsKey('samesite') ) { $payload.Add('samesite', $samesite) } if ( $PSCmdlet.ShouldProcess("vpnparameter", "Update Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnparameter -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-NSUpdateVpnparameter: Finished" } } function Invoke-NSUnsetVpnparameter { <# .SYNOPSIS Unset Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN parameter resource. .PARAMETER Httpport Destination port numbers other than port 80, added as a comma-separated list. Traffic to these ports is processed as HTTP traffic, which allows functionality, such as HTTP authorization and single sign-on to a web application to work. .PARAMETER Winsip WINS server IP address to add to Citrix Gateway for name resolution. .PARAMETER Dnsvservername Name of the DNS virtual server for the user session. .PARAMETER Splitdns Route the DNS requests to the local DNS server configured on the user device, or Citrix Gateway (remote), or both. Possible values = LOCAL, REMOTE, BOTH .PARAMETER Icauseraccounting The name of the radiusPolicy to use for RADIUS user accounting info on the session. .PARAMETER Sesstimeout Number of minutes after which the session times out. Maximum value = 65535 .PARAMETER Clientsecurity Specify the client security check for the user device to permit a Citrix Gateway session. The web address or IP address is not included in the expression for the client security check. .PARAMETER Clientsecuritygroup The client security group that will be assigned on failure of the client security check. Users can in general be organized into Groups. In this case, the Client Security Group may have a more restrictive security policy. .PARAMETER Smartgroup This is the default group that is chosen when the authentication succeeds in addition to extracted groups. .PARAMETER Clientsecuritymessage The client security message that will be displayed on failure of the client security check. .PARAMETER Clientsecuritylog Specifies whether or not to display all failed Client Security scans to the end user. Possible values = ON, OFF .PARAMETER Authorizationgroup Comma-separated list of groups in which the user is placed when none of the groups that the user is a part of is configured on Citrix Gateway. The authorization policy can be bound to these groups to control access to the resources. .PARAMETER Clientidletimeout Time, in minutes, after which to time out the user session if Citrix Gateway does not detect mouse or keyboard activity. Maximum value = 9999 .PARAMETER Allprotocolproxy IP address of the proxy server to use for all protocols supported by Citrix Gateway. .PARAMETER Httpproxy IP address of the proxy server to be used for HTTP access for all subsequent connections to the internal network. .PARAMETER Ftpproxy IP address of the proxy server to be used for FTP access for all subsequent connections to the internal network. .PARAMETER Socksproxy IP address of the proxy server to be used for SOCKS access for all subsequent connections to the internal network. .PARAMETER Gopherproxy IP address of the proxy server to be used for GOPHER access for all subsequent connections to the internal network. .PARAMETER Sslproxy IP address of the proxy server to be used for SSL access for all subsequent connections to the internal network. .PARAMETER Proxyexception Proxy exception string that will be configured in the browser for bypassing the previously configured proxies. Allowed only if proxy type is Browser. .PARAMETER Forcecleanup Force cache clean-up when the user closes a session. You can specify all, none, or any combination of the client-side items. Possible values = none, all, cookie, addressbar, plugin, filesystemapplication, application, applicationdata, clientcertificate, autocomplete, cache .PARAMETER Clientoptions Display only the configured menu options when you select the "Configure Citrix Gateway" option in the Citrix Gateway Plug-in's system tray icon for Windows. Possible values = none, all, services, filetransfer, configuration .PARAMETER Clientconfiguration Allow users to change client Debug logging level in Configuration tab of the Citrix Gateway Plug-in for Windows. Possible values = none, trace .PARAMETER Loginscript Path to the logon script that is run when a session is established. Separate multiple scripts by using comma. A "$" in the path signifies that the word following the "$" is an environment variable. .PARAMETER Logoutscript Path to the logout script. Separate multiple scripts by using comma. A "$" in the path signifies that the word following the "$" is an environment variable. .PARAMETER Homepage Web address of the home page that appears when users log on. Otherwise, users receive the default home page for Citrix Gateway, which is the Access Interface. .PARAMETER Proxy Set options to apply proxy for accessing the internal resources. Available settings function as follows: * BROWSER - Proxy settings are configured only in Internet Explorer and Firefox browsers. * NS - Proxy settings are configured on the Citrix ADC. * OFF - Proxy settings are not configured. Possible values = BROWSER, NS, OFF .PARAMETER Wihome Web address of the Web Interface server, such as http://<ipAddress>/Citrix/XenApp, or Receiver for Web, which enumerates the virtualized resources, such as XenApp, XenDesktop, and cloud applications. This web address is used as the home page in ICA proxy mode. If Client Choices is ON, you must configure this setting. Because the user can choose between FullClient and ICAProxy, the user may see a different home page. An Internet web site may appear if the user gets the FullClient option, or a Web Interface site if the user gets the ICAProxy option. If the setting is not configured, the XenApp option does not appear as a client choice. .PARAMETER Citrixreceiverhome Web address for the Citrix Receiver home page. Configure Citrix Gateway so that when users log on to the appliance, the Citrix Gateway Plug-in opens a web browser that allows single sign-on to the Citrix Receiver home page. .PARAMETER Wiportalmode Layout on the Access Interface. The COMPACT value indicates the use of small icons. Possible values = NORMAL, COMPACT .PARAMETER Iipdnssuffix An intranet IP DNS suffix. When a user logs on to Citrix Gateway and is assigned an IP address, a DNS record for the user name and IP address combination is added to the Citrix Gateway DNS cache. You can configure a DNS suffix to append to the user name when the DNS record is added to the cache. You can reach to the host from where the user is logged on by using the user's name, which can be easier to remember than an IP address. When the user logs off from Citrix Gateway, the record is removed from the DNS cache. .PARAMETER Forcedtimeout Force a disconnection from the Citrix Gateway Plug-in with Citrix Gateway after a specified number of minutes. If the session closes, the user must log on again. Maximum value = 65535 .PARAMETER Forcedtimeoutwarning Number of minutes to warn a user before the user session is disconnected. Maximum value = 255 .PARAMETER Defaultauthorizationaction Specify the network resources that users have access to when they log on to the internal network. The default setting for authorization is to deny access to all network resources. Citrix recommends using the default global setting and then creating authorization policies to define the network resources users can access. If you set the default authorization policy to DENY, you must explicitly authorize access to any network resource, which improves security. Possible values = ALLOW, DENY .PARAMETER Ntdomain Single sign-on domain to use for single sign-on to applications in the internal network. This setting can be overwritten by the domain that users specify at the time of logon or by the domain that the authentication server returns. .PARAMETER Clientlessvpnmode Enable clientless access for web, XenApp or XenDesktop, and FileShare resources without installing the Citrix Gateway Plug-in. Available settings function as follows: * ON - Allow only clientless access. * OFF - Allow clientless access after users log on with the Citrix Gateway Plug-in. * DISABLED - Do not allow clientless access. Possible values = ON, OFF, DISABLED .PARAMETER Emailhome Web address for the web-based email, such as Outlook Web Access. .PARAMETER Clientlessmodeurlencoding When clientless access is enabled, you can choose to encode the addresses of internal web applications or to leave the address as clear text. Available settings function as follows: * OPAQUE - Use standard encoding mechanisms to make the domain and protocol part of the resource unclear to users. * TRANSPARENT - Do not encode the web address and make it visible to users. * ENCRYPT - Allow the domain and protocol to be encrypted using a session key. When the web address is encrypted, the URL is different for each user session for the same web resource. If users bookmark the encoded web address, save it in the web browser and then log off, they cannot connect to the web address when they log on and use the bookmark. If users save the encrypted bookmark in the Access Interface during their session, the bookmark works each time the user logs on. Possible values = TRANSPARENT, OPAQUE, ENCRYPT .PARAMETER Clientlesspersistentcookie State of persistent cookies in clientless access mode. Persistent cookies are required for accessing certain features of SharePoint, such as opening and editing Microsoft Word, Excel, and PowerPoint documents hosted on the SharePoint server. A persistent cookie remains on the user device and is sent with each HTTP request. Citrix Gateway encrypts the persistent cookie before sending it to the plug-in on the user device, and refreshes the cookie periodically as long as the session exists. The cookie becomes stale if the session ends. Available settings function as follows: * ALLOW - Enable persistent cookies. Users can open and edit Microsoft documents stored in SharePoint. * DENY - Disable persistent cookies. Users cannot open and edit Microsoft documents stored in SharePoint. * PROMPT - Prompt users to allow or deny persistent cookies during the session. Persistent cookies are not required for clientless access if users do not connect to SharePoint. Possible values = ALLOW, DENY, PROMPT .PARAMETER Allowedlogingroups Specify groups that have permission to log on to Citrix Gateway. Users who do not belong to this group or groups are denied access even if they have valid credentials. .PARAMETER Apptokentimeout The timeout value in seconds for tokens to access XenMobile applications. Maximum value = 255 .PARAMETER Mdxtokentimeout Validity of MDX Token in minutes. This token is used for mdx services to access backend and valid HEAD and GET request. Maximum value = 1440 .PARAMETER Storefronturl Web address for StoreFront to be used in this session for enumeration of resources from XenApp or XenDesktop. .PARAMETER Uitheme Set VPN UI Theme to Green-Bubble, Caxton or Custom; default is Caxton. Possible values = DEFAULT, GREENBUBBLE, CUSTOM .PARAMETER Kcdaccount The KCD account details to be used in SSO. .PARAMETER Rdpclientprofilename Name of the RDP profile associated with the vserver. .PARAMETER Windowspluginupgrade Option to set plugin upgrade behaviour for Win. Possible values = Always, Essential, Never .PARAMETER Macpluginupgrade Option to set plugin upgrade behaviour for Mac. Possible values = Always, Essential, Never .PARAMETER Linuxpluginupgrade Option to set plugin upgrade behaviour for Linux. Possible values = Always, Essential, Never .PARAMETER Iconwithreceiver Option to decide whether to show plugin icon along with receiver icon. Possible values = ON, OFF .PARAMETER Userdomains List of user domains specified as comma seperated value. .PARAMETER Alwaysonprofilename Name of the AlwaysON profile. The builtin profile named none can be used to explicitly disable AlwaysON. .PARAMETER Autoproxyurl URL to auto proxy config file. .PARAMETER Pcoipprofilename Name of the PCOIP profile. .PARAMETER Advancedclientlessvpnmode Option to enable/disable Advanced ClientlessVpnMode. Additionaly, it can be set to STRICT to block Classic ClientlessVpnMode while in AdvancedClientlessMode. Possible values = ENABLED, DISABLED, STRICT .PARAMETER Fqdnspoofedip Spoofed IP address range that can be used by client for FQDN based split tunneling. .PARAMETER Splittunnel Send, through the tunnel, traffic only for intranet applications that are defined in Citrix Gateway. Route all other traffic directly to the Internet. The OFF setting routes all traffic through Citrix Gateway. With the REVERSE setting, intranet applications define the network traffic that is not intercepted. All network traffic directed to internal IP addresses bypasses the VPN tunnel, while other traffic goes through Citrix Gateway. Reverse split tunneling can be used to log all non-local LAN traffic. For example, if users have a home network and are logged on through the Citrix Gateway Plug-in, network traffic destined to a printer or another device within the home network is not intercepted. Possible values = ON, OFF, REVERSE .PARAMETER Locallanaccess Set local LAN access. If split tunneling is OFF, and you set local LAN access to ON, the local client can route traffic to its local interface. When the local area network switch is specified, this combination of switches is useful. The client can allow local LAN access to devices that commonly have non-routable addresses, such as local printers or local file servers. Possible values = ON, OFF, FORCED .PARAMETER Rfc1918 As defined in the local area network, allow only the following local area network addresses to bypass the VPN tunnel when the local LAN access feature is enabled: * 10.*.*.*, * 172.16.*.*, * 192.168.*.*. Possible values = ON, OFF .PARAMETER Spoofiip Indicate whether or not the application requires IP spoofing, which routes the connection to the intranet application through the virtual adapter. Possible values = ON, OFF .PARAMETER Killconnections Specify whether the Citrix Gateway Plug-in should disconnect all preexisting connections, such as the connections existing before the user logged on to Citrix Gateway, and prevent new incoming connections on the Citrix Gateway Plug-in for Windows and MAC when the user is connected to Citrix Gateway and split tunneling is disabled. Possible values = ON, OFF .PARAMETER Transparentinterception Allow access to network resources by using a single IP address and subnet mask or a range of IP addresses. The OFF setting sets the mode to proxy, in which you configure destination and source IP addresses and port numbers. If you are using the Citrix Gateway Plug-in for Windows, set this parameter to ON, in which the mode is set to transparent. If you are using the Citrix Gateway Plug-in for Java, set this parameter to OFF. Possible values = ON, OFF .PARAMETER Windowsclienttype The Windows client type. Choose between two types of Windows Client\ a) Application Agent - which always runs in the task bar as a standalone application and also has a supporting service which runs permanently when installed\ b) Activex Control - ActiveX control run by Microsoft Internet Explorer. Possible values = AGENT, PLUGIN .PARAMETER Proxylocalbypass Bypass proxy server for local addresses option in Internet Explorer and Firefox proxy server settings. Possible values = ENABLED, DISABLED .PARAMETER Clientcleanupprompt Prompt for client-side cache clean-up when a client-initiated session closes. Possible values = ON, OFF .PARAMETER Sso Set single sign-on (SSO) for the session. When the user accesses a server, the user's logon credentials are passed to the server for authentication. NOTE : This configuration does not honor the following authentication types for security reason. BASIC, DIGEST, and NTLM (without Negotiate NTLM2 Key or Negotiate Sign Flag). Use VPN TrafficAction to configure SSO for these authentication types. Possible values = ON, OFF .PARAMETER Ssocredential Specify whether to use the primary or secondary authentication credentials for single sign-on to the server. Possible values = PRIMARY, SECONDARY .PARAMETER Windowsautologon Enable or disable the Windows Auto Logon for the session. If a VPN session is established after this setting is enabled, the user is automatically logged on by using Windows credentials after the system is restarted. Possible values = ON, OFF .PARAMETER Usemip Enable or disable the use of a unique IP address alias, or a mapped IP address, as the client IP address for each client session. Allow Citrix Gateway to use the mapped IP address as an intranet IP address when all other IP addresses are not available. When IP pooling is configured and the mapped IP is used as an intranet IP address, the mapped IP address is used when an intranet IP address cannot be assigned. Possible values = NS, OFF .PARAMETER Useiip Define IP address pool options. Available settings function as follows: * SPILLOVER - When an address pool is configured and the mapped IP is used as an intranet IP address, the mapped IP address is used when an intranet IP address cannot be assigned. * NOSPILLOVER - When intranet IP addresses are enabled and the mapped IP address is not used, the Transfer Login page appears for users who have used all available intranet IP addresses. * OFF - Address pool is not configured. Possible values = NOSPILLOVER, SPILLOVER, OFF .PARAMETER Clientdebug Set the trace level on Citrix Gateway. Technical support technicians use these debug logs for in-depth debugging and troubleshooting purposes. Available settings function as follows: * DEBUG - Detailed debug messages are collected and written into the specified file. * STATS - Application audit level error messages and debug statistic counters are written into the specified file. * EVENTS - Application audit-level error messages are written into the specified file. * OFF - Only critical events are logged into the Windows Application Log. Possible values = debug, stats, events, OFF .PARAMETER Icaproxy Enable ICA proxy to configure secure Internet access to servers running Citrix XenApp or XenDesktop by using Citrix Receiver instead of the Citrix Gateway Plug-in. Possible values = ON, OFF .PARAMETER Clientchoices Provide users with multiple logon options. With client choices, users have the option of logging on by using the Citrix Gateway Plug-in for Windows, Citrix Gateway Plug-in for Java, the Web Interface, or clientless access from one location. Depending on how Citrix Gateway is configured, users are presented with up to three icons for logon choices. The most common are the Citrix Gateway Plug-in for Windows, Web Interface, and clientless access. Possible values = ON, OFF .PARAMETER Epaclienttype Choose between two types of End point Windows Client a) Application Agent - which always runs in the task bar as a standalone application and also has a supporting service which runs permanently when installed b) Activex Control - ActiveX control run by Microsoft Internet Explorer. Possible values = AGENT, PLUGIN .PARAMETER Encryptcsecexp Enable encryption of client security expressions. Possible values = ENABLED, DISABLED .PARAMETER Securebrowse Allow users to connect through Citrix Gateway to network resources from iOS and Android mobile devices with Citrix Receiver. Users do not need to establish a full VPN tunnel to access resources in the secure network. Possible values = ENABLED, DISABLED .PARAMETER Clientversions checkversion api. .PARAMETER Icasessiontimeout Enable or disable ica session timeout. If enabled and in case AAA session gets terminated, ICA connections associated with that will also get terminated. Possible values = ON, OFF .PARAMETER Backendserversni enables sni extension for backend server handshakes. Possible values = ENABLED, DISABLED .PARAMETER Backendcertvalidation enables backend server certificate validation. Possible values = ENABLED, DISABLED .PARAMETER Netmask The netmask for the spoofed ip address. .PARAMETER Samesite SameSite attribute value for Cookies generated in VPN context. This attribute value will be appended only for the cookies which are specified in the builtin patset ns_cookies_samesite. Possible values = None, LAX, STRICT .EXAMPLE PS C:\>Invoke-NSUnsetVpnparameter An example how to unset vpnparameter config Object(s). .NOTES File Name : Invoke-NSUnsetVpnparameter Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnparameter Requires : PowerShell v5.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]$httpport, [Boolean]$winsip, [Boolean]$dnsvservername, [Boolean]$splitdns, [Boolean]$icauseraccounting, [Boolean]$sesstimeout, [Boolean]$clientsecurity, [Boolean]$clientsecuritygroup, [Boolean]$smartgroup, [Boolean]$clientsecuritymessage, [Boolean]$clientsecuritylog, [Boolean]$authorizationgroup, [Boolean]$clientidletimeout, [Boolean]$allprotocolproxy, [Boolean]$httpproxy, [Boolean]$ftpproxy, [Boolean]$socksproxy, [Boolean]$gopherproxy, [Boolean]$sslproxy, [Boolean]$proxyexception, [Boolean]$forcecleanup, [Boolean]$clientoptions, [Boolean]$clientconfiguration, [Boolean]$loginscript, [Boolean]$logoutscript, [Boolean]$homepage, [Boolean]$proxy, [Boolean]$wihome, [Boolean]$citrixreceiverhome, [Boolean]$wiportalmode, [Boolean]$iipdnssuffix, [Boolean]$forcedtimeout, [Boolean]$forcedtimeoutwarning, [Boolean]$defaultauthorizationaction, [Boolean]$ntdomain, [Boolean]$clientlessvpnmode, [Boolean]$emailhome, [Boolean]$clientlessmodeurlencoding, [Boolean]$clientlesspersistentcookie, [Boolean]$allowedlogingroups, [Boolean]$apptokentimeout, [Boolean]$mdxtokentimeout, [Boolean]$storefronturl, [Boolean]$uitheme, [Boolean]$kcdaccount, [Boolean]$rdpclientprofilename, [Boolean]$windowspluginupgrade, [Boolean]$macpluginupgrade, [Boolean]$linuxpluginupgrade, [Boolean]$iconwithreceiver, [Boolean]$userdomains, [Boolean]$alwaysonprofilename, [Boolean]$autoproxyurl, [Boolean]$pcoipprofilename, [Boolean]$advancedclientlessvpnmode, [Boolean]$fqdnspoofedip, [Boolean]$splittunnel, [Boolean]$locallanaccess, [Boolean]$rfc1918, [Boolean]$spoofiip, [Boolean]$killconnections, [Boolean]$transparentinterception, [Boolean]$windowsclienttype, [Boolean]$proxylocalbypass, [Boolean]$clientcleanupprompt, [Boolean]$sso, [Boolean]$ssocredential, [Boolean]$windowsautologon, [Boolean]$usemip, [Boolean]$useiip, [Boolean]$clientdebug, [Boolean]$icaproxy, [Boolean]$clientchoices, [Boolean]$epaclienttype, [Boolean]$encryptcsecexp, [Boolean]$securebrowse, [Boolean]$clientversions, [Boolean]$icasessiontimeout, [Boolean]$backendserversni, [Boolean]$backendcertvalidation, [Boolean]$netmask, [Boolean]$samesite ) begin { Write-Verbose "Invoke-NSUnsetVpnparameter: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('httpport') ) { $payload.Add('httpport', $httpport) } if ( $PSBoundParameters.ContainsKey('winsip') ) { $payload.Add('winsip', $winsip) } if ( $PSBoundParameters.ContainsKey('dnsvservername') ) { $payload.Add('dnsvservername', $dnsvservername) } if ( $PSBoundParameters.ContainsKey('splitdns') ) { $payload.Add('splitdns', $splitdns) } if ( $PSBoundParameters.ContainsKey('icauseraccounting') ) { $payload.Add('icauseraccounting', $icauseraccounting) } if ( $PSBoundParameters.ContainsKey('sesstimeout') ) { $payload.Add('sesstimeout', $sesstimeout) } if ( $PSBoundParameters.ContainsKey('clientsecurity') ) { $payload.Add('clientsecurity', $clientsecurity) } if ( $PSBoundParameters.ContainsKey('clientsecuritygroup') ) { $payload.Add('clientsecuritygroup', $clientsecuritygroup) } if ( $PSBoundParameters.ContainsKey('smartgroup') ) { $payload.Add('smartgroup', $smartgroup) } if ( $PSBoundParameters.ContainsKey('clientsecuritymessage') ) { $payload.Add('clientsecuritymessage', $clientsecuritymessage) } if ( $PSBoundParameters.ContainsKey('clientsecuritylog') ) { $payload.Add('clientsecuritylog', $clientsecuritylog) } if ( $PSBoundParameters.ContainsKey('authorizationgroup') ) { $payload.Add('authorizationgroup', $authorizationgroup) } if ( $PSBoundParameters.ContainsKey('clientidletimeout') ) { $payload.Add('clientidletimeout', $clientidletimeout) } if ( $PSBoundParameters.ContainsKey('allprotocolproxy') ) { $payload.Add('allprotocolproxy', $allprotocolproxy) } if ( $PSBoundParameters.ContainsKey('httpproxy') ) { $payload.Add('httpproxy', $httpproxy) } if ( $PSBoundParameters.ContainsKey('ftpproxy') ) { $payload.Add('ftpproxy', $ftpproxy) } if ( $PSBoundParameters.ContainsKey('socksproxy') ) { $payload.Add('socksproxy', $socksproxy) } if ( $PSBoundParameters.ContainsKey('gopherproxy') ) { $payload.Add('gopherproxy', $gopherproxy) } if ( $PSBoundParameters.ContainsKey('sslproxy') ) { $payload.Add('sslproxy', $sslproxy) } if ( $PSBoundParameters.ContainsKey('proxyexception') ) { $payload.Add('proxyexception', $proxyexception) } if ( $PSBoundParameters.ContainsKey('forcecleanup') ) { $payload.Add('forcecleanup', $forcecleanup) } if ( $PSBoundParameters.ContainsKey('clientoptions') ) { $payload.Add('clientoptions', $clientoptions) } if ( $PSBoundParameters.ContainsKey('clientconfiguration') ) { $payload.Add('clientconfiguration', $clientconfiguration) } if ( $PSBoundParameters.ContainsKey('loginscript') ) { $payload.Add('loginscript', $loginscript) } if ( $PSBoundParameters.ContainsKey('logoutscript') ) { $payload.Add('logoutscript', $logoutscript) } if ( $PSBoundParameters.ContainsKey('homepage') ) { $payload.Add('homepage', $homepage) } if ( $PSBoundParameters.ContainsKey('proxy') ) { $payload.Add('proxy', $proxy) } if ( $PSBoundParameters.ContainsKey('wihome') ) { $payload.Add('wihome', $wihome) } if ( $PSBoundParameters.ContainsKey('citrixreceiverhome') ) { $payload.Add('citrixreceiverhome', $citrixreceiverhome) } if ( $PSBoundParameters.ContainsKey('wiportalmode') ) { $payload.Add('wiportalmode', $wiportalmode) } if ( $PSBoundParameters.ContainsKey('iipdnssuffix') ) { $payload.Add('iipdnssuffix', $iipdnssuffix) } if ( $PSBoundParameters.ContainsKey('forcedtimeout') ) { $payload.Add('forcedtimeout', $forcedtimeout) } if ( $PSBoundParameters.ContainsKey('forcedtimeoutwarning') ) { $payload.Add('forcedtimeoutwarning', $forcedtimeoutwarning) } if ( $PSBoundParameters.ContainsKey('defaultauthorizationaction') ) { $payload.Add('defaultauthorizationaction', $defaultauthorizationaction) } if ( $PSBoundParameters.ContainsKey('ntdomain') ) { $payload.Add('ntdomain', $ntdomain) } if ( $PSBoundParameters.ContainsKey('clientlessvpnmode') ) { $payload.Add('clientlessvpnmode', $clientlessvpnmode) } if ( $PSBoundParameters.ContainsKey('emailhome') ) { $payload.Add('emailhome', $emailhome) } if ( $PSBoundParameters.ContainsKey('clientlessmodeurlencoding') ) { $payload.Add('clientlessmodeurlencoding', $clientlessmodeurlencoding) } if ( $PSBoundParameters.ContainsKey('clientlesspersistentcookie') ) { $payload.Add('clientlesspersistentcookie', $clientlesspersistentcookie) } if ( $PSBoundParameters.ContainsKey('allowedlogingroups') ) { $payload.Add('allowedlogingroups', $allowedlogingroups) } if ( $PSBoundParameters.ContainsKey('apptokentimeout') ) { $payload.Add('apptokentimeout', $apptokentimeout) } if ( $PSBoundParameters.ContainsKey('mdxtokentimeout') ) { $payload.Add('mdxtokentimeout', $mdxtokentimeout) } if ( $PSBoundParameters.ContainsKey('storefronturl') ) { $payload.Add('storefronturl', $storefronturl) } if ( $PSBoundParameters.ContainsKey('uitheme') ) { $payload.Add('uitheme', $uitheme) } if ( $PSBoundParameters.ContainsKey('kcdaccount') ) { $payload.Add('kcdaccount', $kcdaccount) } if ( $PSBoundParameters.ContainsKey('rdpclientprofilename') ) { $payload.Add('rdpclientprofilename', $rdpclientprofilename) } if ( $PSBoundParameters.ContainsKey('windowspluginupgrade') ) { $payload.Add('windowspluginupgrade', $windowspluginupgrade) } if ( $PSBoundParameters.ContainsKey('macpluginupgrade') ) { $payload.Add('macpluginupgrade', $macpluginupgrade) } if ( $PSBoundParameters.ContainsKey('linuxpluginupgrade') ) { $payload.Add('linuxpluginupgrade', $linuxpluginupgrade) } if ( $PSBoundParameters.ContainsKey('iconwithreceiver') ) { $payload.Add('iconwithreceiver', $iconwithreceiver) } if ( $PSBoundParameters.ContainsKey('userdomains') ) { $payload.Add('userdomains', $userdomains) } if ( $PSBoundParameters.ContainsKey('alwaysonprofilename') ) { $payload.Add('alwaysonprofilename', $alwaysonprofilename) } if ( $PSBoundParameters.ContainsKey('autoproxyurl') ) { $payload.Add('autoproxyurl', $autoproxyurl) } if ( $PSBoundParameters.ContainsKey('pcoipprofilename') ) { $payload.Add('pcoipprofilename', $pcoipprofilename) } if ( $PSBoundParameters.ContainsKey('advancedclientlessvpnmode') ) { $payload.Add('advancedclientlessvpnmode', $advancedclientlessvpnmode) } if ( $PSBoundParameters.ContainsKey('fqdnspoofedip') ) { $payload.Add('fqdnspoofedip', $fqdnspoofedip) } if ( $PSBoundParameters.ContainsKey('splittunnel') ) { $payload.Add('splittunnel', $splittunnel) } if ( $PSBoundParameters.ContainsKey('locallanaccess') ) { $payload.Add('locallanaccess', $locallanaccess) } if ( $PSBoundParameters.ContainsKey('rfc1918') ) { $payload.Add('rfc1918', $rfc1918) } if ( $PSBoundParameters.ContainsKey('spoofiip') ) { $payload.Add('spoofiip', $spoofiip) } if ( $PSBoundParameters.ContainsKey('killconnections') ) { $payload.Add('killconnections', $killconnections) } if ( $PSBoundParameters.ContainsKey('transparentinterception') ) { $payload.Add('transparentinterception', $transparentinterception) } if ( $PSBoundParameters.ContainsKey('windowsclienttype') ) { $payload.Add('windowsclienttype', $windowsclienttype) } if ( $PSBoundParameters.ContainsKey('proxylocalbypass') ) { $payload.Add('proxylocalbypass', $proxylocalbypass) } if ( $PSBoundParameters.ContainsKey('clientcleanupprompt') ) { $payload.Add('clientcleanupprompt', $clientcleanupprompt) } if ( $PSBoundParameters.ContainsKey('sso') ) { $payload.Add('sso', $sso) } if ( $PSBoundParameters.ContainsKey('ssocredential') ) { $payload.Add('ssocredential', $ssocredential) } if ( $PSBoundParameters.ContainsKey('windowsautologon') ) { $payload.Add('windowsautologon', $windowsautologon) } if ( $PSBoundParameters.ContainsKey('usemip') ) { $payload.Add('usemip', $usemip) } if ( $PSBoundParameters.ContainsKey('useiip') ) { $payload.Add('useiip', $useiip) } if ( $PSBoundParameters.ContainsKey('clientdebug') ) { $payload.Add('clientdebug', $clientdebug) } if ( $PSBoundParameters.ContainsKey('icaproxy') ) { $payload.Add('icaproxy', $icaproxy) } if ( $PSBoundParameters.ContainsKey('clientchoices') ) { $payload.Add('clientchoices', $clientchoices) } if ( $PSBoundParameters.ContainsKey('epaclienttype') ) { $payload.Add('epaclienttype', $epaclienttype) } if ( $PSBoundParameters.ContainsKey('encryptcsecexp') ) { $payload.Add('encryptcsecexp', $encryptcsecexp) } if ( $PSBoundParameters.ContainsKey('securebrowse') ) { $payload.Add('securebrowse', $securebrowse) } if ( $PSBoundParameters.ContainsKey('clientversions') ) { $payload.Add('clientversions', $clientversions) } if ( $PSBoundParameters.ContainsKey('icasessiontimeout') ) { $payload.Add('icasessiontimeout', $icasessiontimeout) } if ( $PSBoundParameters.ContainsKey('backendserversni') ) { $payload.Add('backendserversni', $backendserversni) } if ( $PSBoundParameters.ContainsKey('backendcertvalidation') ) { $payload.Add('backendcertvalidation', $backendcertvalidation) } if ( $PSBoundParameters.ContainsKey('netmask') ) { $payload.Add('netmask', $netmask) } if ( $PSBoundParameters.ContainsKey('samesite') ) { $payload.Add('samesite', $samesite) } if ( $PSCmdlet.ShouldProcess("vpnparameter", "Unset Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type vpnparameter -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-NSUnsetVpnparameter: Finished" } } function Invoke-NSGetVpnparameter { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Configuration for VPN parameter resource. .PARAMETER GetAll Retrieve all vpnparameter object(s). .PARAMETER Count If specified, the count of the vpnparameter 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-NSGetVpnparameter Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnparameter -GetAll Get all vpnparameter data. .EXAMPLE PS C:\>Invoke-NSGetVpnparameter -name <string> Get vpnparameter object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnparameter -Filter @{ 'name'='<value>' } Get vpnparameter data with a filter. .NOTES File Name : Invoke-NSGetVpnparameter Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnparameter/ Requires : PowerShell v5.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-NSGetVpnparameter: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all vpnparameter objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnparameter -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 vpnparameter objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnparameter -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnparameter objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnparameter -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnparameter configuration for property ''" } else { Write-Verbose "Retrieving vpnparameter configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnparameter -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-NSGetVpnparameter: Ended" } } function Invoke-NSKillVpnpcoipconnection { <# .SYNOPSIS Kill Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for PCoIP connection resource. .PARAMETER Username User name for the PCOIP connections. .PARAMETER All All active pcoip connections. .EXAMPLE PS C:\>Invoke-NSKillVpnpcoipconnection An example how to kill vpnpcoipconnection config Object(s). .NOTES File Name : Invoke-NSKillVpnpcoipconnection Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnpcoipconnection/ Requires : PowerShell v5.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]$Username, [boolean]$All ) begin { Write-Verbose "Invoke-NSKillVpnpcoipconnection: Starting" } process { try { $payload = @{ } if ( $PSBoundParameters.ContainsKey('username') ) { $payload.Add('username', $username) } if ( $PSBoundParameters.ContainsKey('all') ) { $payload.Add('all', $all) } if ( $PSCmdlet.ShouldProcess($Name, "Kill Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type vpnpcoipconnection -Action kill -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-NSKillVpnpcoipconnection: Finished" } } function Invoke-NSGetVpnpcoipconnection { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Configuration for PCoIP connection resource. .PARAMETER Username User name for the PCOIP connections. .PARAMETER Nodeid Unique number that identifies the cluster node. Maximum value = 31 .PARAMETER GetAll Retrieve all vpnpcoipconnection object(s). .PARAMETER Count If specified, the count of the vpnpcoipconnection 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-NSGetVpnpcoipconnection Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnpcoipconnection -GetAll Get all vpnpcoipconnection data. .EXAMPLE PS C:\>Invoke-NSGetVpnpcoipconnection -Count Get the number of vpnpcoipconnection objects. .EXAMPLE PS C:\>Invoke-NSGetVpnpcoipconnection -name <string> Get vpnpcoipconnection object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnpcoipconnection -Filter @{ 'name'='<value>' } Get vpnpcoipconnection data with a filter. .NOTES File Name : Invoke-NSGetVpnpcoipconnection Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnpcoipconnection/ Requires : PowerShell v5.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]$Username, [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-NSGetVpnpcoipconnection: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all vpnpcoipconnection objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnpcoipconnection -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 vpnpcoipconnection objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnpcoipconnection -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnpcoipconnection objects by arguments" $arguments = @{ } if ( $PSBoundParameters.ContainsKey('username') ) { $arguments.Add('username', $username) } if ( $PSBoundParameters.ContainsKey('nodeid') ) { $arguments.Add('nodeid', $nodeid) } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnpcoipconnection -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnpcoipconnection configuration for property ''" } else { Write-Verbose "Retrieving vpnpcoipconnection configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnpcoipconnection -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-NSGetVpnpcoipconnection: Ended" } } function Invoke-NSAddVpnpcoipprofile { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for PCoIP session profile resource. .PARAMETER Name name of PCoIP profile. .PARAMETER Conserverurl Connection server URL. .PARAMETER Icvverification ICV verification for PCOIP transport packets. Possible values = ENABLED, DISABLED .PARAMETER Sessionidletimeout PCOIP Idle Session timeout. Maximum value = 240 .PARAMETER PassThru Return details about the created vpnpcoipprofile item. .EXAMPLE PS C:\>Invoke-NSAddVpnpcoipprofile -name <string> -conserverurl <string> An example how to add vpnpcoipprofile config Object(s). .NOTES File Name : Invoke-NSAddVpnpcoipprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnpcoipprofile/ Requires : PowerShell v5.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]$Conserverurl, [ValidateSet('ENABLED', 'DISABLED')] [string]$Icvverification = 'DISABLED', [double]$Sessionidletimeout = '180', [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnpcoipprofile: Starting" } process { try { $payload = @{ name = $name conserverurl = $conserverurl } if ( $PSBoundParameters.ContainsKey('icvverification') ) { $payload.Add('icvverification', $icvverification) } if ( $PSBoundParameters.ContainsKey('sessionidletimeout') ) { $payload.Add('sessionidletimeout', $sessionidletimeout) } if ( $PSCmdlet.ShouldProcess("vpnpcoipprofile", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type vpnpcoipprofile -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-NSGetVpnpcoipprofile -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnpcoipprofile: Finished" } } function Invoke-NSDeleteVpnpcoipprofile { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for PCoIP session profile resource. .PARAMETER Name name of PCoIP profile. .EXAMPLE PS C:\>Invoke-NSDeleteVpnpcoipprofile -Name <string> An example how to delete vpnpcoipprofile config Object(s). .NOTES File Name : Invoke-NSDeleteVpnpcoipprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnpcoipprofile/ Requires : PowerShell v5.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-NSDeleteVpnpcoipprofile: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnpcoipprofile -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-NSDeleteVpnpcoipprofile: Finished" } } function Invoke-NSUpdateVpnpcoipprofile { <# .SYNOPSIS Update Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for PCoIP session profile resource. .PARAMETER Name name of PCoIP profile. .PARAMETER Conserverurl Connection server URL. .PARAMETER Icvverification ICV verification for PCOIP transport packets. Possible values = ENABLED, DISABLED .PARAMETER Sessionidletimeout PCOIP Idle Session timeout. Maximum value = 240 .PARAMETER PassThru Return details about the created vpnpcoipprofile item. .EXAMPLE PS C:\>Invoke-NSUpdateVpnpcoipprofile -name <string> An example how to update vpnpcoipprofile config Object(s). .NOTES File Name : Invoke-NSUpdateVpnpcoipprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnpcoipprofile/ Requires : PowerShell v5.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, [string]$Conserverurl, [ValidateSet('ENABLED', 'DISABLED')] [string]$Icvverification, [double]$Sessionidletimeout, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateVpnpcoipprofile: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('conserverurl') ) { $payload.Add('conserverurl', $conserverurl) } if ( $PSBoundParameters.ContainsKey('icvverification') ) { $payload.Add('icvverification', $icvverification) } if ( $PSBoundParameters.ContainsKey('sessionidletimeout') ) { $payload.Add('sessionidletimeout', $sessionidletimeout) } if ( $PSCmdlet.ShouldProcess("vpnpcoipprofile", "Update Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnpcoipprofile -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-NSGetVpnpcoipprofile -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateVpnpcoipprofile: Finished" } } function Invoke-NSUnsetVpnpcoipprofile { <# .SYNOPSIS Unset Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for PCoIP session profile resource. .PARAMETER Name name of PCoIP profile. .PARAMETER Icvverification ICV verification for PCOIP transport packets. Possible values = ENABLED, DISABLED .PARAMETER Sessionidletimeout PCOIP Idle Session timeout. Maximum value = 240 .EXAMPLE PS C:\>Invoke-NSUnsetVpnpcoipprofile -name <string> An example how to unset vpnpcoipprofile config Object(s). .NOTES File Name : Invoke-NSUnsetVpnpcoipprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnpcoipprofile Requires : PowerShell v5.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]$icvverification, [Boolean]$sessionidletimeout ) begin { Write-Verbose "Invoke-NSUnsetVpnpcoipprofile: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('icvverification') ) { $payload.Add('icvverification', $icvverification) } if ( $PSBoundParameters.ContainsKey('sessionidletimeout') ) { $payload.Add('sessionidletimeout', $sessionidletimeout) } if ( $PSCmdlet.ShouldProcess("$name", "Unset Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type vpnpcoipprofile -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-NSUnsetVpnpcoipprofile: Finished" } } function Invoke-NSGetVpnpcoipprofile { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Configuration for PCoIP session profile resource. .PARAMETER Name name of PCoIP profile. .PARAMETER GetAll Retrieve all vpnpcoipprofile object(s). .PARAMETER Count If specified, the count of the vpnpcoipprofile 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-NSGetVpnpcoipprofile Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnpcoipprofile -GetAll Get all vpnpcoipprofile data. .EXAMPLE PS C:\>Invoke-NSGetVpnpcoipprofile -Count Get the number of vpnpcoipprofile objects. .EXAMPLE PS C:\>Invoke-NSGetVpnpcoipprofile -name <string> Get vpnpcoipprofile object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnpcoipprofile -Filter @{ 'name'='<value>' } Get vpnpcoipprofile data with a filter. .NOTES File Name : Invoke-NSGetVpnpcoipprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnpcoipprofile/ Requires : PowerShell v5.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-NSGetVpnpcoipprofile: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all vpnpcoipprofile objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnpcoipprofile -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 vpnpcoipprofile objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnpcoipprofile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnpcoipprofile objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnpcoipprofile -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnpcoipprofile configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnpcoipprofile -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnpcoipprofile configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnpcoipprofile -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-NSGetVpnpcoipprofile: Ended" } } function Invoke-NSAddVpnpcoipvserverprofile { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for PCoIP vserver profile resource. .PARAMETER Name name of PCoIP vserver profile. .PARAMETER Logindomain Login domain for PCoIP users. .PARAMETER Udpport UDP port for PCoIP data traffic. .PARAMETER PassThru Return details about the created vpnpcoipvserverprofile item. .EXAMPLE PS C:\>Invoke-NSAddVpnpcoipvserverprofile -name <string> -logindomain <string> An example how to add vpnpcoipvserverprofile config Object(s). .NOTES File Name : Invoke-NSAddVpnpcoipvserverprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnpcoipvserverprofile/ Requires : PowerShell v5.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]$Logindomain, [ValidateRange(1, 65535)] [int]$Udpport = '4172', [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnpcoipvserverprofile: Starting" } process { try { $payload = @{ name = $name logindomain = $logindomain } if ( $PSBoundParameters.ContainsKey('udpport') ) { $payload.Add('udpport', $udpport) } if ( $PSCmdlet.ShouldProcess("vpnpcoipvserverprofile", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type vpnpcoipvserverprofile -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-NSGetVpnpcoipvserverprofile -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnpcoipvserverprofile: Finished" } } function Invoke-NSDeleteVpnpcoipvserverprofile { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for PCoIP vserver profile resource. .PARAMETER Name name of PCoIP vserver profile. .EXAMPLE PS C:\>Invoke-NSDeleteVpnpcoipvserverprofile -Name <string> An example how to delete vpnpcoipvserverprofile config Object(s). .NOTES File Name : Invoke-NSDeleteVpnpcoipvserverprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnpcoipvserverprofile/ Requires : PowerShell v5.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-NSDeleteVpnpcoipvserverprofile: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnpcoipvserverprofile -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-NSDeleteVpnpcoipvserverprofile: Finished" } } function Invoke-NSUpdateVpnpcoipvserverprofile { <# .SYNOPSIS Update Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for PCoIP vserver profile resource. .PARAMETER Name name of PCoIP vserver profile. .PARAMETER Udpport UDP port for PCoIP data traffic. .PARAMETER Logindomain Login domain for PCoIP users. .PARAMETER PassThru Return details about the created vpnpcoipvserverprofile item. .EXAMPLE PS C:\>Invoke-NSUpdateVpnpcoipvserverprofile -name <string> An example how to update vpnpcoipvserverprofile config Object(s). .NOTES File Name : Invoke-NSUpdateVpnpcoipvserverprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnpcoipvserverprofile/ Requires : PowerShell v5.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, [ValidateRange(1, 65535)] [int]$Udpport, [string]$Logindomain, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateVpnpcoipvserverprofile: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('udpport') ) { $payload.Add('udpport', $udpport) } if ( $PSBoundParameters.ContainsKey('logindomain') ) { $payload.Add('logindomain', $logindomain) } if ( $PSCmdlet.ShouldProcess("vpnpcoipvserverprofile", "Update Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnpcoipvserverprofile -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-NSGetVpnpcoipvserverprofile -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateVpnpcoipvserverprofile: Finished" } } function Invoke-NSUnsetVpnpcoipvserverprofile { <# .SYNOPSIS Unset Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for PCoIP vserver profile resource. .PARAMETER Name name of PCoIP vserver profile. .PARAMETER Udpport UDP port for PCoIP data traffic. .EXAMPLE PS C:\>Invoke-NSUnsetVpnpcoipvserverprofile -name <string> An example how to unset vpnpcoipvserverprofile config Object(s). .NOTES File Name : Invoke-NSUnsetVpnpcoipvserverprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnpcoipvserverprofile Requires : PowerShell v5.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]$udpport ) begin { Write-Verbose "Invoke-NSUnsetVpnpcoipvserverprofile: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('udpport') ) { $payload.Add('udpport', $udpport) } if ( $PSCmdlet.ShouldProcess("$name", "Unset Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type vpnpcoipvserverprofile -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-NSUnsetVpnpcoipvserverprofile: Finished" } } function Invoke-NSGetVpnpcoipvserverprofile { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Configuration for PCoIP vserver profile resource. .PARAMETER Name name of PCoIP vserver profile. .PARAMETER GetAll Retrieve all vpnpcoipvserverprofile object(s). .PARAMETER Count If specified, the count of the vpnpcoipvserverprofile 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-NSGetVpnpcoipvserverprofile Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnpcoipvserverprofile -GetAll Get all vpnpcoipvserverprofile data. .EXAMPLE PS C:\>Invoke-NSGetVpnpcoipvserverprofile -Count Get the number of vpnpcoipvserverprofile objects. .EXAMPLE PS C:\>Invoke-NSGetVpnpcoipvserverprofile -name <string> Get vpnpcoipvserverprofile object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnpcoipvserverprofile -Filter @{ 'name'='<value>' } Get vpnpcoipvserverprofile data with a filter. .NOTES File Name : Invoke-NSGetVpnpcoipvserverprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnpcoipvserverprofile/ Requires : PowerShell v5.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-NSGetVpnpcoipvserverprofile: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all vpnpcoipvserverprofile objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnpcoipvserverprofile -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 vpnpcoipvserverprofile objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnpcoipvserverprofile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnpcoipvserverprofile objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnpcoipvserverprofile -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnpcoipvserverprofile configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnpcoipvserverprofile -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnpcoipvserverprofile configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnpcoipvserverprofile -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-NSGetVpnpcoipvserverprofile: Ended" } } function Invoke-NSAddVpnportaltheme { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for portaltheme resource. .PARAMETER Name Name of the uitheme. .PARAMETER Basetheme . Possible values = Default, Greenbubble, X1, RfWebUI .PARAMETER PassThru Return details about the created vpnportaltheme item. .EXAMPLE PS C:\>Invoke-NSAddVpnportaltheme -name <string> -basetheme <string> An example how to add vpnportaltheme config Object(s). .NOTES File Name : Invoke-NSAddVpnportaltheme Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnportaltheme/ Requires : PowerShell v5.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 })] [ValidateSet('Default', 'Greenbubble', 'X1', 'RfWebUI')] [string]$Basetheme, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnportaltheme: Starting" } process { try { $payload = @{ name = $name basetheme = $basetheme } if ( $PSCmdlet.ShouldProcess("vpnportaltheme", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type vpnportaltheme -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-NSGetVpnportaltheme -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnportaltheme: Finished" } } function Invoke-NSDeleteVpnportaltheme { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for portaltheme resource. .PARAMETER Name Name of the uitheme. .EXAMPLE PS C:\>Invoke-NSDeleteVpnportaltheme -Name <string> An example how to delete vpnportaltheme config Object(s). .NOTES File Name : Invoke-NSDeleteVpnportaltheme Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnportaltheme/ Requires : PowerShell v5.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-NSDeleteVpnportaltheme: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnportaltheme -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-NSDeleteVpnportaltheme: Finished" } } function Invoke-NSGetVpnportaltheme { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Configuration for portaltheme resource. .PARAMETER Name Name of the uitheme. .PARAMETER GetAll Retrieve all vpnportaltheme object(s). .PARAMETER Count If specified, the count of the vpnportaltheme 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-NSGetVpnportaltheme Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnportaltheme -GetAll Get all vpnportaltheme data. .EXAMPLE PS C:\>Invoke-NSGetVpnportaltheme -Count Get the number of vpnportaltheme objects. .EXAMPLE PS C:\>Invoke-NSGetVpnportaltheme -name <string> Get vpnportaltheme object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnportaltheme -Filter @{ 'name'='<value>' } Get vpnportaltheme data with a filter. .NOTES File Name : Invoke-NSGetVpnportaltheme Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnportaltheme/ Requires : PowerShell v5.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-NSGetVpnportaltheme: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all vpnportaltheme objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnportaltheme -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 vpnportaltheme objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnportaltheme -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnportaltheme objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnportaltheme -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnportaltheme configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnportaltheme -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnportaltheme configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnportaltheme -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-NSGetVpnportaltheme: Ended" } } function Invoke-NSAddVpnsamlssoprofile { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for SAML sso action resource. .PARAMETER Name Name for the new saml single sign-on profile. 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. Cannot be changed after an SSO action is created. .PARAMETER Samlsigningcertname Name of the signing authority as given in the SAML server's SSL certificate. .PARAMETER Assertionconsumerserviceurl URL to which the assertion is to be sent. .PARAMETER Relaystaterule Expression to extract relaystate to be sent along with assertion. Evaluation of this expression should return TEXT content. This is typically a target url to which user is redirected after the recipient validates SAML token. .PARAMETER Sendpassword Option to send password in assertion. Possible values = ON, OFF .PARAMETER Samlissuername The name to be used in requests sent from Citrix ADC to IdP to uniquely identify Citrix ADC. .PARAMETER Signaturealg Algorithm to be used to sign/verify SAML transactions. Possible values = RSA-SHA1, RSA-SHA256 .PARAMETER Digestmethod Algorithm to be used to compute/verify digest for SAML transactions. Possible values = SHA1, SHA256 .PARAMETER Audience Audience for which assertion sent by IdP is applicable. This is typically entity name or url that represents ServiceProvider. .PARAMETER Nameidformat Format of Name Identifier sent in Assertion. Possible values = Unspecified, emailAddress, X509SubjectName, WindowsDomainQualifiedName, kerberos, entity, persistent, transient .PARAMETER Nameidexpr Expression that will be evaluated to obtain NameIdentifier to be sent in assertion. .PARAMETER Attribute1 Name of attribute1 that needs to be sent in SAML Assertion. .PARAMETER Attribute1expr Expression that will be evaluated to obtain attribute1's value to be sent in Assertion. .PARAMETER Attribute1friendlyname User-Friendly Name of attribute1 that needs to be sent in SAML Assertion. .PARAMETER Attribute1format Format of Attribute1 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute2 Name of attribute2 that needs to be sent in SAML Assertion. .PARAMETER Attribute2expr Expression that will be evaluated to obtain attribute2's value to be sent in Assertion. .PARAMETER Attribute2friendlyname User-Friendly Name of attribute2 that needs to be sent in SAML Assertion. .PARAMETER Attribute2format Format of Attribute2 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute3 Name of attribute3 that needs to be sent in SAML Assertion. .PARAMETER Attribute3expr Expression that will be evaluated to obtain attribute3's value to be sent in Assertion. .PARAMETER Attribute3friendlyname User-Friendly Name of attribute3 that needs to be sent in SAML Assertion. .PARAMETER Attribute3format Format of Attribute3 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute4 Name of attribute4 that needs to be sent in SAML Assertion. .PARAMETER Attribute4expr Expression that will be evaluated to obtain attribute4's value to be sent in Assertion. .PARAMETER Attribute4friendlyname User-Friendly Name of attribute4 that needs to be sent in SAML Assertion. .PARAMETER Attribute4format Format of Attribute4 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute5 Name of attribute5 that needs to be sent in SAML Assertion. .PARAMETER Attribute5expr Expression that will be evaluated to obtain attribute5's value to be sent in Assertion. .PARAMETER Attribute5friendlyname User-Friendly Name of attribute5 that needs to be sent in SAML Assertion. .PARAMETER Attribute5format Format of Attribute5 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute6 Name of attribute6 that needs to be sent in SAML Assertion. .PARAMETER Attribute6expr Expression that will be evaluated to obtain attribute6's value to be sent in Assertion. .PARAMETER Attribute6friendlyname User-Friendly Name of attribute6 that needs to be sent in SAML Assertion. .PARAMETER Attribute6format Format of Attribute6 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute7 Name of attribute7 that needs to be sent in SAML Assertion. .PARAMETER Attribute7expr Expression that will be evaluated to obtain attribute7's value to be sent in Assertion. .PARAMETER Attribute7friendlyname User-Friendly Name of attribute7 that needs to be sent in SAML Assertion. .PARAMETER Attribute7format Format of Attribute7 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute8 Name of attribute8 that needs to be sent in SAML Assertion. .PARAMETER Attribute8expr Expression that will be evaluated to obtain attribute8's value to be sent in Assertion. .PARAMETER Attribute8friendlyname User-Friendly Name of attribute8 that needs to be sent in SAML Assertion. .PARAMETER Attribute8format Format of Attribute8 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute9 Name of attribute9 that needs to be sent in SAML Assertion. .PARAMETER Attribute9expr Expression that will be evaluated to obtain attribute9's value to be sent in Assertion. .PARAMETER Attribute9friendlyname User-Friendly Name of attribute9 that needs to be sent in SAML Assertion. .PARAMETER Attribute9format Format of Attribute9 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute10 Name of attribute10 that needs to be sent in SAML Assertion. .PARAMETER Attribute10expr Expression that will be evaluated to obtain attribute10's value to be sent in Assertion. .PARAMETER Attribute10friendlyname User-Friendly Name of attribute10 that needs to be sent in SAML Assertion. .PARAMETER Attribute10format Format of Attribute10 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute11 Name of attribute11 that needs to be sent in SAML Assertion. .PARAMETER Attribute11expr Expression that will be evaluated to obtain attribute11's value to be sent in Assertion. .PARAMETER Attribute11friendlyname User-Friendly Name of attribute11 that needs to be sent in SAML Assertion. .PARAMETER Attribute11format Format of Attribute11 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute12 Name of attribute12 that needs to be sent in SAML Assertion. .PARAMETER Attribute12expr Expression that will be evaluated to obtain attribute12's value to be sent in Assertion. .PARAMETER Attribute12friendlyname User-Friendly Name of attribute12 that needs to be sent in SAML Assertion. .PARAMETER Attribute12format Format of Attribute12 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute13 Name of attribute13 that needs to be sent in SAML Assertion. .PARAMETER Attribute13expr Expression that will be evaluated to obtain attribute13's value to be sent in Assertion. .PARAMETER Attribute13friendlyname User-Friendly Name of attribute13 that needs to be sent in SAML Assertion. .PARAMETER Attribute13format Format of Attribute13 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute14 Name of attribute14 that needs to be sent in SAML Assertion. .PARAMETER Attribute14expr Expression that will be evaluated to obtain attribute14's value to be sent in Assertion. .PARAMETER Attribute14friendlyname User-Friendly Name of attribute14 that needs to be sent in SAML Assertion. .PARAMETER Attribute14format Format of Attribute14 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute15 Name of attribute15 that needs to be sent in SAML Assertion. .PARAMETER Attribute15expr Expression that will be evaluated to obtain attribute15's value to be sent in Assertion. .PARAMETER Attribute15friendlyname User-Friendly Name of attribute15 that needs to be sent in SAML Assertion. .PARAMETER Attribute15format Format of Attribute15 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute16 Name of attribute16 that needs to be sent in SAML Assertion. .PARAMETER Attribute16expr Expression that will be evaluated to obtain attribute16's value to be sent in Assertion. .PARAMETER Attribute16friendlyname User-Friendly Name of attribute16 that needs to be sent in SAML Assertion. .PARAMETER Attribute16format Format of Attribute16 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Encryptassertion Option to encrypt assertion when Citrix ADC sends one. Possible values = ON, OFF .PARAMETER Samlspcertname Name of the SSL certificate of peer/receving party using which Assertion is encrypted. .PARAMETER Encryptionalgorithm Algorithm to be used to encrypt SAML assertion. Possible values = DES3, AES128, AES192, AES256 .PARAMETER Skewtime This option specifies the number of minutes on either side of current time that the assertion would be valid. For example, if skewTime is 10, then assertion would be valid from (current time - 10) min to (current time + 10) min, ie 20min in all. .PARAMETER Signassertion Option to sign portions of assertion when Citrix ADC IDP sends one. Based on the user selection, either Assertion or Response or Both or none can be signed. Possible values = NONE, ASSERTION, RESPONSE, BOTH .PARAMETER Signatureservice Name of the service in cloud used to sign the data. .PARAMETER PassThru Return details about the created vpnsamlssoprofile item. .EXAMPLE PS C:\>Invoke-NSAddVpnsamlssoprofile -name <string> -assertionconsumerserviceurl <string> An example how to add vpnsamlssoprofile config Object(s). .NOTES File Name : Invoke-NSAddVpnsamlssoprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnsamlssoprofile/ Requires : PowerShell v5.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]$Name, [ValidateScript({ $_.Length -gt 1 })] [string]$Samlsigningcertname, [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Assertionconsumerserviceurl, [string]$Relaystaterule, [ValidateSet('ON', 'OFF')] [string]$Sendpassword = 'OFF', [ValidateScript({ $_.Length -gt 1 })] [string]$Samlissuername, [ValidateSet('RSA-SHA1', 'RSA-SHA256')] [string]$Signaturealg = 'RSA-SHA256', [ValidateSet('SHA1', 'SHA256')] [string]$Digestmethod = 'SHA256', [string]$Audience, [ValidateSet('Unspecified', 'emailAddress', 'X509SubjectName', 'WindowsDomainQualifiedName', 'kerberos', 'entity', 'persistent', 'transient')] [string]$Nameidformat = 'transient', [string]$Nameidexpr, [string]$Attribute1, [string]$Attribute1expr, [string]$Attribute1friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute1format, [string]$Attribute2, [string]$Attribute2expr, [string]$Attribute2friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute2format, [string]$Attribute3, [string]$Attribute3expr, [string]$Attribute3friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute3format, [string]$Attribute4, [string]$Attribute4expr, [string]$Attribute4friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute4format, [string]$Attribute5, [string]$Attribute5expr, [string]$Attribute5friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute5format, [string]$Attribute6, [string]$Attribute6expr, [string]$Attribute6friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute6format, [string]$Attribute7, [string]$Attribute7expr, [string]$Attribute7friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute7format, [string]$Attribute8, [string]$Attribute8expr, [string]$Attribute8friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute8format, [string]$Attribute9, [string]$Attribute9expr, [string]$Attribute9friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute9format, [string]$Attribute10, [string]$Attribute10expr, [string]$Attribute10friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute10format, [string]$Attribute11, [string]$Attribute11expr, [string]$Attribute11friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute11format, [string]$Attribute12, [string]$Attribute12expr, [string]$Attribute12friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute12format, [string]$Attribute13, [string]$Attribute13expr, [string]$Attribute13friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute13format, [string]$Attribute14, [string]$Attribute14expr, [string]$Attribute14friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute14format, [string]$Attribute15, [string]$Attribute15expr, [string]$Attribute15friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute15format, [string]$Attribute16, [string]$Attribute16expr, [string]$Attribute16friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute16format, [ValidateSet('ON', 'OFF')] [string]$Encryptassertion = 'OFF', [ValidateScript({ $_.Length -gt 1 })] [string]$Samlspcertname, [ValidateSet('DES3', 'AES128', 'AES192', 'AES256')] [string]$Encryptionalgorithm = 'AES256', [double]$Skewtime = '5', [ValidateSet('NONE', 'ASSERTION', 'RESPONSE', 'BOTH')] [string]$Signassertion = 'ASSERTION', [ValidateScript({ $_.Length -gt 1 })] [string]$Signatureservice, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnsamlssoprofile: Starting" } process { try { $payload = @{ name = $name assertionconsumerserviceurl = $assertionconsumerserviceurl } if ( $PSBoundParameters.ContainsKey('samlsigningcertname') ) { $payload.Add('samlsigningcertname', $samlsigningcertname) } if ( $PSBoundParameters.ContainsKey('relaystaterule') ) { $payload.Add('relaystaterule', $relaystaterule) } if ( $PSBoundParameters.ContainsKey('sendpassword') ) { $payload.Add('sendpassword', $sendpassword) } if ( $PSBoundParameters.ContainsKey('samlissuername') ) { $payload.Add('samlissuername', $samlissuername) } if ( $PSBoundParameters.ContainsKey('signaturealg') ) { $payload.Add('signaturealg', $signaturealg) } if ( $PSBoundParameters.ContainsKey('digestmethod') ) { $payload.Add('digestmethod', $digestmethod) } if ( $PSBoundParameters.ContainsKey('audience') ) { $payload.Add('audience', $audience) } if ( $PSBoundParameters.ContainsKey('nameidformat') ) { $payload.Add('nameidformat', $nameidformat) } if ( $PSBoundParameters.ContainsKey('nameidexpr') ) { $payload.Add('nameidexpr', $nameidexpr) } if ( $PSBoundParameters.ContainsKey('attribute1') ) { $payload.Add('attribute1', $attribute1) } if ( $PSBoundParameters.ContainsKey('attribute1expr') ) { $payload.Add('attribute1expr', $attribute1expr) } if ( $PSBoundParameters.ContainsKey('attribute1friendlyname') ) { $payload.Add('attribute1friendlyname', $attribute1friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute1format') ) { $payload.Add('attribute1format', $attribute1format) } if ( $PSBoundParameters.ContainsKey('attribute2') ) { $payload.Add('attribute2', $attribute2) } if ( $PSBoundParameters.ContainsKey('attribute2expr') ) { $payload.Add('attribute2expr', $attribute2expr) } if ( $PSBoundParameters.ContainsKey('attribute2friendlyname') ) { $payload.Add('attribute2friendlyname', $attribute2friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute2format') ) { $payload.Add('attribute2format', $attribute2format) } if ( $PSBoundParameters.ContainsKey('attribute3') ) { $payload.Add('attribute3', $attribute3) } if ( $PSBoundParameters.ContainsKey('attribute3expr') ) { $payload.Add('attribute3expr', $attribute3expr) } if ( $PSBoundParameters.ContainsKey('attribute3friendlyname') ) { $payload.Add('attribute3friendlyname', $attribute3friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute3format') ) { $payload.Add('attribute3format', $attribute3format) } if ( $PSBoundParameters.ContainsKey('attribute4') ) { $payload.Add('attribute4', $attribute4) } if ( $PSBoundParameters.ContainsKey('attribute4expr') ) { $payload.Add('attribute4expr', $attribute4expr) } if ( $PSBoundParameters.ContainsKey('attribute4friendlyname') ) { $payload.Add('attribute4friendlyname', $attribute4friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute4format') ) { $payload.Add('attribute4format', $attribute4format) } if ( $PSBoundParameters.ContainsKey('attribute5') ) { $payload.Add('attribute5', $attribute5) } if ( $PSBoundParameters.ContainsKey('attribute5expr') ) { $payload.Add('attribute5expr', $attribute5expr) } if ( $PSBoundParameters.ContainsKey('attribute5friendlyname') ) { $payload.Add('attribute5friendlyname', $attribute5friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute5format') ) { $payload.Add('attribute5format', $attribute5format) } if ( $PSBoundParameters.ContainsKey('attribute6') ) { $payload.Add('attribute6', $attribute6) } if ( $PSBoundParameters.ContainsKey('attribute6expr') ) { $payload.Add('attribute6expr', $attribute6expr) } if ( $PSBoundParameters.ContainsKey('attribute6friendlyname') ) { $payload.Add('attribute6friendlyname', $attribute6friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute6format') ) { $payload.Add('attribute6format', $attribute6format) } if ( $PSBoundParameters.ContainsKey('attribute7') ) { $payload.Add('attribute7', $attribute7) } if ( $PSBoundParameters.ContainsKey('attribute7expr') ) { $payload.Add('attribute7expr', $attribute7expr) } if ( $PSBoundParameters.ContainsKey('attribute7friendlyname') ) { $payload.Add('attribute7friendlyname', $attribute7friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute7format') ) { $payload.Add('attribute7format', $attribute7format) } if ( $PSBoundParameters.ContainsKey('attribute8') ) { $payload.Add('attribute8', $attribute8) } if ( $PSBoundParameters.ContainsKey('attribute8expr') ) { $payload.Add('attribute8expr', $attribute8expr) } if ( $PSBoundParameters.ContainsKey('attribute8friendlyname') ) { $payload.Add('attribute8friendlyname', $attribute8friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute8format') ) { $payload.Add('attribute8format', $attribute8format) } if ( $PSBoundParameters.ContainsKey('attribute9') ) { $payload.Add('attribute9', $attribute9) } if ( $PSBoundParameters.ContainsKey('attribute9expr') ) { $payload.Add('attribute9expr', $attribute9expr) } if ( $PSBoundParameters.ContainsKey('attribute9friendlyname') ) { $payload.Add('attribute9friendlyname', $attribute9friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute9format') ) { $payload.Add('attribute9format', $attribute9format) } if ( $PSBoundParameters.ContainsKey('attribute10') ) { $payload.Add('attribute10', $attribute10) } if ( $PSBoundParameters.ContainsKey('attribute10expr') ) { $payload.Add('attribute10expr', $attribute10expr) } if ( $PSBoundParameters.ContainsKey('attribute10friendlyname') ) { $payload.Add('attribute10friendlyname', $attribute10friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute10format') ) { $payload.Add('attribute10format', $attribute10format) } if ( $PSBoundParameters.ContainsKey('attribute11') ) { $payload.Add('attribute11', $attribute11) } if ( $PSBoundParameters.ContainsKey('attribute11expr') ) { $payload.Add('attribute11expr', $attribute11expr) } if ( $PSBoundParameters.ContainsKey('attribute11friendlyname') ) { $payload.Add('attribute11friendlyname', $attribute11friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute11format') ) { $payload.Add('attribute11format', $attribute11format) } if ( $PSBoundParameters.ContainsKey('attribute12') ) { $payload.Add('attribute12', $attribute12) } if ( $PSBoundParameters.ContainsKey('attribute12expr') ) { $payload.Add('attribute12expr', $attribute12expr) } if ( $PSBoundParameters.ContainsKey('attribute12friendlyname') ) { $payload.Add('attribute12friendlyname', $attribute12friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute12format') ) { $payload.Add('attribute12format', $attribute12format) } if ( $PSBoundParameters.ContainsKey('attribute13') ) { $payload.Add('attribute13', $attribute13) } if ( $PSBoundParameters.ContainsKey('attribute13expr') ) { $payload.Add('attribute13expr', $attribute13expr) } if ( $PSBoundParameters.ContainsKey('attribute13friendlyname') ) { $payload.Add('attribute13friendlyname', $attribute13friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute13format') ) { $payload.Add('attribute13format', $attribute13format) } if ( $PSBoundParameters.ContainsKey('attribute14') ) { $payload.Add('attribute14', $attribute14) } if ( $PSBoundParameters.ContainsKey('attribute14expr') ) { $payload.Add('attribute14expr', $attribute14expr) } if ( $PSBoundParameters.ContainsKey('attribute14friendlyname') ) { $payload.Add('attribute14friendlyname', $attribute14friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute14format') ) { $payload.Add('attribute14format', $attribute14format) } if ( $PSBoundParameters.ContainsKey('attribute15') ) { $payload.Add('attribute15', $attribute15) } if ( $PSBoundParameters.ContainsKey('attribute15expr') ) { $payload.Add('attribute15expr', $attribute15expr) } if ( $PSBoundParameters.ContainsKey('attribute15friendlyname') ) { $payload.Add('attribute15friendlyname', $attribute15friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute15format') ) { $payload.Add('attribute15format', $attribute15format) } if ( $PSBoundParameters.ContainsKey('attribute16') ) { $payload.Add('attribute16', $attribute16) } if ( $PSBoundParameters.ContainsKey('attribute16expr') ) { $payload.Add('attribute16expr', $attribute16expr) } if ( $PSBoundParameters.ContainsKey('attribute16friendlyname') ) { $payload.Add('attribute16friendlyname', $attribute16friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute16format') ) { $payload.Add('attribute16format', $attribute16format) } if ( $PSBoundParameters.ContainsKey('encryptassertion') ) { $payload.Add('encryptassertion', $encryptassertion) } if ( $PSBoundParameters.ContainsKey('samlspcertname') ) { $payload.Add('samlspcertname', $samlspcertname) } if ( $PSBoundParameters.ContainsKey('encryptionalgorithm') ) { $payload.Add('encryptionalgorithm', $encryptionalgorithm) } if ( $PSBoundParameters.ContainsKey('skewtime') ) { $payload.Add('skewtime', $skewtime) } if ( $PSBoundParameters.ContainsKey('signassertion') ) { $payload.Add('signassertion', $signassertion) } if ( $PSBoundParameters.ContainsKey('signatureservice') ) { $payload.Add('signatureservice', $signatureservice) } if ( $PSCmdlet.ShouldProcess("vpnsamlssoprofile", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type vpnsamlssoprofile -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-NSGetVpnsamlssoprofile -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnsamlssoprofile: Finished" } } function Invoke-NSDeleteVpnsamlssoprofile { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for SAML sso action resource. .PARAMETER Name Name for the new saml single sign-on profile. 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. Cannot be changed after an SSO action is created. .EXAMPLE PS C:\>Invoke-NSDeleteVpnsamlssoprofile -Name <string> An example how to delete vpnsamlssoprofile config Object(s). .NOTES File Name : Invoke-NSDeleteVpnsamlssoprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnsamlssoprofile/ Requires : PowerShell v5.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-NSDeleteVpnsamlssoprofile: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnsamlssoprofile -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-NSDeleteVpnsamlssoprofile: Finished" } } function Invoke-NSUpdateVpnsamlssoprofile { <# .SYNOPSIS Update Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for SAML sso action resource. .PARAMETER Name Name for the new saml single sign-on profile. 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. Cannot be changed after an SSO action is created. .PARAMETER Samlsigningcertname Name of the signing authority as given in the SAML server's SSL certificate. .PARAMETER Assertionconsumerserviceurl URL to which the assertion is to be sent. .PARAMETER Sendpassword Option to send password in assertion. Possible values = ON, OFF .PARAMETER Samlissuername The name to be used in requests sent from Citrix ADC to IdP to uniquely identify Citrix ADC. .PARAMETER Relaystaterule Expression to extract relaystate to be sent along with assertion. Evaluation of this expression should return TEXT content. This is typically a target url to which user is redirected after the recipient validates SAML token. .PARAMETER Signaturealg Algorithm to be used to sign/verify SAML transactions. Possible values = RSA-SHA1, RSA-SHA256 .PARAMETER Digestmethod Algorithm to be used to compute/verify digest for SAML transactions. Possible values = SHA1, SHA256 .PARAMETER Audience Audience for which assertion sent by IdP is applicable. This is typically entity name or url that represents ServiceProvider. .PARAMETER Nameidformat Format of Name Identifier sent in Assertion. Possible values = Unspecified, emailAddress, X509SubjectName, WindowsDomainQualifiedName, kerberos, entity, persistent, transient .PARAMETER Nameidexpr Expression that will be evaluated to obtain NameIdentifier to be sent in assertion. .PARAMETER Attribute1 Name of attribute1 that needs to be sent in SAML Assertion. .PARAMETER Attribute1expr Expression that will be evaluated to obtain attribute1's value to be sent in Assertion. .PARAMETER Attribute1friendlyname User-Friendly Name of attribute1 that needs to be sent in SAML Assertion. .PARAMETER Attribute1format Format of Attribute1 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute2 Name of attribute2 that needs to be sent in SAML Assertion. .PARAMETER Attribute2expr Expression that will be evaluated to obtain attribute2's value to be sent in Assertion. .PARAMETER Attribute2friendlyname User-Friendly Name of attribute2 that needs to be sent in SAML Assertion. .PARAMETER Attribute2format Format of Attribute2 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute3 Name of attribute3 that needs to be sent in SAML Assertion. .PARAMETER Attribute3expr Expression that will be evaluated to obtain attribute3's value to be sent in Assertion. .PARAMETER Attribute3friendlyname User-Friendly Name of attribute3 that needs to be sent in SAML Assertion. .PARAMETER Attribute3format Format of Attribute3 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute4 Name of attribute4 that needs to be sent in SAML Assertion. .PARAMETER Attribute4expr Expression that will be evaluated to obtain attribute4's value to be sent in Assertion. .PARAMETER Attribute4friendlyname User-Friendly Name of attribute4 that needs to be sent in SAML Assertion. .PARAMETER Attribute4format Format of Attribute4 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute5 Name of attribute5 that needs to be sent in SAML Assertion. .PARAMETER Attribute5expr Expression that will be evaluated to obtain attribute5's value to be sent in Assertion. .PARAMETER Attribute5friendlyname User-Friendly Name of attribute5 that needs to be sent in SAML Assertion. .PARAMETER Attribute5format Format of Attribute5 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute6 Name of attribute6 that needs to be sent in SAML Assertion. .PARAMETER Attribute6expr Expression that will be evaluated to obtain attribute6's value to be sent in Assertion. .PARAMETER Attribute6friendlyname User-Friendly Name of attribute6 that needs to be sent in SAML Assertion. .PARAMETER Attribute6format Format of Attribute6 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute7 Name of attribute7 that needs to be sent in SAML Assertion. .PARAMETER Attribute7expr Expression that will be evaluated to obtain attribute7's value to be sent in Assertion. .PARAMETER Attribute7friendlyname User-Friendly Name of attribute7 that needs to be sent in SAML Assertion. .PARAMETER Attribute7format Format of Attribute7 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute8 Name of attribute8 that needs to be sent in SAML Assertion. .PARAMETER Attribute8expr Expression that will be evaluated to obtain attribute8's value to be sent in Assertion. .PARAMETER Attribute8friendlyname User-Friendly Name of attribute8 that needs to be sent in SAML Assertion. .PARAMETER Attribute8format Format of Attribute8 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute9 Name of attribute9 that needs to be sent in SAML Assertion. .PARAMETER Attribute9expr Expression that will be evaluated to obtain attribute9's value to be sent in Assertion. .PARAMETER Attribute9friendlyname User-Friendly Name of attribute9 that needs to be sent in SAML Assertion. .PARAMETER Attribute9format Format of Attribute9 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute10 Name of attribute10 that needs to be sent in SAML Assertion. .PARAMETER Attribute10expr Expression that will be evaluated to obtain attribute10's value to be sent in Assertion. .PARAMETER Attribute10friendlyname User-Friendly Name of attribute10 that needs to be sent in SAML Assertion. .PARAMETER Attribute10format Format of Attribute10 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute11 Name of attribute11 that needs to be sent in SAML Assertion. .PARAMETER Attribute11expr Expression that will be evaluated to obtain attribute11's value to be sent in Assertion. .PARAMETER Attribute11friendlyname User-Friendly Name of attribute11 that needs to be sent in SAML Assertion. .PARAMETER Attribute11format Format of Attribute11 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute12 Name of attribute12 that needs to be sent in SAML Assertion. .PARAMETER Attribute12expr Expression that will be evaluated to obtain attribute12's value to be sent in Assertion. .PARAMETER Attribute12friendlyname User-Friendly Name of attribute12 that needs to be sent in SAML Assertion. .PARAMETER Attribute12format Format of Attribute12 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute13 Name of attribute13 that needs to be sent in SAML Assertion. .PARAMETER Attribute13expr Expression that will be evaluated to obtain attribute13's value to be sent in Assertion. .PARAMETER Attribute13friendlyname User-Friendly Name of attribute13 that needs to be sent in SAML Assertion. .PARAMETER Attribute13format Format of Attribute13 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute14 Name of attribute14 that needs to be sent in SAML Assertion. .PARAMETER Attribute14expr Expression that will be evaluated to obtain attribute14's value to be sent in Assertion. .PARAMETER Attribute14friendlyname User-Friendly Name of attribute14 that needs to be sent in SAML Assertion. .PARAMETER Attribute14format Format of Attribute14 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute15 Name of attribute15 that needs to be sent in SAML Assertion. .PARAMETER Attribute15expr Expression that will be evaluated to obtain attribute15's value to be sent in Assertion. .PARAMETER Attribute15friendlyname User-Friendly Name of attribute15 that needs to be sent in SAML Assertion. .PARAMETER Attribute15format Format of Attribute15 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute16 Name of attribute16 that needs to be sent in SAML Assertion. .PARAMETER Attribute16expr Expression that will be evaluated to obtain attribute16's value to be sent in Assertion. .PARAMETER Attribute16friendlyname User-Friendly Name of attribute16 that needs to be sent in SAML Assertion. .PARAMETER Attribute16format Format of Attribute16 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Encryptassertion Option to encrypt assertion when Citrix ADC sends one. Possible values = ON, OFF .PARAMETER Samlspcertname Name of the SSL certificate of peer/receving party using which Assertion is encrypted. .PARAMETER Encryptionalgorithm Algorithm to be used to encrypt SAML assertion. Possible values = DES3, AES128, AES192, AES256 .PARAMETER Skewtime This option specifies the number of minutes on either side of current time that the assertion would be valid. For example, if skewTime is 10, then assertion would be valid from (current time - 10) min to (current time + 10) min, ie 20min in all. .PARAMETER Signassertion Option to sign portions of assertion when Citrix ADC IDP sends one. Based on the user selection, either Assertion or Response or Both or none can be signed. Possible values = NONE, ASSERTION, RESPONSE, BOTH .PARAMETER Signatureservice Name of the service in cloud used to sign the data. .PARAMETER PassThru Return details about the created vpnsamlssoprofile item. .EXAMPLE PS C:\>Invoke-NSUpdateVpnsamlssoprofile -name <string> An example how to update vpnsamlssoprofile config Object(s). .NOTES File Name : Invoke-NSUpdateVpnsamlssoprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnsamlssoprofile/ Requires : PowerShell v5.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]$Name, [ValidateScript({ $_.Length -gt 1 })] [string]$Samlsigningcertname, [ValidateScript({ $_.Length -gt 1 })] [string]$Assertionconsumerserviceurl, [ValidateSet('ON', 'OFF')] [string]$Sendpassword, [ValidateScript({ $_.Length -gt 1 })] [string]$Samlissuername, [string]$Relaystaterule, [ValidateSet('RSA-SHA1', 'RSA-SHA256')] [string]$Signaturealg, [ValidateSet('SHA1', 'SHA256')] [string]$Digestmethod, [string]$Audience, [ValidateSet('Unspecified', 'emailAddress', 'X509SubjectName', 'WindowsDomainQualifiedName', 'kerberos', 'entity', 'persistent', 'transient')] [string]$Nameidformat, [string]$Nameidexpr, [string]$Attribute1, [string]$Attribute1expr, [string]$Attribute1friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute1format, [string]$Attribute2, [string]$Attribute2expr, [string]$Attribute2friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute2format, [string]$Attribute3, [string]$Attribute3expr, [string]$Attribute3friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute3format, [string]$Attribute4, [string]$Attribute4expr, [string]$Attribute4friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute4format, [string]$Attribute5, [string]$Attribute5expr, [string]$Attribute5friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute5format, [string]$Attribute6, [string]$Attribute6expr, [string]$Attribute6friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute6format, [string]$Attribute7, [string]$Attribute7expr, [string]$Attribute7friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute7format, [string]$Attribute8, [string]$Attribute8expr, [string]$Attribute8friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute8format, [string]$Attribute9, [string]$Attribute9expr, [string]$Attribute9friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute9format, [string]$Attribute10, [string]$Attribute10expr, [string]$Attribute10friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute10format, [string]$Attribute11, [string]$Attribute11expr, [string]$Attribute11friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute11format, [string]$Attribute12, [string]$Attribute12expr, [string]$Attribute12friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute12format, [string]$Attribute13, [string]$Attribute13expr, [string]$Attribute13friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute13format, [string]$Attribute14, [string]$Attribute14expr, [string]$Attribute14friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute14format, [string]$Attribute15, [string]$Attribute15expr, [string]$Attribute15friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute15format, [string]$Attribute16, [string]$Attribute16expr, [string]$Attribute16friendlyname, [ValidateSet('URI', 'Basic')] [string]$Attribute16format, [ValidateSet('ON', 'OFF')] [string]$Encryptassertion, [ValidateScript({ $_.Length -gt 1 })] [string]$Samlspcertname, [ValidateSet('DES3', 'AES128', 'AES192', 'AES256')] [string]$Encryptionalgorithm, [double]$Skewtime, [ValidateSet('NONE', 'ASSERTION', 'RESPONSE', 'BOTH')] [string]$Signassertion, [ValidateScript({ $_.Length -gt 1 })] [string]$Signatureservice, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateVpnsamlssoprofile: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('samlsigningcertname') ) { $payload.Add('samlsigningcertname', $samlsigningcertname) } if ( $PSBoundParameters.ContainsKey('assertionconsumerserviceurl') ) { $payload.Add('assertionconsumerserviceurl', $assertionconsumerserviceurl) } if ( $PSBoundParameters.ContainsKey('sendpassword') ) { $payload.Add('sendpassword', $sendpassword) } if ( $PSBoundParameters.ContainsKey('samlissuername') ) { $payload.Add('samlissuername', $samlissuername) } if ( $PSBoundParameters.ContainsKey('relaystaterule') ) { $payload.Add('relaystaterule', $relaystaterule) } if ( $PSBoundParameters.ContainsKey('signaturealg') ) { $payload.Add('signaturealg', $signaturealg) } if ( $PSBoundParameters.ContainsKey('digestmethod') ) { $payload.Add('digestmethod', $digestmethod) } if ( $PSBoundParameters.ContainsKey('audience') ) { $payload.Add('audience', $audience) } if ( $PSBoundParameters.ContainsKey('nameidformat') ) { $payload.Add('nameidformat', $nameidformat) } if ( $PSBoundParameters.ContainsKey('nameidexpr') ) { $payload.Add('nameidexpr', $nameidexpr) } if ( $PSBoundParameters.ContainsKey('attribute1') ) { $payload.Add('attribute1', $attribute1) } if ( $PSBoundParameters.ContainsKey('attribute1expr') ) { $payload.Add('attribute1expr', $attribute1expr) } if ( $PSBoundParameters.ContainsKey('attribute1friendlyname') ) { $payload.Add('attribute1friendlyname', $attribute1friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute1format') ) { $payload.Add('attribute1format', $attribute1format) } if ( $PSBoundParameters.ContainsKey('attribute2') ) { $payload.Add('attribute2', $attribute2) } if ( $PSBoundParameters.ContainsKey('attribute2expr') ) { $payload.Add('attribute2expr', $attribute2expr) } if ( $PSBoundParameters.ContainsKey('attribute2friendlyname') ) { $payload.Add('attribute2friendlyname', $attribute2friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute2format') ) { $payload.Add('attribute2format', $attribute2format) } if ( $PSBoundParameters.ContainsKey('attribute3') ) { $payload.Add('attribute3', $attribute3) } if ( $PSBoundParameters.ContainsKey('attribute3expr') ) { $payload.Add('attribute3expr', $attribute3expr) } if ( $PSBoundParameters.ContainsKey('attribute3friendlyname') ) { $payload.Add('attribute3friendlyname', $attribute3friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute3format') ) { $payload.Add('attribute3format', $attribute3format) } if ( $PSBoundParameters.ContainsKey('attribute4') ) { $payload.Add('attribute4', $attribute4) } if ( $PSBoundParameters.ContainsKey('attribute4expr') ) { $payload.Add('attribute4expr', $attribute4expr) } if ( $PSBoundParameters.ContainsKey('attribute4friendlyname') ) { $payload.Add('attribute4friendlyname', $attribute4friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute4format') ) { $payload.Add('attribute4format', $attribute4format) } if ( $PSBoundParameters.ContainsKey('attribute5') ) { $payload.Add('attribute5', $attribute5) } if ( $PSBoundParameters.ContainsKey('attribute5expr') ) { $payload.Add('attribute5expr', $attribute5expr) } if ( $PSBoundParameters.ContainsKey('attribute5friendlyname') ) { $payload.Add('attribute5friendlyname', $attribute5friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute5format') ) { $payload.Add('attribute5format', $attribute5format) } if ( $PSBoundParameters.ContainsKey('attribute6') ) { $payload.Add('attribute6', $attribute6) } if ( $PSBoundParameters.ContainsKey('attribute6expr') ) { $payload.Add('attribute6expr', $attribute6expr) } if ( $PSBoundParameters.ContainsKey('attribute6friendlyname') ) { $payload.Add('attribute6friendlyname', $attribute6friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute6format') ) { $payload.Add('attribute6format', $attribute6format) } if ( $PSBoundParameters.ContainsKey('attribute7') ) { $payload.Add('attribute7', $attribute7) } if ( $PSBoundParameters.ContainsKey('attribute7expr') ) { $payload.Add('attribute7expr', $attribute7expr) } if ( $PSBoundParameters.ContainsKey('attribute7friendlyname') ) { $payload.Add('attribute7friendlyname', $attribute7friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute7format') ) { $payload.Add('attribute7format', $attribute7format) } if ( $PSBoundParameters.ContainsKey('attribute8') ) { $payload.Add('attribute8', $attribute8) } if ( $PSBoundParameters.ContainsKey('attribute8expr') ) { $payload.Add('attribute8expr', $attribute8expr) } if ( $PSBoundParameters.ContainsKey('attribute8friendlyname') ) { $payload.Add('attribute8friendlyname', $attribute8friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute8format') ) { $payload.Add('attribute8format', $attribute8format) } if ( $PSBoundParameters.ContainsKey('attribute9') ) { $payload.Add('attribute9', $attribute9) } if ( $PSBoundParameters.ContainsKey('attribute9expr') ) { $payload.Add('attribute9expr', $attribute9expr) } if ( $PSBoundParameters.ContainsKey('attribute9friendlyname') ) { $payload.Add('attribute9friendlyname', $attribute9friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute9format') ) { $payload.Add('attribute9format', $attribute9format) } if ( $PSBoundParameters.ContainsKey('attribute10') ) { $payload.Add('attribute10', $attribute10) } if ( $PSBoundParameters.ContainsKey('attribute10expr') ) { $payload.Add('attribute10expr', $attribute10expr) } if ( $PSBoundParameters.ContainsKey('attribute10friendlyname') ) { $payload.Add('attribute10friendlyname', $attribute10friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute10format') ) { $payload.Add('attribute10format', $attribute10format) } if ( $PSBoundParameters.ContainsKey('attribute11') ) { $payload.Add('attribute11', $attribute11) } if ( $PSBoundParameters.ContainsKey('attribute11expr') ) { $payload.Add('attribute11expr', $attribute11expr) } if ( $PSBoundParameters.ContainsKey('attribute11friendlyname') ) { $payload.Add('attribute11friendlyname', $attribute11friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute11format') ) { $payload.Add('attribute11format', $attribute11format) } if ( $PSBoundParameters.ContainsKey('attribute12') ) { $payload.Add('attribute12', $attribute12) } if ( $PSBoundParameters.ContainsKey('attribute12expr') ) { $payload.Add('attribute12expr', $attribute12expr) } if ( $PSBoundParameters.ContainsKey('attribute12friendlyname') ) { $payload.Add('attribute12friendlyname', $attribute12friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute12format') ) { $payload.Add('attribute12format', $attribute12format) } if ( $PSBoundParameters.ContainsKey('attribute13') ) { $payload.Add('attribute13', $attribute13) } if ( $PSBoundParameters.ContainsKey('attribute13expr') ) { $payload.Add('attribute13expr', $attribute13expr) } if ( $PSBoundParameters.ContainsKey('attribute13friendlyname') ) { $payload.Add('attribute13friendlyname', $attribute13friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute13format') ) { $payload.Add('attribute13format', $attribute13format) } if ( $PSBoundParameters.ContainsKey('attribute14') ) { $payload.Add('attribute14', $attribute14) } if ( $PSBoundParameters.ContainsKey('attribute14expr') ) { $payload.Add('attribute14expr', $attribute14expr) } if ( $PSBoundParameters.ContainsKey('attribute14friendlyname') ) { $payload.Add('attribute14friendlyname', $attribute14friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute14format') ) { $payload.Add('attribute14format', $attribute14format) } if ( $PSBoundParameters.ContainsKey('attribute15') ) { $payload.Add('attribute15', $attribute15) } if ( $PSBoundParameters.ContainsKey('attribute15expr') ) { $payload.Add('attribute15expr', $attribute15expr) } if ( $PSBoundParameters.ContainsKey('attribute15friendlyname') ) { $payload.Add('attribute15friendlyname', $attribute15friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute15format') ) { $payload.Add('attribute15format', $attribute15format) } if ( $PSBoundParameters.ContainsKey('attribute16') ) { $payload.Add('attribute16', $attribute16) } if ( $PSBoundParameters.ContainsKey('attribute16expr') ) { $payload.Add('attribute16expr', $attribute16expr) } if ( $PSBoundParameters.ContainsKey('attribute16friendlyname') ) { $payload.Add('attribute16friendlyname', $attribute16friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute16format') ) { $payload.Add('attribute16format', $attribute16format) } if ( $PSBoundParameters.ContainsKey('encryptassertion') ) { $payload.Add('encryptassertion', $encryptassertion) } if ( $PSBoundParameters.ContainsKey('samlspcertname') ) { $payload.Add('samlspcertname', $samlspcertname) } if ( $PSBoundParameters.ContainsKey('encryptionalgorithm') ) { $payload.Add('encryptionalgorithm', $encryptionalgorithm) } if ( $PSBoundParameters.ContainsKey('skewtime') ) { $payload.Add('skewtime', $skewtime) } if ( $PSBoundParameters.ContainsKey('signassertion') ) { $payload.Add('signassertion', $signassertion) } if ( $PSBoundParameters.ContainsKey('signatureservice') ) { $payload.Add('signatureservice', $signatureservice) } if ( $PSCmdlet.ShouldProcess("vpnsamlssoprofile", "Update Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnsamlssoprofile -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-NSGetVpnsamlssoprofile -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateVpnsamlssoprofile: Finished" } } function Invoke-NSUnsetVpnsamlssoprofile { <# .SYNOPSIS Unset Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for SAML sso action resource. .PARAMETER Name Name for the new saml single sign-on profile. 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. Cannot be changed after an SSO action is created. .PARAMETER Samlsigningcertname Name of the signing authority as given in the SAML server's SSL certificate. .PARAMETER Sendpassword Option to send password in assertion. Possible values = ON, OFF .PARAMETER Samlissuername The name to be used in requests sent from Citrix ADC to IdP to uniquely identify Citrix ADC. .PARAMETER Relaystaterule Expression to extract relaystate to be sent along with assertion. Evaluation of this expression should return TEXT content. This is typically a target url to which user is redirected after the recipient validates SAML token. .PARAMETER Signaturealg Algorithm to be used to sign/verify SAML transactions. Possible values = RSA-SHA1, RSA-SHA256 .PARAMETER Digestmethod Algorithm to be used to compute/verify digest for SAML transactions. Possible values = SHA1, SHA256 .PARAMETER Audience Audience for which assertion sent by IdP is applicable. This is typically entity name or url that represents ServiceProvider. .PARAMETER Nameidformat Format of Name Identifier sent in Assertion. Possible values = Unspecified, emailAddress, X509SubjectName, WindowsDomainQualifiedName, kerberos, entity, persistent, transient .PARAMETER Nameidexpr Expression that will be evaluated to obtain NameIdentifier to be sent in assertion. .PARAMETER Attribute1 Name of attribute1 that needs to be sent in SAML Assertion. .PARAMETER Attribute1friendlyname User-Friendly Name of attribute1 that needs to be sent in SAML Assertion. .PARAMETER Attribute1format Format of Attribute1 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute2 Name of attribute2 that needs to be sent in SAML Assertion. .PARAMETER Attribute2friendlyname User-Friendly Name of attribute2 that needs to be sent in SAML Assertion. .PARAMETER Attribute2format Format of Attribute2 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute3 Name of attribute3 that needs to be sent in SAML Assertion. .PARAMETER Attribute3friendlyname User-Friendly Name of attribute3 that needs to be sent in SAML Assertion. .PARAMETER Attribute3format Format of Attribute3 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute4 Name of attribute4 that needs to be sent in SAML Assertion. .PARAMETER Attribute4friendlyname User-Friendly Name of attribute4 that needs to be sent in SAML Assertion. .PARAMETER Attribute4format Format of Attribute4 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute5 Name of attribute5 that needs to be sent in SAML Assertion. .PARAMETER Attribute5friendlyname User-Friendly Name of attribute5 that needs to be sent in SAML Assertion. .PARAMETER Attribute5format Format of Attribute5 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute6 Name of attribute6 that needs to be sent in SAML Assertion. .PARAMETER Attribute6friendlyname User-Friendly Name of attribute6 that needs to be sent in SAML Assertion. .PARAMETER Attribute6format Format of Attribute6 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute7 Name of attribute7 that needs to be sent in SAML Assertion. .PARAMETER Attribute7friendlyname User-Friendly Name of attribute7 that needs to be sent in SAML Assertion. .PARAMETER Attribute7format Format of Attribute7 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute8 Name of attribute8 that needs to be sent in SAML Assertion. .PARAMETER Attribute8friendlyname User-Friendly Name of attribute8 that needs to be sent in SAML Assertion. .PARAMETER Attribute8format Format of Attribute8 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute9 Name of attribute9 that needs to be sent in SAML Assertion. .PARAMETER Attribute9friendlyname User-Friendly Name of attribute9 that needs to be sent in SAML Assertion. .PARAMETER Attribute9format Format of Attribute9 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute10 Name of attribute10 that needs to be sent in SAML Assertion. .PARAMETER Attribute10friendlyname User-Friendly Name of attribute10 that needs to be sent in SAML Assertion. .PARAMETER Attribute10format Format of Attribute10 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute11 Name of attribute11 that needs to be sent in SAML Assertion. .PARAMETER Attribute11friendlyname User-Friendly Name of attribute11 that needs to be sent in SAML Assertion. .PARAMETER Attribute11format Format of Attribute11 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute12 Name of attribute12 that needs to be sent in SAML Assertion. .PARAMETER Attribute12friendlyname User-Friendly Name of attribute12 that needs to be sent in SAML Assertion. .PARAMETER Attribute12format Format of Attribute12 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute13 Name of attribute13 that needs to be sent in SAML Assertion. .PARAMETER Attribute13friendlyname User-Friendly Name of attribute13 that needs to be sent in SAML Assertion. .PARAMETER Attribute13format Format of Attribute13 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute14 Name of attribute14 that needs to be sent in SAML Assertion. .PARAMETER Attribute14friendlyname User-Friendly Name of attribute14 that needs to be sent in SAML Assertion. .PARAMETER Attribute14format Format of Attribute14 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute15 Name of attribute15 that needs to be sent in SAML Assertion. .PARAMETER Attribute15friendlyname User-Friendly Name of attribute15 that needs to be sent in SAML Assertion. .PARAMETER Attribute15format Format of Attribute15 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Attribute16 Name of attribute16 that needs to be sent in SAML Assertion. .PARAMETER Attribute16friendlyname User-Friendly Name of attribute16 that needs to be sent in SAML Assertion. .PARAMETER Attribute16format Format of Attribute16 to be sent in Assertion. Possible values = URI, Basic .PARAMETER Encryptassertion Option to encrypt assertion when Citrix ADC sends one. Possible values = ON, OFF .PARAMETER Samlspcertname Name of the SSL certificate of peer/receving party using which Assertion is encrypted. .PARAMETER Encryptionalgorithm Algorithm to be used to encrypt SAML assertion. Possible values = DES3, AES128, AES192, AES256 .PARAMETER Skewtime This option specifies the number of minutes on either side of current time that the assertion would be valid. For example, if skewTime is 10, then assertion would be valid from (current time - 10) min to (current time + 10) min, ie 20min in all. .PARAMETER Signassertion Option to sign portions of assertion when Citrix ADC IDP sends one. Based on the user selection, either Assertion or Response or Both or none can be signed. Possible values = NONE, ASSERTION, RESPONSE, BOTH .PARAMETER Signatureservice Name of the service in cloud used to sign the data. .EXAMPLE PS C:\>Invoke-NSUnsetVpnsamlssoprofile -name <string> An example how to unset vpnsamlssoprofile config Object(s). .NOTES File Name : Invoke-NSUnsetVpnsamlssoprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnsamlssoprofile Requires : PowerShell v5.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]$Name, [Boolean]$samlsigningcertname, [Boolean]$sendpassword, [Boolean]$samlissuername, [Boolean]$relaystaterule, [Boolean]$signaturealg, [Boolean]$digestmethod, [Boolean]$audience, [Boolean]$nameidformat, [Boolean]$nameidexpr, [Boolean]$attribute1, [Boolean]$attribute1friendlyname, [Boolean]$attribute1format, [Boolean]$attribute2, [Boolean]$attribute2friendlyname, [Boolean]$attribute2format, [Boolean]$attribute3, [Boolean]$attribute3friendlyname, [Boolean]$attribute3format, [Boolean]$attribute4, [Boolean]$attribute4friendlyname, [Boolean]$attribute4format, [Boolean]$attribute5, [Boolean]$attribute5friendlyname, [Boolean]$attribute5format, [Boolean]$attribute6, [Boolean]$attribute6friendlyname, [Boolean]$attribute6format, [Boolean]$attribute7, [Boolean]$attribute7friendlyname, [Boolean]$attribute7format, [Boolean]$attribute8, [Boolean]$attribute8friendlyname, [Boolean]$attribute8format, [Boolean]$attribute9, [Boolean]$attribute9friendlyname, [Boolean]$attribute9format, [Boolean]$attribute10, [Boolean]$attribute10friendlyname, [Boolean]$attribute10format, [Boolean]$attribute11, [Boolean]$attribute11friendlyname, [Boolean]$attribute11format, [Boolean]$attribute12, [Boolean]$attribute12friendlyname, [Boolean]$attribute12format, [Boolean]$attribute13, [Boolean]$attribute13friendlyname, [Boolean]$attribute13format, [Boolean]$attribute14, [Boolean]$attribute14friendlyname, [Boolean]$attribute14format, [Boolean]$attribute15, [Boolean]$attribute15friendlyname, [Boolean]$attribute15format, [Boolean]$attribute16, [Boolean]$attribute16friendlyname, [Boolean]$attribute16format, [Boolean]$encryptassertion, [Boolean]$samlspcertname, [Boolean]$encryptionalgorithm, [Boolean]$skewtime, [Boolean]$signassertion, [Boolean]$signatureservice ) begin { Write-Verbose "Invoke-NSUnsetVpnsamlssoprofile: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('samlsigningcertname') ) { $payload.Add('samlsigningcertname', $samlsigningcertname) } if ( $PSBoundParameters.ContainsKey('sendpassword') ) { $payload.Add('sendpassword', $sendpassword) } if ( $PSBoundParameters.ContainsKey('samlissuername') ) { $payload.Add('samlissuername', $samlissuername) } if ( $PSBoundParameters.ContainsKey('relaystaterule') ) { $payload.Add('relaystaterule', $relaystaterule) } if ( $PSBoundParameters.ContainsKey('signaturealg') ) { $payload.Add('signaturealg', $signaturealg) } if ( $PSBoundParameters.ContainsKey('digestmethod') ) { $payload.Add('digestmethod', $digestmethod) } if ( $PSBoundParameters.ContainsKey('audience') ) { $payload.Add('audience', $audience) } if ( $PSBoundParameters.ContainsKey('nameidformat') ) { $payload.Add('nameidformat', $nameidformat) } if ( $PSBoundParameters.ContainsKey('nameidexpr') ) { $payload.Add('nameidexpr', $nameidexpr) } if ( $PSBoundParameters.ContainsKey('attribute1') ) { $payload.Add('attribute1', $attribute1) } if ( $PSBoundParameters.ContainsKey('attribute1friendlyname') ) { $payload.Add('attribute1friendlyname', $attribute1friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute1format') ) { $payload.Add('attribute1format', $attribute1format) } if ( $PSBoundParameters.ContainsKey('attribute2') ) { $payload.Add('attribute2', $attribute2) } if ( $PSBoundParameters.ContainsKey('attribute2friendlyname') ) { $payload.Add('attribute2friendlyname', $attribute2friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute2format') ) { $payload.Add('attribute2format', $attribute2format) } if ( $PSBoundParameters.ContainsKey('attribute3') ) { $payload.Add('attribute3', $attribute3) } if ( $PSBoundParameters.ContainsKey('attribute3friendlyname') ) { $payload.Add('attribute3friendlyname', $attribute3friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute3format') ) { $payload.Add('attribute3format', $attribute3format) } if ( $PSBoundParameters.ContainsKey('attribute4') ) { $payload.Add('attribute4', $attribute4) } if ( $PSBoundParameters.ContainsKey('attribute4friendlyname') ) { $payload.Add('attribute4friendlyname', $attribute4friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute4format') ) { $payload.Add('attribute4format', $attribute4format) } if ( $PSBoundParameters.ContainsKey('attribute5') ) { $payload.Add('attribute5', $attribute5) } if ( $PSBoundParameters.ContainsKey('attribute5friendlyname') ) { $payload.Add('attribute5friendlyname', $attribute5friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute5format') ) { $payload.Add('attribute5format', $attribute5format) } if ( $PSBoundParameters.ContainsKey('attribute6') ) { $payload.Add('attribute6', $attribute6) } if ( $PSBoundParameters.ContainsKey('attribute6friendlyname') ) { $payload.Add('attribute6friendlyname', $attribute6friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute6format') ) { $payload.Add('attribute6format', $attribute6format) } if ( $PSBoundParameters.ContainsKey('attribute7') ) { $payload.Add('attribute7', $attribute7) } if ( $PSBoundParameters.ContainsKey('attribute7friendlyname') ) { $payload.Add('attribute7friendlyname', $attribute7friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute7format') ) { $payload.Add('attribute7format', $attribute7format) } if ( $PSBoundParameters.ContainsKey('attribute8') ) { $payload.Add('attribute8', $attribute8) } if ( $PSBoundParameters.ContainsKey('attribute8friendlyname') ) { $payload.Add('attribute8friendlyname', $attribute8friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute8format') ) { $payload.Add('attribute8format', $attribute8format) } if ( $PSBoundParameters.ContainsKey('attribute9') ) { $payload.Add('attribute9', $attribute9) } if ( $PSBoundParameters.ContainsKey('attribute9friendlyname') ) { $payload.Add('attribute9friendlyname', $attribute9friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute9format') ) { $payload.Add('attribute9format', $attribute9format) } if ( $PSBoundParameters.ContainsKey('attribute10') ) { $payload.Add('attribute10', $attribute10) } if ( $PSBoundParameters.ContainsKey('attribute10friendlyname') ) { $payload.Add('attribute10friendlyname', $attribute10friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute10format') ) { $payload.Add('attribute10format', $attribute10format) } if ( $PSBoundParameters.ContainsKey('attribute11') ) { $payload.Add('attribute11', $attribute11) } if ( $PSBoundParameters.ContainsKey('attribute11friendlyname') ) { $payload.Add('attribute11friendlyname', $attribute11friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute11format') ) { $payload.Add('attribute11format', $attribute11format) } if ( $PSBoundParameters.ContainsKey('attribute12') ) { $payload.Add('attribute12', $attribute12) } if ( $PSBoundParameters.ContainsKey('attribute12friendlyname') ) { $payload.Add('attribute12friendlyname', $attribute12friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute12format') ) { $payload.Add('attribute12format', $attribute12format) } if ( $PSBoundParameters.ContainsKey('attribute13') ) { $payload.Add('attribute13', $attribute13) } if ( $PSBoundParameters.ContainsKey('attribute13friendlyname') ) { $payload.Add('attribute13friendlyname', $attribute13friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute13format') ) { $payload.Add('attribute13format', $attribute13format) } if ( $PSBoundParameters.ContainsKey('attribute14') ) { $payload.Add('attribute14', $attribute14) } if ( $PSBoundParameters.ContainsKey('attribute14friendlyname') ) { $payload.Add('attribute14friendlyname', $attribute14friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute14format') ) { $payload.Add('attribute14format', $attribute14format) } if ( $PSBoundParameters.ContainsKey('attribute15') ) { $payload.Add('attribute15', $attribute15) } if ( $PSBoundParameters.ContainsKey('attribute15friendlyname') ) { $payload.Add('attribute15friendlyname', $attribute15friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute15format') ) { $payload.Add('attribute15format', $attribute15format) } if ( $PSBoundParameters.ContainsKey('attribute16') ) { $payload.Add('attribute16', $attribute16) } if ( $PSBoundParameters.ContainsKey('attribute16friendlyname') ) { $payload.Add('attribute16friendlyname', $attribute16friendlyname) } if ( $PSBoundParameters.ContainsKey('attribute16format') ) { $payload.Add('attribute16format', $attribute16format) } if ( $PSBoundParameters.ContainsKey('encryptassertion') ) { $payload.Add('encryptassertion', $encryptassertion) } if ( $PSBoundParameters.ContainsKey('samlspcertname') ) { $payload.Add('samlspcertname', $samlspcertname) } if ( $PSBoundParameters.ContainsKey('encryptionalgorithm') ) { $payload.Add('encryptionalgorithm', $encryptionalgorithm) } if ( $PSBoundParameters.ContainsKey('skewtime') ) { $payload.Add('skewtime', $skewtime) } if ( $PSBoundParameters.ContainsKey('signassertion') ) { $payload.Add('signassertion', $signassertion) } if ( $PSBoundParameters.ContainsKey('signatureservice') ) { $payload.Add('signatureservice', $signatureservice) } if ( $PSCmdlet.ShouldProcess("$name", "Unset Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type vpnsamlssoprofile -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-NSUnsetVpnsamlssoprofile: Finished" } } function Invoke-NSGetVpnsamlssoprofile { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Configuration for SAML sso action resource. .PARAMETER Name Name for the new saml single sign-on profile. 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. Cannot be changed after an SSO action is created. .PARAMETER GetAll Retrieve all vpnsamlssoprofile object(s). .PARAMETER Count If specified, the count of the vpnsamlssoprofile 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-NSGetVpnsamlssoprofile Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnsamlssoprofile -GetAll Get all vpnsamlssoprofile data. .EXAMPLE PS C:\>Invoke-NSGetVpnsamlssoprofile -Count Get the number of vpnsamlssoprofile objects. .EXAMPLE PS C:\>Invoke-NSGetVpnsamlssoprofile -name <string> Get vpnsamlssoprofile object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnsamlssoprofile -Filter @{ 'name'='<value>' } Get vpnsamlssoprofile data with a filter. .NOTES File Name : Invoke-NSGetVpnsamlssoprofile Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnsamlssoprofile/ Requires : PowerShell v5.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]$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-NSGetVpnsamlssoprofile: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all vpnsamlssoprofile objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsamlssoprofile -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 vpnsamlssoprofile objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsamlssoprofile -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnsamlssoprofile objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsamlssoprofile -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnsamlssoprofile configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsamlssoprofile -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnsamlssoprofile configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsamlssoprofile -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-NSGetVpnsamlssoprofile: Ended" } } function Invoke-NSAddVpnsessionaction { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN session action resource. .PARAMETER Name Name for the Citrix Gateway profile (action). Must begin with an ASCII alphabetic or underscore (_) character, and must consist only of ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the profile is created. .PARAMETER Useraccounting The name of the radiusPolicy to use for RADIUS user accounting info on the session. .PARAMETER Httpport Destination port numbers other than port 80, added as a comma-separated list. Traffic to these ports is processed as HTTP traffic, which allows functionality, such as HTTP authorization and single sign-on to a web application to work. .PARAMETER Winsip WINS server IP address to add to Citrix Gateway for name resolution. .PARAMETER Dnsvservername Name of the DNS virtual server for the user session. .PARAMETER Splitdns Route the DNS requests to the local DNS server configured on the user device, or Citrix Gateway (remote), or both. Possible values = LOCAL, REMOTE, BOTH .PARAMETER Sesstimeout Number of minutes after which the session times out. .PARAMETER Clientsecurity Specify the client security check for the user device to permit a Citrix Gateway session. The web address or IP address is not included in the expression for the client security check. .PARAMETER Clientsecuritygroup The client security group that will be assigned on failure of the client security check. Users can in general be organized into Groups. In this case, the Client Security Group may have a more restrictive security policy. .PARAMETER Clientsecuritymessage The client security message that will be displayed on failure of the client security check. .PARAMETER Clientsecuritylog Set the logging of client security checks. Possible values = ON, OFF .PARAMETER Splittunnel Send, through the tunnel, traffic only for intranet applications that are defined in Citrix Gateway. Route all other traffic directly to the Internet. The OFF setting routes all traffic through Citrix Gateway. With the REVERSE setting, intranet applications define the network traffic that is not intercepted. All network traffic directed to internal IP addresses bypasses the VPN tunnel, while other traffic goes through Citrix Gateway. Reverse split tunneling can be used to log all non-local LAN traffic. For example, if users have a home network and are logged on through the Citrix Gateway Plug-in, network traffic destined to a printer or another device within the home network is not intercepted. Possible values = ON, OFF, REVERSE .PARAMETER Locallanaccess Set local LAN access. If split tunneling is OFF, and you set local LAN access to ON, the local client can route traffic to its local interface. When the local area network switch is specified, this combination of switches is useful. The client can allow local LAN access to devices that commonly have non-routable addresses, such as local printers or local file servers. Possible values = ON, OFF, FORCED .PARAMETER Rfc1918 As defined in the local area network, allow only the following local area network addresses to bypass the VPN tunnel when the local LAN access feature is enabled: * 10.*.*.*, * 172.16.*.*, * 192.168.*.*. Possible values = ON, OFF .PARAMETER Spoofiip IP address that the intranet application uses to route the connection through the virtual adapter. Possible values = ON, OFF .PARAMETER Killconnections Specify whether the Citrix Gateway Plug-in should disconnect all preexisting connections, such as the connections existing before the user logged on to Citrix Gateway, and prevent new incoming connections on the Citrix Gateway Plug-in for Windows and MAC when the user is connected to Citrix Gateway and split tunneling is disabled. Possible values = ON, OFF .PARAMETER Transparentinterception Allow access to network resources by using a single IP address and subnet mask or a range of IP addresses. The OFF setting sets the mode to proxy, in which you configure destination and source IP addresses and port numbers. If you are using the Citrix Gateway Plug-in for Windows, set this parameter to ON, in which the mode is set to transparent. If you are using the Citrix Gateway Plug-in for Java, set this parameter to OFF. Possible values = ON, OFF .PARAMETER Windowsclienttype Choose between two types of Windows Client\ a) Application Agent - which always runs in the task bar as a standalone application and also has a supporting service which runs permanently when installed\ b) Activex Control - ActiveX control run by Microsoft Internet Explorer. Possible values = AGENT, PLUGIN .PARAMETER Defaultauthorizationaction Specify the network resources that users have access to when they log on to the internal network. The default setting for authorization is to deny access to all network resources. Citrix recommends using the default global setting and then creating authorization policies to define the network resources users can access. If you set the default authorization policy to DENY, you must explicitly authorize access to any network resource, which improves security. Possible values = ALLOW, DENY .PARAMETER Authorizationgroup Comma-separated list of groups in which the user is placed when none of the groups that the user is a part of is configured on Citrix Gateway. The authorization policy can be bound to these groups to control access to the resources. .PARAMETER Smartgroup This is the default group that is chosen when the authentication succeeds in addition to extracted groups. .PARAMETER Clientidletimeout Time, in minutes, after which to time out the user session if Citrix Gateway does not detect mouse or keyboard activity. Maximum value = 9999 .PARAMETER Proxy Set options to apply proxy for accessing the internal resources. Available settings function as follows: * BROWSER - Proxy settings are configured only in Internet Explorer and Firefox browsers. * NS - Proxy settings are configured on the Citrix ADC. * OFF - Proxy settings are not configured. Possible values = BROWSER, NS, OFF .PARAMETER Allprotocolproxy IP address of the proxy server to use for all protocols supported by Citrix Gateway. .PARAMETER Httpproxy IP address of the proxy server to be used for HTTP access for all subsequent connections to the internal network. .PARAMETER Ftpproxy IP address of the proxy server to be used for FTP access for all subsequent connections to the internal network. .PARAMETER Socksproxy IP address of the proxy server to be used for SOCKS access for all subsequent connections to the internal network. .PARAMETER Gopherproxy IP address of the proxy server to be used for GOPHER access for all subsequent connections to the internal network. .PARAMETER Sslproxy IP address of the proxy server to be used for SSL access for all subsequent connections to the internal network. .PARAMETER Proxyexception Proxy exception string that will be configured in the browser for bypassing the previously configured proxies. Allowed only if proxy type is Browser. .PARAMETER Proxylocalbypass Bypass proxy server for local addresses option in Internet Explorer and Firefox proxy server settings. Possible values = ENABLED, DISABLED .PARAMETER Clientcleanupprompt Prompt for client-side cache clean-up when a client-initiated session closes. Possible values = ON, OFF .PARAMETER Forcecleanup Force cache clean-up when the user closes a session. You can specify all, none, or any combination of the client-side items. Possible values = none, all, cookie, addressbar, plugin, filesystemapplication, application, applicationdata, clientcertificate, autocomplete, cache .PARAMETER Clientoptions Display only the configured menu options when you select the "Configure Citrix Gateway" option in the Citrix Gateway Plug-in system tray icon for Windows. Possible values = none, all, services, filetransfer, configuration .PARAMETER Clientconfiguration Allow users to change client Debug logging level in Configuration tab of the Citrix Gateway Plug-in for Windows. Possible values = none, trace .PARAMETER Sso Set single sign-on (SSO) for the session. When the user accesses a server, the user's logon credentials are passed to the server for authentication. NOTE : This configuration does not honor the following authentication types for security reason. BASIC, DIGEST, and NTLM (without Negotiate NTLM2 Key or Negotiate Sign Flag). Use VPN TrafficAction to configure SSO for these authentication types. Possible values = ON, OFF .PARAMETER Ssocredential Specify whether to use the primary or secondary authentication credentials for single sign-on to the server. Possible values = PRIMARY, SECONDARY .PARAMETER Windowsautologon Enable or disable the Windows Auto Logon for the session. If a VPN session is established after this setting is enabled, the user is automatically logged on by using Windows credentials after the system is restarted. Possible values = ON, OFF .PARAMETER Usemip Enable or disable the use of a unique IP address alias, or a mapped IP address, as the client IP address for each client session. Allow Citrix Gateway to use the mapped IP address as an intranet IP address when all other IP addresses are not available. When IP pooling is configured and the mapped IP is used as an intranet IP address, the mapped IP address is used when an intranet IP address cannot be assigned. Possible values = NS, OFF .PARAMETER Useiip Define IP address pool options. Available settings function as follows: * SPILLOVER - When an address pool is configured and the mapped IP is used as an intranet IP address, the mapped IP address is used when an intranet IP address cannot be assigned. * NOSPILLOVER - When intranet IP addresses are enabled and the mapped IP address is not used, the Transfer Login page appears for users who have used all available intranet IP addresses. * OFF - Address pool is not configured. Possible values = NOSPILLOVER, SPILLOVER, OFF .PARAMETER Clientdebug Set the trace level on Citrix Gateway. Technical support technicians use these debug logs for in-depth debugging and troubleshooting purposes. Available settings function as follows: * DEBUG - Detailed debug messages are collected and written into the specified file. * STATS - Application audit level error messages and debug statistic counters are written into the specified file. * EVENTS - Application audit-level error messages are written into the specified file. * OFF - Only critical events are logged into the Windows Application Log. Possible values = debug, stats, events, OFF .PARAMETER Loginscript Path to the logon script that is run when a session is established. Separate multiple scripts by using comma. A "$" in the path signifies that the word following the "$" is an environment variable. .PARAMETER Logoutscript Path to the logout script. Separate multiple scripts by using comma. A "$" in the path signifies that the word following the "$" is an environment variable. .PARAMETER Homepage Web address of the home page that appears when users log on. Otherwise, users receive the default home page for Citrix Gateway, which is the Access Interface. .PARAMETER Icaproxy Enable ICA proxy to configure secure Internet access to servers running Citrix XenApp or XenDesktop by using Citrix Receiver instead of the Citrix Gateway Plug-in. Possible values = ON, OFF .PARAMETER Wihome Web address of the Web Interface server, such as http://<ipAddress>/Citrix/XenApp, or Receiver for Web, which enumerates the virtualized resources, such as XenApp, XenDesktop, and cloud applications. This web address is used as the home page in ICA proxy mode. If Client Choices is ON, you must configure this setting. Because the user can choose between FullClient and ICAProxy, the user may see a different home page. An Internet web site may appear if the user gets the FullClient option, or a Web Interface site if the user gets the ICAProxy option. If the setting is not configured, the XenApp option does not appear as a client choice. .PARAMETER Wihomeaddresstype Type of the wihome address(IPV4/V6). Possible values = IPV4, IPV6 .PARAMETER Citrixreceiverhome Web address for the Citrix Receiver home page. Configure Citrix Gateway so that when users log on to the appliance, the Citrix Gateway Plug-in opens a web browser that allows single sign-on to the Citrix Receiver home page. .PARAMETER Wiportalmode Layout on the Access Interface. The COMPACT value indicates the use of small icons. Possible values = NORMAL, COMPACT .PARAMETER Clientchoices Provide users with multiple logon options. With client choices, users have the option of logging on by using the Citrix Gateway Plug-in for Windows, Citrix Gateway Plug-in for Java, the Web Interface, or clientless access from one location. Depending on how Citrix Gateway is configured, users are presented with up to three icons for logon choices. The most common are the Citrix Gateway Plug-in for Windows, Web Interface, and clientless access. Possible values = ON, OFF .PARAMETER Epaclienttype Choose between two types of End point Windows Client a) Application Agent - which always runs in the task bar as a standalone application and also has a supporting service which runs permanently when installed b) Activex Control - ActiveX control run by Microsoft Internet Explorer. Possible values = AGENT, PLUGIN .PARAMETER Iipdnssuffix An intranet IP DNS suffix. When a user logs on to Citrix Gateway and is assigned an IP address, a DNS record for the user name and IP address combination is added to the Citrix Gateway DNS cache. You can configure a DNS suffix to append to the user name when the DNS record is added to the cache. You can reach to the host from where the user is logged on by using the user's name, which can be easier to remember than an IP address. When the user logs off from Citrix Gateway, the record is removed from the DNS cache. .PARAMETER Forcedtimeout Force a disconnection from the Citrix Gateway Plug-in with Citrix Gateway after a specified number of minutes. If the session closes, the user must log on again. Maximum value = 65535 .PARAMETER Forcedtimeoutwarning Number of minutes to warn a user before the user session is disconnected. Maximum value = 255 .PARAMETER Ntdomain Single sign-on domain to use for single sign-on to applications in the internal network. This setting can be overwritten by the domain that users specify at the time of logon or by the domain that the authentication server returns. .PARAMETER Clientlessvpnmode Enable clientless access for web, XenApp or XenDesktop, and FileShare resources without installing the Citrix Gateway Plug-in. Available settings function as follows: * ON - Allow only clientless access. * OFF - Allow clientless access after users log on with the Citrix Gateway Plug-in. * DISABLED - Do not allow clientless access. Possible values = ON, OFF, DISABLED .PARAMETER Emailhome Web address for the web-based email, such as Outlook Web Access. .PARAMETER Clientlessmodeurlencoding When clientless access is enabled, you can choose to encode the addresses of internal web applications or to leave the address as clear text. Available settings function as follows: * OPAQUE - Use standard encoding mechanisms to make the domain and protocol part of the resource unclear to users. * CLEAR - Do not encode the web address and make it visible to users. * ENCRYPT - Allow the domain and protocol to be encrypted using a session key. When the web address is encrypted, the URL is different for each user session for the same web resource. If users bookmark the encoded web address, save it in the web browser and then log off, they cannot connect to the web address when they log on and use the bookmark. If users save the encrypted bookmark in the Access Interface during their session, the bookmark works each time the user logs on. Possible values = TRANSPARENT, OPAQUE, ENCRYPT .PARAMETER Clientlesspersistentcookie State of persistent cookies in clientless access mode. Persistent cookies are required for accessing certain features of SharePoint, such as opening and editing Microsoft Word, Excel, and PowerPoint documents hosted on the SharePoint server. A persistent cookie remains on the user device and is sent with each HTTP request. Citrix Gateway encrypts the persistent cookie before sending it to the plug-in on the user device, and refreshes the cookie periodically as long as the session exists. The cookie becomes stale if the session ends. Available settings function as follows: * ALLOW - Enable persistent cookies. Users can open and edit Microsoft documents stored in SharePoint. * DENY - Disable persistent cookies. Users cannot open and edit Microsoft documents stored in SharePoint. * PROMPT - Prompt users to allow or deny persistent cookies during the session. Persistent cookies are not required for clientless access if users do not connect to SharePoint. Possible values = ALLOW, DENY, PROMPT .PARAMETER Allowedlogingroups Specify groups that have permission to log on to Citrix Gateway. Users who do not belong to this group or groups are denied access even if they have valid credentials. .PARAMETER Securebrowse Allow users to connect through Citrix Gateway to network resources from iOS and Android mobile devices with Citrix Receiver. Users do not need to establish a full VPN tunnel to access resources in the secure network. Possible values = ENABLED, DISABLED .PARAMETER Storefronturl Web address for StoreFront to be used in this session for enumeration of resources from XenApp or XenDesktop. .PARAMETER Sfgatewayauthtype The authentication type configured for the Citrix Gateway on StoreFront. Possible values = domain, RSA, domainAndRSA, SMS, smartCard, sfAuth, sfAuthAndRSA .PARAMETER Kcdaccount The kcd account details to be used in SSO. .PARAMETER Rdpclientprofilename Name of the RDP profile associated with the vserver. .PARAMETER Windowspluginupgrade Option to set plugin upgrade behaviour for Win. Possible values = Always, Essential, Never .PARAMETER Macpluginupgrade Option to set plugin upgrade behaviour for Mac. Possible values = Always, Essential, Never .PARAMETER Linuxpluginupgrade Option to set plugin upgrade behaviour for Linux. Possible values = Always, Essential, Never .PARAMETER Iconwithreceiver Option to decide whether to show plugin icon along with receiver. Possible values = ON, OFF .PARAMETER Alwaysonprofilename Name of the AlwaysON profile associated with the session action. The builtin profile named none can be used to explicitly disable AlwaysON for the session action. .PARAMETER Autoproxyurl URL to auto proxy config file. .PARAMETER Advancedclientlessvpnmode Option to enable/disable Advanced ClientlessVpnMode. Additionaly, it can be set to STRICT to block Classic ClientlessVpnMode while in AdvancedClientlessMode. Possible values = ENABLED, DISABLED, STRICT .PARAMETER Pcoipprofilename Name of the PCOIP profile associated with the session action. The builtin profile named none can be used to explicitly disable PCOIP for the session action. .PARAMETER Fqdnspoofedip Spoofed IP address range that can be used by client for FQDN based split tunneling. .PARAMETER Netmask The netmask for the spoofed ip address. .PARAMETER PassThru Return details about the created vpnsessionaction item. .EXAMPLE PS C:\>Invoke-NSAddVpnsessionaction -name <string> An example how to add vpnsessionaction config Object(s). .NOTES File Name : Invoke-NSAddVpnsessionaction Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnsessionaction/ Requires : PowerShell v5.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]$Name, [string]$Useraccounting, [int[]]$Httpport, [string]$Winsip, [ValidateScript({ $_.Length -gt 1 })] [string]$Dnsvservername, [ValidateSet('LOCAL', 'REMOTE', 'BOTH')] [string]$Splitdns, [double]$Sesstimeout, [string]$Clientsecurity, [ValidateScript({ $_.Length -gt 1 })] [string]$Clientsecuritygroup, [ValidateLength(1, 127)] [string]$Clientsecuritymessage, [ValidateSet('ON', 'OFF')] [string]$Clientsecuritylog, [ValidateSet('ON', 'OFF', 'REVERSE')] [string]$Splittunnel, [ValidateSet('ON', 'OFF', 'FORCED')] [string]$Locallanaccess, [ValidateSet('ON', 'OFF')] [string]$Rfc1918, [ValidateSet('ON', 'OFF')] [string]$Spoofiip, [ValidateSet('ON', 'OFF')] [string]$Killconnections, [ValidateSet('ON', 'OFF')] [string]$Transparentinterception, [ValidateSet('AGENT', 'PLUGIN')] [string]$Windowsclienttype, [ValidateSet('ALLOW', 'DENY')] [string]$Defaultauthorizationaction, [ValidateScript({ $_.Length -gt 1 })] [string]$Authorizationgroup, [ValidateLength(1, 64)] [string]$Smartgroup, [double]$Clientidletimeout, [ValidateSet('BROWSER', 'NS', 'OFF')] [string]$Proxy, [ValidateScript({ $_.Length -gt 1 })] [string]$Allprotocolproxy, [ValidateScript({ $_.Length -gt 1 })] [string]$Httpproxy, [ValidateScript({ $_.Length -gt 1 })] [string]$Ftpproxy, [ValidateScript({ $_.Length -gt 1 })] [string]$Socksproxy, [ValidateScript({ $_.Length -gt 1 })] [string]$Gopherproxy, [ValidateScript({ $_.Length -gt 1 })] [string]$Sslproxy, [ValidateScript({ $_.Length -gt 1 })] [string]$Proxyexception, [ValidateSet('ENABLED', 'DISABLED')] [string]$Proxylocalbypass, [ValidateSet('ON', 'OFF')] [string]$Clientcleanupprompt, [ValidateSet('none', 'all', 'cookie', 'addressbar', 'plugin', 'filesystemapplication', 'application', 'applicationdata', 'clientcertificate', 'autocomplete', 'cache')] [string[]]$Forcecleanup, [ValidateSet('none', 'all', 'services', 'filetransfer', 'configuration')] [string]$Clientoptions, [ValidateSet('none', 'trace')] [string[]]$Clientconfiguration, [ValidateSet('ON', 'OFF')] [string]$Sso, [ValidateSet('PRIMARY', 'SECONDARY')] [string]$Ssocredential, [ValidateSet('ON', 'OFF')] [string]$Windowsautologon, [ValidateSet('NS', 'OFF')] [string]$Usemip, [ValidateSet('NOSPILLOVER', 'SPILLOVER', 'OFF')] [string]$Useiip, [ValidateSet('debug', 'stats', 'events', 'OFF')] [string]$Clientdebug, [ValidateScript({ $_.Length -gt 1 })] [string]$Loginscript, [ValidateScript({ $_.Length -gt 1 })] [string]$Logoutscript, [string]$Homepage, [ValidateSet('ON', 'OFF')] [string]$Icaproxy, [string]$Wihome, [ValidateSet('IPV4', 'IPV6')] [string]$Wihomeaddresstype, [string]$Citrixreceiverhome, [ValidateSet('NORMAL', 'COMPACT')] [string]$Wiportalmode, [ValidateSet('ON', 'OFF')] [string]$Clientchoices, [ValidateSet('AGENT', 'PLUGIN')] [string]$Epaclienttype, [ValidateScript({ $_.Length -gt 1 })] [string]$Iipdnssuffix, [double]$Forcedtimeout, [double]$Forcedtimeoutwarning, [ValidateLength(1, 32)] [string]$Ntdomain, [ValidateSet('ON', 'OFF', 'DISABLED')] [string]$Clientlessvpnmode, [string]$Emailhome, [ValidateSet('TRANSPARENT', 'OPAQUE', 'ENCRYPT')] [string]$Clientlessmodeurlencoding, [ValidateSet('ALLOW', 'DENY', 'PROMPT')] [string]$Clientlesspersistentcookie, [ValidateLength(1, 511)] [string]$Allowedlogingroups, [ValidateSet('ENABLED', 'DISABLED')] [string]$Securebrowse, [ValidateLength(1, 255)] [string]$Storefronturl, [ValidateSet('domain', 'RSA', 'domainAndRSA', 'SMS', 'smartCard', 'sfAuth', 'sfAuthAndRSA')] [string]$Sfgatewayauthtype, [ValidateLength(1, 32)] [string]$Kcdaccount, [ValidateLength(1, 31)] [string]$Rdpclientprofilename, [ValidateSet('Always', 'Essential', 'Never')] [string]$Windowspluginupgrade, [ValidateSet('Always', 'Essential', 'Never')] [string]$Macpluginupgrade, [ValidateSet('Always', 'Essential', 'Never')] [string]$Linuxpluginupgrade, [ValidateSet('ON', 'OFF')] [string]$Iconwithreceiver, [ValidateLength(1, 31)] [string]$Alwaysonprofilename, [string]$Autoproxyurl, [ValidateSet('ENABLED', 'DISABLED', 'STRICT')] [string]$Advancedclientlessvpnmode = 'DISABLED', [ValidateLength(1, 31)] [string]$Pcoipprofilename, [ValidateScript({ $_.Length -gt 1 })] [string]$Fqdnspoofedip, [ValidateScript({ $_.Length -gt 1 })] [string]$Netmask, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnsessionaction: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('useraccounting') ) { $payload.Add('useraccounting', $useraccounting) } if ( $PSBoundParameters.ContainsKey('httpport') ) { $payload.Add('httpport', $httpport) } if ( $PSBoundParameters.ContainsKey('winsip') ) { $payload.Add('winsip', $winsip) } if ( $PSBoundParameters.ContainsKey('dnsvservername') ) { $payload.Add('dnsvservername', $dnsvservername) } if ( $PSBoundParameters.ContainsKey('splitdns') ) { $payload.Add('splitdns', $splitdns) } if ( $PSBoundParameters.ContainsKey('sesstimeout') ) { $payload.Add('sesstimeout', $sesstimeout) } if ( $PSBoundParameters.ContainsKey('clientsecurity') ) { $payload.Add('clientsecurity', $clientsecurity) } if ( $PSBoundParameters.ContainsKey('clientsecuritygroup') ) { $payload.Add('clientsecuritygroup', $clientsecuritygroup) } if ( $PSBoundParameters.ContainsKey('clientsecuritymessage') ) { $payload.Add('clientsecuritymessage', $clientsecuritymessage) } if ( $PSBoundParameters.ContainsKey('clientsecuritylog') ) { $payload.Add('clientsecuritylog', $clientsecuritylog) } if ( $PSBoundParameters.ContainsKey('splittunnel') ) { $payload.Add('splittunnel', $splittunnel) } if ( $PSBoundParameters.ContainsKey('locallanaccess') ) { $payload.Add('locallanaccess', $locallanaccess) } if ( $PSBoundParameters.ContainsKey('rfc1918') ) { $payload.Add('rfc1918', $rfc1918) } if ( $PSBoundParameters.ContainsKey('spoofiip') ) { $payload.Add('spoofiip', $spoofiip) } if ( $PSBoundParameters.ContainsKey('killconnections') ) { $payload.Add('killconnections', $killconnections) } if ( $PSBoundParameters.ContainsKey('transparentinterception') ) { $payload.Add('transparentinterception', $transparentinterception) } if ( $PSBoundParameters.ContainsKey('windowsclienttype') ) { $payload.Add('windowsclienttype', $windowsclienttype) } if ( $PSBoundParameters.ContainsKey('defaultauthorizationaction') ) { $payload.Add('defaultauthorizationaction', $defaultauthorizationaction) } if ( $PSBoundParameters.ContainsKey('authorizationgroup') ) { $payload.Add('authorizationgroup', $authorizationgroup) } if ( $PSBoundParameters.ContainsKey('smartgroup') ) { $payload.Add('smartgroup', $smartgroup) } if ( $PSBoundParameters.ContainsKey('clientidletimeout') ) { $payload.Add('clientidletimeout', $clientidletimeout) } if ( $PSBoundParameters.ContainsKey('proxy') ) { $payload.Add('proxy', $proxy) } if ( $PSBoundParameters.ContainsKey('allprotocolproxy') ) { $payload.Add('allprotocolproxy', $allprotocolproxy) } if ( $PSBoundParameters.ContainsKey('httpproxy') ) { $payload.Add('httpproxy', $httpproxy) } if ( $PSBoundParameters.ContainsKey('ftpproxy') ) { $payload.Add('ftpproxy', $ftpproxy) } if ( $PSBoundParameters.ContainsKey('socksproxy') ) { $payload.Add('socksproxy', $socksproxy) } if ( $PSBoundParameters.ContainsKey('gopherproxy') ) { $payload.Add('gopherproxy', $gopherproxy) } if ( $PSBoundParameters.ContainsKey('sslproxy') ) { $payload.Add('sslproxy', $sslproxy) } if ( $PSBoundParameters.ContainsKey('proxyexception') ) { $payload.Add('proxyexception', $proxyexception) } if ( $PSBoundParameters.ContainsKey('proxylocalbypass') ) { $payload.Add('proxylocalbypass', $proxylocalbypass) } if ( $PSBoundParameters.ContainsKey('clientcleanupprompt') ) { $payload.Add('clientcleanupprompt', $clientcleanupprompt) } if ( $PSBoundParameters.ContainsKey('forcecleanup') ) { $payload.Add('forcecleanup', $forcecleanup) } if ( $PSBoundParameters.ContainsKey('clientoptions') ) { $payload.Add('clientoptions', $clientoptions) } if ( $PSBoundParameters.ContainsKey('clientconfiguration') ) { $payload.Add('clientconfiguration', $clientconfiguration) } if ( $PSBoundParameters.ContainsKey('sso') ) { $payload.Add('sso', $sso) } if ( $PSBoundParameters.ContainsKey('ssocredential') ) { $payload.Add('ssocredential', $ssocredential) } if ( $PSBoundParameters.ContainsKey('windowsautologon') ) { $payload.Add('windowsautologon', $windowsautologon) } if ( $PSBoundParameters.ContainsKey('usemip') ) { $payload.Add('usemip', $usemip) } if ( $PSBoundParameters.ContainsKey('useiip') ) { $payload.Add('useiip', $useiip) } if ( $PSBoundParameters.ContainsKey('clientdebug') ) { $payload.Add('clientdebug', $clientdebug) } if ( $PSBoundParameters.ContainsKey('loginscript') ) { $payload.Add('loginscript', $loginscript) } if ( $PSBoundParameters.ContainsKey('logoutscript') ) { $payload.Add('logoutscript', $logoutscript) } if ( $PSBoundParameters.ContainsKey('homepage') ) { $payload.Add('homepage', $homepage) } if ( $PSBoundParameters.ContainsKey('icaproxy') ) { $payload.Add('icaproxy', $icaproxy) } if ( $PSBoundParameters.ContainsKey('wihome') ) { $payload.Add('wihome', $wihome) } if ( $PSBoundParameters.ContainsKey('wihomeaddresstype') ) { $payload.Add('wihomeaddresstype', $wihomeaddresstype) } if ( $PSBoundParameters.ContainsKey('citrixreceiverhome') ) { $payload.Add('citrixreceiverhome', $citrixreceiverhome) } if ( $PSBoundParameters.ContainsKey('wiportalmode') ) { $payload.Add('wiportalmode', $wiportalmode) } if ( $PSBoundParameters.ContainsKey('clientchoices') ) { $payload.Add('clientchoices', $clientchoices) } if ( $PSBoundParameters.ContainsKey('epaclienttype') ) { $payload.Add('epaclienttype', $epaclienttype) } if ( $PSBoundParameters.ContainsKey('iipdnssuffix') ) { $payload.Add('iipdnssuffix', $iipdnssuffix) } if ( $PSBoundParameters.ContainsKey('forcedtimeout') ) { $payload.Add('forcedtimeout', $forcedtimeout) } if ( $PSBoundParameters.ContainsKey('forcedtimeoutwarning') ) { $payload.Add('forcedtimeoutwarning', $forcedtimeoutwarning) } if ( $PSBoundParameters.ContainsKey('ntdomain') ) { $payload.Add('ntdomain', $ntdomain) } if ( $PSBoundParameters.ContainsKey('clientlessvpnmode') ) { $payload.Add('clientlessvpnmode', $clientlessvpnmode) } if ( $PSBoundParameters.ContainsKey('emailhome') ) { $payload.Add('emailhome', $emailhome) } if ( $PSBoundParameters.ContainsKey('clientlessmodeurlencoding') ) { $payload.Add('clientlessmodeurlencoding', $clientlessmodeurlencoding) } if ( $PSBoundParameters.ContainsKey('clientlesspersistentcookie') ) { $payload.Add('clientlesspersistentcookie', $clientlesspersistentcookie) } if ( $PSBoundParameters.ContainsKey('allowedlogingroups') ) { $payload.Add('allowedlogingroups', $allowedlogingroups) } if ( $PSBoundParameters.ContainsKey('securebrowse') ) { $payload.Add('securebrowse', $securebrowse) } if ( $PSBoundParameters.ContainsKey('storefronturl') ) { $payload.Add('storefronturl', $storefronturl) } if ( $PSBoundParameters.ContainsKey('sfgatewayauthtype') ) { $payload.Add('sfgatewayauthtype', $sfgatewayauthtype) } if ( $PSBoundParameters.ContainsKey('kcdaccount') ) { $payload.Add('kcdaccount', $kcdaccount) } if ( $PSBoundParameters.ContainsKey('rdpclientprofilename') ) { $payload.Add('rdpclientprofilename', $rdpclientprofilename) } if ( $PSBoundParameters.ContainsKey('windowspluginupgrade') ) { $payload.Add('windowspluginupgrade', $windowspluginupgrade) } if ( $PSBoundParameters.ContainsKey('macpluginupgrade') ) { $payload.Add('macpluginupgrade', $macpluginupgrade) } if ( $PSBoundParameters.ContainsKey('linuxpluginupgrade') ) { $payload.Add('linuxpluginupgrade', $linuxpluginupgrade) } if ( $PSBoundParameters.ContainsKey('iconwithreceiver') ) { $payload.Add('iconwithreceiver', $iconwithreceiver) } if ( $PSBoundParameters.ContainsKey('alwaysonprofilename') ) { $payload.Add('alwaysonprofilename', $alwaysonprofilename) } if ( $PSBoundParameters.ContainsKey('autoproxyurl') ) { $payload.Add('autoproxyurl', $autoproxyurl) } if ( $PSBoundParameters.ContainsKey('advancedclientlessvpnmode') ) { $payload.Add('advancedclientlessvpnmode', $advancedclientlessvpnmode) } if ( $PSBoundParameters.ContainsKey('pcoipprofilename') ) { $payload.Add('pcoipprofilename', $pcoipprofilename) } if ( $PSBoundParameters.ContainsKey('fqdnspoofedip') ) { $payload.Add('fqdnspoofedip', $fqdnspoofedip) } if ( $PSBoundParameters.ContainsKey('netmask') ) { $payload.Add('netmask', $netmask) } if ( $PSCmdlet.ShouldProcess("vpnsessionaction", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type vpnsessionaction -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-NSGetVpnsessionaction -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnsessionaction: Finished" } } function Invoke-NSDeleteVpnsessionaction { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN session action resource. .PARAMETER Name Name for the Citrix Gateway profile (action). Must begin with an ASCII alphabetic or underscore (_) character, and must consist only of ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the profile is created. .EXAMPLE PS C:\>Invoke-NSDeleteVpnsessionaction -Name <string> An example how to delete vpnsessionaction config Object(s). .NOTES File Name : Invoke-NSDeleteVpnsessionaction Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnsessionaction/ Requires : PowerShell v5.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-NSDeleteVpnsessionaction: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnsessionaction -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-NSDeleteVpnsessionaction: Finished" } } function Invoke-NSUpdateVpnsessionaction { <# .SYNOPSIS Update Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN session action resource. .PARAMETER Name Name for the Citrix Gateway profile (action). Must begin with an ASCII alphabetic or underscore (_) character, and must consist only of ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the profile is created. .PARAMETER Useraccounting The name of the radiusPolicy to use for RADIUS user accounting info on the session. .PARAMETER Httpport Destination port numbers other than port 80, added as a comma-separated list. Traffic to these ports is processed as HTTP traffic, which allows functionality, such as HTTP authorization and single sign-on to a web application to work. .PARAMETER Winsip WINS server IP address to add to Citrix Gateway for name resolution. .PARAMETER Dnsvservername Name of the DNS virtual server for the user session. .PARAMETER Splitdns Route the DNS requests to the local DNS server configured on the user device, or Citrix Gateway (remote), or both. Possible values = LOCAL, REMOTE, BOTH .PARAMETER Sesstimeout Number of minutes after which the session times out. .PARAMETER Clientsecurity Specify the client security check for the user device to permit a Citrix Gateway session. The web address or IP address is not included in the expression for the client security check. .PARAMETER Clientsecuritygroup The client security group that will be assigned on failure of the client security check. Users can in general be organized into Groups. In this case, the Client Security Group may have a more restrictive security policy. .PARAMETER Clientsecuritymessage The client security message that will be displayed on failure of the client security check. .PARAMETER Clientsecuritylog Set the logging of client security checks. Possible values = ON, OFF .PARAMETER Splittunnel Send, through the tunnel, traffic only for intranet applications that are defined in Citrix Gateway. Route all other traffic directly to the Internet. The OFF setting routes all traffic through Citrix Gateway. With the REVERSE setting, intranet applications define the network traffic that is not intercepted. All network traffic directed to internal IP addresses bypasses the VPN tunnel, while other traffic goes through Citrix Gateway. Reverse split tunneling can be used to log all non-local LAN traffic. For example, if users have a home network and are logged on through the Citrix Gateway Plug-in, network traffic destined to a printer or another device within the home network is not intercepted. Possible values = ON, OFF, REVERSE .PARAMETER Locallanaccess Set local LAN access. If split tunneling is OFF, and you set local LAN access to ON, the local client can route traffic to its local interface. When the local area network switch is specified, this combination of switches is useful. The client can allow local LAN access to devices that commonly have non-routable addresses, such as local printers or local file servers. Possible values = ON, OFF, FORCED .PARAMETER Rfc1918 As defined in the local area network, allow only the following local area network addresses to bypass the VPN tunnel when the local LAN access feature is enabled: * 10.*.*.*, * 172.16.*.*, * 192.168.*.*. Possible values = ON, OFF .PARAMETER Spoofiip IP address that the intranet application uses to route the connection through the virtual adapter. Possible values = ON, OFF .PARAMETER Killconnections Specify whether the Citrix Gateway Plug-in should disconnect all preexisting connections, such as the connections existing before the user logged on to Citrix Gateway, and prevent new incoming connections on the Citrix Gateway Plug-in for Windows and MAC when the user is connected to Citrix Gateway and split tunneling is disabled. Possible values = ON, OFF .PARAMETER Transparentinterception Allow access to network resources by using a single IP address and subnet mask or a range of IP addresses. The OFF setting sets the mode to proxy, in which you configure destination and source IP addresses and port numbers. If you are using the Citrix Gateway Plug-in for Windows, set this parameter to ON, in which the mode is set to transparent. If you are using the Citrix Gateway Plug-in for Java, set this parameter to OFF. Possible values = ON, OFF .PARAMETER Windowsclienttype Choose between two types of Windows Client\ a) Application Agent - which always runs in the task bar as a standalone application and also has a supporting service which runs permanently when installed\ b) Activex Control - ActiveX control run by Microsoft Internet Explorer. Possible values = AGENT, PLUGIN .PARAMETER Defaultauthorizationaction Specify the network resources that users have access to when they log on to the internal network. The default setting for authorization is to deny access to all network resources. Citrix recommends using the default global setting and then creating authorization policies to define the network resources users can access. If you set the default authorization policy to DENY, you must explicitly authorize access to any network resource, which improves security. Possible values = ALLOW, DENY .PARAMETER Authorizationgroup Comma-separated list of groups in which the user is placed when none of the groups that the user is a part of is configured on Citrix Gateway. The authorization policy can be bound to these groups to control access to the resources. .PARAMETER Smartgroup This is the default group that is chosen when the authentication succeeds in addition to extracted groups. .PARAMETER Clientidletimeout Time, in minutes, after which to time out the user session if Citrix Gateway does not detect mouse or keyboard activity. Maximum value = 9999 .PARAMETER Proxy Set options to apply proxy for accessing the internal resources. Available settings function as follows: * BROWSER - Proxy settings are configured only in Internet Explorer and Firefox browsers. * NS - Proxy settings are configured on the Citrix ADC. * OFF - Proxy settings are not configured. Possible values = BROWSER, NS, OFF .PARAMETER Allprotocolproxy IP address of the proxy server to use for all protocols supported by Citrix Gateway. .PARAMETER Httpproxy IP address of the proxy server to be used for HTTP access for all subsequent connections to the internal network. .PARAMETER Ftpproxy IP address of the proxy server to be used for FTP access for all subsequent connections to the internal network. .PARAMETER Socksproxy IP address of the proxy server to be used for SOCKS access for all subsequent connections to the internal network. .PARAMETER Gopherproxy IP address of the proxy server to be used for GOPHER access for all subsequent connections to the internal network. .PARAMETER Sslproxy IP address of the proxy server to be used for SSL access for all subsequent connections to the internal network. .PARAMETER Proxyexception Proxy exception string that will be configured in the browser for bypassing the previously configured proxies. Allowed only if proxy type is Browser. .PARAMETER Proxylocalbypass Bypass proxy server for local addresses option in Internet Explorer and Firefox proxy server settings. Possible values = ENABLED, DISABLED .PARAMETER Clientcleanupprompt Prompt for client-side cache clean-up when a client-initiated session closes. Possible values = ON, OFF .PARAMETER Forcecleanup Force cache clean-up when the user closes a session. You can specify all, none, or any combination of the client-side items. Possible values = none, all, cookie, addressbar, plugin, filesystemapplication, application, applicationdata, clientcertificate, autocomplete, cache .PARAMETER Clientoptions Display only the configured menu options when you select the "Configure Citrix Gateway" option in the Citrix Gateway Plug-in system tray icon for Windows. Possible values = none, all, services, filetransfer, configuration .PARAMETER Clientconfiguration Allow users to change client Debug logging level in Configuration tab of the Citrix Gateway Plug-in for Windows. Possible values = none, trace .PARAMETER Sso Set single sign-on (SSO) for the session. When the user accesses a server, the user's logon credentials are passed to the server for authentication. NOTE : This configuration does not honor the following authentication types for security reason. BASIC, DIGEST, and NTLM (without Negotiate NTLM2 Key or Negotiate Sign Flag). Use VPN TrafficAction to configure SSO for these authentication types. Possible values = ON, OFF .PARAMETER Ssocredential Specify whether to use the primary or secondary authentication credentials for single sign-on to the server. Possible values = PRIMARY, SECONDARY .PARAMETER Windowsautologon Enable or disable the Windows Auto Logon for the session. If a VPN session is established after this setting is enabled, the user is automatically logged on by using Windows credentials after the system is restarted. Possible values = ON, OFF .PARAMETER Usemip Enable or disable the use of a unique IP address alias, or a mapped IP address, as the client IP address for each client session. Allow Citrix Gateway to use the mapped IP address as an intranet IP address when all other IP addresses are not available. When IP pooling is configured and the mapped IP is used as an intranet IP address, the mapped IP address is used when an intranet IP address cannot be assigned. Possible values = NS, OFF .PARAMETER Useiip Define IP address pool options. Available settings function as follows: * SPILLOVER - When an address pool is configured and the mapped IP is used as an intranet IP address, the mapped IP address is used when an intranet IP address cannot be assigned. * NOSPILLOVER - When intranet IP addresses are enabled and the mapped IP address is not used, the Transfer Login page appears for users who have used all available intranet IP addresses. * OFF - Address pool is not configured. Possible values = NOSPILLOVER, SPILLOVER, OFF .PARAMETER Clientdebug Set the trace level on Citrix Gateway. Technical support technicians use these debug logs for in-depth debugging and troubleshooting purposes. Available settings function as follows: * DEBUG - Detailed debug messages are collected and written into the specified file. * STATS - Application audit level error messages and debug statistic counters are written into the specified file. * EVENTS - Application audit-level error messages are written into the specified file. * OFF - Only critical events are logged into the Windows Application Log. Possible values = debug, stats, events, OFF .PARAMETER Loginscript Path to the logon script that is run when a session is established. Separate multiple scripts by using comma. A "$" in the path signifies that the word following the "$" is an environment variable. .PARAMETER Logoutscript Path to the logout script. Separate multiple scripts by using comma. A "$" in the path signifies that the word following the "$" is an environment variable. .PARAMETER Homepage Web address of the home page that appears when users log on. Otherwise, users receive the default home page for Citrix Gateway, which is the Access Interface. .PARAMETER Icaproxy Enable ICA proxy to configure secure Internet access to servers running Citrix XenApp or XenDesktop by using Citrix Receiver instead of the Citrix Gateway Plug-in. Possible values = ON, OFF .PARAMETER Wihome Web address of the Web Interface server, such as http://<ipAddress>/Citrix/XenApp, or Receiver for Web, which enumerates the virtualized resources, such as XenApp, XenDesktop, and cloud applications. This web address is used as the home page in ICA proxy mode. If Client Choices is ON, you must configure this setting. Because the user can choose between FullClient and ICAProxy, the user may see a different home page. An Internet web site may appear if the user gets the FullClient option, or a Web Interface site if the user gets the ICAProxy option. If the setting is not configured, the XenApp option does not appear as a client choice. .PARAMETER Wihomeaddresstype Type of the wihome address(IPV4/V6). Possible values = IPV4, IPV6 .PARAMETER Citrixreceiverhome Web address for the Citrix Receiver home page. Configure Citrix Gateway so that when users log on to the appliance, the Citrix Gateway Plug-in opens a web browser that allows single sign-on to the Citrix Receiver home page. .PARAMETER Wiportalmode Layout on the Access Interface. The COMPACT value indicates the use of small icons. Possible values = NORMAL, COMPACT .PARAMETER Clientchoices Provide users with multiple logon options. With client choices, users have the option of logging on by using the Citrix Gateway Plug-in for Windows, Citrix Gateway Plug-in for Java, the Web Interface, or clientless access from one location. Depending on how Citrix Gateway is configured, users are presented with up to three icons for logon choices. The most common are the Citrix Gateway Plug-in for Windows, Web Interface, and clientless access. Possible values = ON, OFF .PARAMETER Epaclienttype Choose between two types of End point Windows Client a) Application Agent - which always runs in the task bar as a standalone application and also has a supporting service which runs permanently when installed b) Activex Control - ActiveX control run by Microsoft Internet Explorer. Possible values = AGENT, PLUGIN .PARAMETER Iipdnssuffix An intranet IP DNS suffix. When a user logs on to Citrix Gateway and is assigned an IP address, a DNS record for the user name and IP address combination is added to the Citrix Gateway DNS cache. You can configure a DNS suffix to append to the user name when the DNS record is added to the cache. You can reach to the host from where the user is logged on by using the user's name, which can be easier to remember than an IP address. When the user logs off from Citrix Gateway, the record is removed from the DNS cache. .PARAMETER Forcedtimeout Force a disconnection from the Citrix Gateway Plug-in with Citrix Gateway after a specified number of minutes. If the session closes, the user must log on again. Maximum value = 65535 .PARAMETER Forcedtimeoutwarning Number of minutes to warn a user before the user session is disconnected. Maximum value = 255 .PARAMETER Ntdomain Single sign-on domain to use for single sign-on to applications in the internal network. This setting can be overwritten by the domain that users specify at the time of logon or by the domain that the authentication server returns. .PARAMETER Clientlessvpnmode Enable clientless access for web, XenApp or XenDesktop, and FileShare resources without installing the Citrix Gateway Plug-in. Available settings function as follows: * ON - Allow only clientless access. * OFF - Allow clientless access after users log on with the Citrix Gateway Plug-in. * DISABLED - Do not allow clientless access. Possible values = ON, OFF, DISABLED .PARAMETER Emailhome Web address for the web-based email, such as Outlook Web Access. .PARAMETER Clientlessmodeurlencoding When clientless access is enabled, you can choose to encode the addresses of internal web applications or to leave the address as clear text. Available settings function as follows: * OPAQUE - Use standard encoding mechanisms to make the domain and protocol part of the resource unclear to users. * CLEAR - Do not encode the web address and make it visible to users. * ENCRYPT - Allow the domain and protocol to be encrypted using a session key. When the web address is encrypted, the URL is different for each user session for the same web resource. If users bookmark the encoded web address, save it in the web browser and then log off, they cannot connect to the web address when they log on and use the bookmark. If users save the encrypted bookmark in the Access Interface during their session, the bookmark works each time the user logs on. Possible values = TRANSPARENT, OPAQUE, ENCRYPT .PARAMETER Clientlesspersistentcookie State of persistent cookies in clientless access mode. Persistent cookies are required for accessing certain features of SharePoint, such as opening and editing Microsoft Word, Excel, and PowerPoint documents hosted on the SharePoint server. A persistent cookie remains on the user device and is sent with each HTTP request. Citrix Gateway encrypts the persistent cookie before sending it to the plug-in on the user device, and refreshes the cookie periodically as long as the session exists. The cookie becomes stale if the session ends. Available settings function as follows: * ALLOW - Enable persistent cookies. Users can open and edit Microsoft documents stored in SharePoint. * DENY - Disable persistent cookies. Users cannot open and edit Microsoft documents stored in SharePoint. * PROMPT - Prompt users to allow or deny persistent cookies during the session. Persistent cookies are not required for clientless access if users do not connect to SharePoint. Possible values = ALLOW, DENY, PROMPT .PARAMETER Allowedlogingroups Specify groups that have permission to log on to Citrix Gateway. Users who do not belong to this group or groups are denied access even if they have valid credentials. .PARAMETER Securebrowse Allow users to connect through Citrix Gateway to network resources from iOS and Android mobile devices with Citrix Receiver. Users do not need to establish a full VPN tunnel to access resources in the secure network. Possible values = ENABLED, DISABLED .PARAMETER Storefronturl Web address for StoreFront to be used in this session for enumeration of resources from XenApp or XenDesktop. .PARAMETER Sfgatewayauthtype The authentication type configured for the Citrix Gateway on StoreFront. Possible values = domain, RSA, domainAndRSA, SMS, smartCard, sfAuth, sfAuthAndRSA .PARAMETER Kcdaccount The kcd account details to be used in SSO. .PARAMETER Rdpclientprofilename Name of the RDP profile associated with the vserver. .PARAMETER Windowspluginupgrade Option to set plugin upgrade behaviour for Win. Possible values = Always, Essential, Never .PARAMETER Macpluginupgrade Option to set plugin upgrade behaviour for Mac. Possible values = Always, Essential, Never .PARAMETER Linuxpluginupgrade Option to set plugin upgrade behaviour for Linux. Possible values = Always, Essential, Never .PARAMETER Iconwithreceiver Option to decide whether to show plugin icon along with receiver. Possible values = ON, OFF .PARAMETER Alwaysonprofilename Name of the AlwaysON profile associated with the session action. The builtin profile named none can be used to explicitly disable AlwaysON for the session action. .PARAMETER Autoproxyurl URL to auto proxy config file. .PARAMETER Advancedclientlessvpnmode Option to enable/disable Advanced ClientlessVpnMode. Additionaly, it can be set to STRICT to block Classic ClientlessVpnMode while in AdvancedClientlessMode. Possible values = ENABLED, DISABLED, STRICT .PARAMETER Pcoipprofilename Name of the PCOIP profile associated with the session action. The builtin profile named none can be used to explicitly disable PCOIP for the session action. .PARAMETER Fqdnspoofedip Spoofed IP address range that can be used by client for FQDN based split tunneling. .PARAMETER Netmask The netmask for the spoofed ip address. .PARAMETER PassThru Return details about the created vpnsessionaction item. .EXAMPLE PS C:\>Invoke-NSUpdateVpnsessionaction -name <string> An example how to update vpnsessionaction config Object(s). .NOTES File Name : Invoke-NSUpdateVpnsessionaction Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnsessionaction/ Requires : PowerShell v5.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]$Name, [string]$Useraccounting, [int[]]$Httpport, [string]$Winsip, [ValidateScript({ $_.Length -gt 1 })] [string]$Dnsvservername, [ValidateSet('LOCAL', 'REMOTE', 'BOTH')] [string]$Splitdns, [double]$Sesstimeout, [string]$Clientsecurity, [ValidateScript({ $_.Length -gt 1 })] [string]$Clientsecuritygroup, [ValidateLength(1, 127)] [string]$Clientsecuritymessage, [ValidateSet('ON', 'OFF')] [string]$Clientsecuritylog, [ValidateSet('ON', 'OFF', 'REVERSE')] [string]$Splittunnel, [ValidateSet('ON', 'OFF', 'FORCED')] [string]$Locallanaccess, [ValidateSet('ON', 'OFF')] [string]$Rfc1918, [ValidateSet('ON', 'OFF')] [string]$Spoofiip, [ValidateSet('ON', 'OFF')] [string]$Killconnections, [ValidateSet('ON', 'OFF')] [string]$Transparentinterception, [ValidateSet('AGENT', 'PLUGIN')] [string]$Windowsclienttype, [ValidateSet('ALLOW', 'DENY')] [string]$Defaultauthorizationaction, [ValidateScript({ $_.Length -gt 1 })] [string]$Authorizationgroup, [ValidateLength(1, 64)] [string]$Smartgroup, [double]$Clientidletimeout, [ValidateSet('BROWSER', 'NS', 'OFF')] [string]$Proxy, [ValidateScript({ $_.Length -gt 1 })] [string]$Allprotocolproxy, [ValidateScript({ $_.Length -gt 1 })] [string]$Httpproxy, [ValidateScript({ $_.Length -gt 1 })] [string]$Ftpproxy, [ValidateScript({ $_.Length -gt 1 })] [string]$Socksproxy, [ValidateScript({ $_.Length -gt 1 })] [string]$Gopherproxy, [ValidateScript({ $_.Length -gt 1 })] [string]$Sslproxy, [ValidateScript({ $_.Length -gt 1 })] [string]$Proxyexception, [ValidateSet('ENABLED', 'DISABLED')] [string]$Proxylocalbypass, [ValidateSet('ON', 'OFF')] [string]$Clientcleanupprompt, [ValidateSet('none', 'all', 'cookie', 'addressbar', 'plugin', 'filesystemapplication', 'application', 'applicationdata', 'clientcertificate', 'autocomplete', 'cache')] [string[]]$Forcecleanup, [ValidateSet('none', 'all', 'services', 'filetransfer', 'configuration')] [string]$Clientoptions, [ValidateSet('none', 'trace')] [string[]]$Clientconfiguration, [ValidateSet('ON', 'OFF')] [string]$Sso, [ValidateSet('PRIMARY', 'SECONDARY')] [string]$Ssocredential, [ValidateSet('ON', 'OFF')] [string]$Windowsautologon, [ValidateSet('NS', 'OFF')] [string]$Usemip, [ValidateSet('NOSPILLOVER', 'SPILLOVER', 'OFF')] [string]$Useiip, [ValidateSet('debug', 'stats', 'events', 'OFF')] [string]$Clientdebug, [ValidateScript({ $_.Length -gt 1 })] [string]$Loginscript, [ValidateScript({ $_.Length -gt 1 })] [string]$Logoutscript, [string]$Homepage, [ValidateSet('ON', 'OFF')] [string]$Icaproxy, [string]$Wihome, [ValidateSet('IPV4', 'IPV6')] [string]$Wihomeaddresstype, [string]$Citrixreceiverhome, [ValidateSet('NORMAL', 'COMPACT')] [string]$Wiportalmode, [ValidateSet('ON', 'OFF')] [string]$Clientchoices, [ValidateSet('AGENT', 'PLUGIN')] [string]$Epaclienttype, [ValidateScript({ $_.Length -gt 1 })] [string]$Iipdnssuffix, [double]$Forcedtimeout, [double]$Forcedtimeoutwarning, [ValidateLength(1, 32)] [string]$Ntdomain, [ValidateSet('ON', 'OFF', 'DISABLED')] [string]$Clientlessvpnmode, [string]$Emailhome, [ValidateSet('TRANSPARENT', 'OPAQUE', 'ENCRYPT')] [string]$Clientlessmodeurlencoding, [ValidateSet('ALLOW', 'DENY', 'PROMPT')] [string]$Clientlesspersistentcookie, [ValidateLength(1, 511)] [string]$Allowedlogingroups, [ValidateSet('ENABLED', 'DISABLED')] [string]$Securebrowse, [ValidateLength(1, 255)] [string]$Storefronturl, [ValidateSet('domain', 'RSA', 'domainAndRSA', 'SMS', 'smartCard', 'sfAuth', 'sfAuthAndRSA')] [string]$Sfgatewayauthtype, [ValidateLength(1, 32)] [string]$Kcdaccount, [ValidateLength(1, 31)] [string]$Rdpclientprofilename, [ValidateSet('Always', 'Essential', 'Never')] [string]$Windowspluginupgrade, [ValidateSet('Always', 'Essential', 'Never')] [string]$Macpluginupgrade, [ValidateSet('Always', 'Essential', 'Never')] [string]$Linuxpluginupgrade, [ValidateSet('ON', 'OFF')] [string]$Iconwithreceiver, [ValidateLength(1, 31)] [string]$Alwaysonprofilename, [string]$Autoproxyurl, [ValidateSet('ENABLED', 'DISABLED', 'STRICT')] [string]$Advancedclientlessvpnmode, [ValidateLength(1, 31)] [string]$Pcoipprofilename, [ValidateScript({ $_.Length -gt 1 })] [string]$Fqdnspoofedip, [ValidateScript({ $_.Length -gt 1 })] [string]$Netmask, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateVpnsessionaction: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('useraccounting') ) { $payload.Add('useraccounting', $useraccounting) } if ( $PSBoundParameters.ContainsKey('httpport') ) { $payload.Add('httpport', $httpport) } if ( $PSBoundParameters.ContainsKey('winsip') ) { $payload.Add('winsip', $winsip) } if ( $PSBoundParameters.ContainsKey('dnsvservername') ) { $payload.Add('dnsvservername', $dnsvservername) } if ( $PSBoundParameters.ContainsKey('splitdns') ) { $payload.Add('splitdns', $splitdns) } if ( $PSBoundParameters.ContainsKey('sesstimeout') ) { $payload.Add('sesstimeout', $sesstimeout) } if ( $PSBoundParameters.ContainsKey('clientsecurity') ) { $payload.Add('clientsecurity', $clientsecurity) } if ( $PSBoundParameters.ContainsKey('clientsecuritygroup') ) { $payload.Add('clientsecuritygroup', $clientsecuritygroup) } if ( $PSBoundParameters.ContainsKey('clientsecuritymessage') ) { $payload.Add('clientsecuritymessage', $clientsecuritymessage) } if ( $PSBoundParameters.ContainsKey('clientsecuritylog') ) { $payload.Add('clientsecuritylog', $clientsecuritylog) } if ( $PSBoundParameters.ContainsKey('splittunnel') ) { $payload.Add('splittunnel', $splittunnel) } if ( $PSBoundParameters.ContainsKey('locallanaccess') ) { $payload.Add('locallanaccess', $locallanaccess) } if ( $PSBoundParameters.ContainsKey('rfc1918') ) { $payload.Add('rfc1918', $rfc1918) } if ( $PSBoundParameters.ContainsKey('spoofiip') ) { $payload.Add('spoofiip', $spoofiip) } if ( $PSBoundParameters.ContainsKey('killconnections') ) { $payload.Add('killconnections', $killconnections) } if ( $PSBoundParameters.ContainsKey('transparentinterception') ) { $payload.Add('transparentinterception', $transparentinterception) } if ( $PSBoundParameters.ContainsKey('windowsclienttype') ) { $payload.Add('windowsclienttype', $windowsclienttype) } if ( $PSBoundParameters.ContainsKey('defaultauthorizationaction') ) { $payload.Add('defaultauthorizationaction', $defaultauthorizationaction) } if ( $PSBoundParameters.ContainsKey('authorizationgroup') ) { $payload.Add('authorizationgroup', $authorizationgroup) } if ( $PSBoundParameters.ContainsKey('smartgroup') ) { $payload.Add('smartgroup', $smartgroup) } if ( $PSBoundParameters.ContainsKey('clientidletimeout') ) { $payload.Add('clientidletimeout', $clientidletimeout) } if ( $PSBoundParameters.ContainsKey('proxy') ) { $payload.Add('proxy', $proxy) } if ( $PSBoundParameters.ContainsKey('allprotocolproxy') ) { $payload.Add('allprotocolproxy', $allprotocolproxy) } if ( $PSBoundParameters.ContainsKey('httpproxy') ) { $payload.Add('httpproxy', $httpproxy) } if ( $PSBoundParameters.ContainsKey('ftpproxy') ) { $payload.Add('ftpproxy', $ftpproxy) } if ( $PSBoundParameters.ContainsKey('socksproxy') ) { $payload.Add('socksproxy', $socksproxy) } if ( $PSBoundParameters.ContainsKey('gopherproxy') ) { $payload.Add('gopherproxy', $gopherproxy) } if ( $PSBoundParameters.ContainsKey('sslproxy') ) { $payload.Add('sslproxy', $sslproxy) } if ( $PSBoundParameters.ContainsKey('proxyexception') ) { $payload.Add('proxyexception', $proxyexception) } if ( $PSBoundParameters.ContainsKey('proxylocalbypass') ) { $payload.Add('proxylocalbypass', $proxylocalbypass) } if ( $PSBoundParameters.ContainsKey('clientcleanupprompt') ) { $payload.Add('clientcleanupprompt', $clientcleanupprompt) } if ( $PSBoundParameters.ContainsKey('forcecleanup') ) { $payload.Add('forcecleanup', $forcecleanup) } if ( $PSBoundParameters.ContainsKey('clientoptions') ) { $payload.Add('clientoptions', $clientoptions) } if ( $PSBoundParameters.ContainsKey('clientconfiguration') ) { $payload.Add('clientconfiguration', $clientconfiguration) } if ( $PSBoundParameters.ContainsKey('sso') ) { $payload.Add('sso', $sso) } if ( $PSBoundParameters.ContainsKey('ssocredential') ) { $payload.Add('ssocredential', $ssocredential) } if ( $PSBoundParameters.ContainsKey('windowsautologon') ) { $payload.Add('windowsautologon', $windowsautologon) } if ( $PSBoundParameters.ContainsKey('usemip') ) { $payload.Add('usemip', $usemip) } if ( $PSBoundParameters.ContainsKey('useiip') ) { $payload.Add('useiip', $useiip) } if ( $PSBoundParameters.ContainsKey('clientdebug') ) { $payload.Add('clientdebug', $clientdebug) } if ( $PSBoundParameters.ContainsKey('loginscript') ) { $payload.Add('loginscript', $loginscript) } if ( $PSBoundParameters.ContainsKey('logoutscript') ) { $payload.Add('logoutscript', $logoutscript) } if ( $PSBoundParameters.ContainsKey('homepage') ) { $payload.Add('homepage', $homepage) } if ( $PSBoundParameters.ContainsKey('icaproxy') ) { $payload.Add('icaproxy', $icaproxy) } if ( $PSBoundParameters.ContainsKey('wihome') ) { $payload.Add('wihome', $wihome) } if ( $PSBoundParameters.ContainsKey('wihomeaddresstype') ) { $payload.Add('wihomeaddresstype', $wihomeaddresstype) } if ( $PSBoundParameters.ContainsKey('citrixreceiverhome') ) { $payload.Add('citrixreceiverhome', $citrixreceiverhome) } if ( $PSBoundParameters.ContainsKey('wiportalmode') ) { $payload.Add('wiportalmode', $wiportalmode) } if ( $PSBoundParameters.ContainsKey('clientchoices') ) { $payload.Add('clientchoices', $clientchoices) } if ( $PSBoundParameters.ContainsKey('epaclienttype') ) { $payload.Add('epaclienttype', $epaclienttype) } if ( $PSBoundParameters.ContainsKey('iipdnssuffix') ) { $payload.Add('iipdnssuffix', $iipdnssuffix) } if ( $PSBoundParameters.ContainsKey('forcedtimeout') ) { $payload.Add('forcedtimeout', $forcedtimeout) } if ( $PSBoundParameters.ContainsKey('forcedtimeoutwarning') ) { $payload.Add('forcedtimeoutwarning', $forcedtimeoutwarning) } if ( $PSBoundParameters.ContainsKey('ntdomain') ) { $payload.Add('ntdomain', $ntdomain) } if ( $PSBoundParameters.ContainsKey('clientlessvpnmode') ) { $payload.Add('clientlessvpnmode', $clientlessvpnmode) } if ( $PSBoundParameters.ContainsKey('emailhome') ) { $payload.Add('emailhome', $emailhome) } if ( $PSBoundParameters.ContainsKey('clientlessmodeurlencoding') ) { $payload.Add('clientlessmodeurlencoding', $clientlessmodeurlencoding) } if ( $PSBoundParameters.ContainsKey('clientlesspersistentcookie') ) { $payload.Add('clientlesspersistentcookie', $clientlesspersistentcookie) } if ( $PSBoundParameters.ContainsKey('allowedlogingroups') ) { $payload.Add('allowedlogingroups', $allowedlogingroups) } if ( $PSBoundParameters.ContainsKey('securebrowse') ) { $payload.Add('securebrowse', $securebrowse) } if ( $PSBoundParameters.ContainsKey('storefronturl') ) { $payload.Add('storefronturl', $storefronturl) } if ( $PSBoundParameters.ContainsKey('sfgatewayauthtype') ) { $payload.Add('sfgatewayauthtype', $sfgatewayauthtype) } if ( $PSBoundParameters.ContainsKey('kcdaccount') ) { $payload.Add('kcdaccount', $kcdaccount) } if ( $PSBoundParameters.ContainsKey('rdpclientprofilename') ) { $payload.Add('rdpclientprofilename', $rdpclientprofilename) } if ( $PSBoundParameters.ContainsKey('windowspluginupgrade') ) { $payload.Add('windowspluginupgrade', $windowspluginupgrade) } if ( $PSBoundParameters.ContainsKey('macpluginupgrade') ) { $payload.Add('macpluginupgrade', $macpluginupgrade) } if ( $PSBoundParameters.ContainsKey('linuxpluginupgrade') ) { $payload.Add('linuxpluginupgrade', $linuxpluginupgrade) } if ( $PSBoundParameters.ContainsKey('iconwithreceiver') ) { $payload.Add('iconwithreceiver', $iconwithreceiver) } if ( $PSBoundParameters.ContainsKey('alwaysonprofilename') ) { $payload.Add('alwaysonprofilename', $alwaysonprofilename) } if ( $PSBoundParameters.ContainsKey('autoproxyurl') ) { $payload.Add('autoproxyurl', $autoproxyurl) } if ( $PSBoundParameters.ContainsKey('advancedclientlessvpnmode') ) { $payload.Add('advancedclientlessvpnmode', $advancedclientlessvpnmode) } if ( $PSBoundParameters.ContainsKey('pcoipprofilename') ) { $payload.Add('pcoipprofilename', $pcoipprofilename) } if ( $PSBoundParameters.ContainsKey('fqdnspoofedip') ) { $payload.Add('fqdnspoofedip', $fqdnspoofedip) } if ( $PSBoundParameters.ContainsKey('netmask') ) { $payload.Add('netmask', $netmask) } if ( $PSCmdlet.ShouldProcess("vpnsessionaction", "Update Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnsessionaction -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-NSGetVpnsessionaction -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateVpnsessionaction: Finished" } } function Invoke-NSUnsetVpnsessionaction { <# .SYNOPSIS Unset Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN session action resource. .PARAMETER Name Name for the Citrix Gateway profile (action). Must begin with an ASCII alphabetic or underscore (_) character, and must consist only of ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the profile is created. .PARAMETER Useraccounting The name of the radiusPolicy to use for RADIUS user accounting info on the session. .PARAMETER Httpport Destination port numbers other than port 80, added as a comma-separated list. Traffic to these ports is processed as HTTP traffic, which allows functionality, such as HTTP authorization and single sign-on to a web application to work. .PARAMETER Winsip WINS server IP address to add to Citrix Gateway for name resolution. .PARAMETER Dnsvservername Name of the DNS virtual server for the user session. .PARAMETER Splitdns Route the DNS requests to the local DNS server configured on the user device, or Citrix Gateway (remote), or both. Possible values = LOCAL, REMOTE, BOTH .PARAMETER Sesstimeout Number of minutes after which the session times out. .PARAMETER Clientsecurity Specify the client security check for the user device to permit a Citrix Gateway session. The web address or IP address is not included in the expression for the client security check. .PARAMETER Clientsecuritygroup The client security group that will be assigned on failure of the client security check. Users can in general be organized into Groups. In this case, the Client Security Group may have a more restrictive security policy. .PARAMETER Clientsecuritymessage The client security message that will be displayed on failure of the client security check. .PARAMETER Clientsecuritylog Set the logging of client security checks. Possible values = ON, OFF .PARAMETER Splittunnel Send, through the tunnel, traffic only for intranet applications that are defined in Citrix Gateway. Route all other traffic directly to the Internet. The OFF setting routes all traffic through Citrix Gateway. With the REVERSE setting, intranet applications define the network traffic that is not intercepted. All network traffic directed to internal IP addresses bypasses the VPN tunnel, while other traffic goes through Citrix Gateway. Reverse split tunneling can be used to log all non-local LAN traffic. For example, if users have a home network and are logged on through the Citrix Gateway Plug-in, network traffic destined to a printer or another device within the home network is not intercepted. Possible values = ON, OFF, REVERSE .PARAMETER Locallanaccess Set local LAN access. If split tunneling is OFF, and you set local LAN access to ON, the local client can route traffic to its local interface. When the local area network switch is specified, this combination of switches is useful. The client can allow local LAN access to devices that commonly have non-routable addresses, such as local printers or local file servers. Possible values = ON, OFF, FORCED .PARAMETER Rfc1918 As defined in the local area network, allow only the following local area network addresses to bypass the VPN tunnel when the local LAN access feature is enabled: * 10.*.*.*, * 172.16.*.*, * 192.168.*.*. Possible values = ON, OFF .PARAMETER Spoofiip IP address that the intranet application uses to route the connection through the virtual adapter. Possible values = ON, OFF .PARAMETER Killconnections Specify whether the Citrix Gateway Plug-in should disconnect all preexisting connections, such as the connections existing before the user logged on to Citrix Gateway, and prevent new incoming connections on the Citrix Gateway Plug-in for Windows and MAC when the user is connected to Citrix Gateway and split tunneling is disabled. Possible values = ON, OFF .PARAMETER Transparentinterception Allow access to network resources by using a single IP address and subnet mask or a range of IP addresses. The OFF setting sets the mode to proxy, in which you configure destination and source IP addresses and port numbers. If you are using the Citrix Gateway Plug-in for Windows, set this parameter to ON, in which the mode is set to transparent. If you are using the Citrix Gateway Plug-in for Java, set this parameter to OFF. Possible values = ON, OFF .PARAMETER Windowsclienttype Choose between two types of Windows Client\ a) Application Agent - which always runs in the task bar as a standalone application and also has a supporting service which runs permanently when installed\ b) Activex Control - ActiveX control run by Microsoft Internet Explorer. Possible values = AGENT, PLUGIN .PARAMETER Defaultauthorizationaction Specify the network resources that users have access to when they log on to the internal network. The default setting for authorization is to deny access to all network resources. Citrix recommends using the default global setting and then creating authorization policies to define the network resources users can access. If you set the default authorization policy to DENY, you must explicitly authorize access to any network resource, which improves security. Possible values = ALLOW, DENY .PARAMETER Authorizationgroup Comma-separated list of groups in which the user is placed when none of the groups that the user is a part of is configured on Citrix Gateway. The authorization policy can be bound to these groups to control access to the resources. .PARAMETER Smartgroup This is the default group that is chosen when the authentication succeeds in addition to extracted groups. .PARAMETER Clientidletimeout Time, in minutes, after which to time out the user session if Citrix Gateway does not detect mouse or keyboard activity. Maximum value = 9999 .PARAMETER Proxy Set options to apply proxy for accessing the internal resources. Available settings function as follows: * BROWSER - Proxy settings are configured only in Internet Explorer and Firefox browsers. * NS - Proxy settings are configured on the Citrix ADC. * OFF - Proxy settings are not configured. Possible values = BROWSER, NS, OFF .PARAMETER Allprotocolproxy IP address of the proxy server to use for all protocols supported by Citrix Gateway. .PARAMETER Httpproxy IP address of the proxy server to be used for HTTP access for all subsequent connections to the internal network. .PARAMETER Ftpproxy IP address of the proxy server to be used for FTP access for all subsequent connections to the internal network. .PARAMETER Socksproxy IP address of the proxy server to be used for SOCKS access for all subsequent connections to the internal network. .PARAMETER Gopherproxy IP address of the proxy server to be used for GOPHER access for all subsequent connections to the internal network. .PARAMETER Sslproxy IP address of the proxy server to be used for SSL access for all subsequent connections to the internal network. .PARAMETER Proxyexception Proxy exception string that will be configured in the browser for bypassing the previously configured proxies. Allowed only if proxy type is Browser. .PARAMETER Proxylocalbypass Bypass proxy server for local addresses option in Internet Explorer and Firefox proxy server settings. Possible values = ENABLED, DISABLED .PARAMETER Clientcleanupprompt Prompt for client-side cache clean-up when a client-initiated session closes. Possible values = ON, OFF .PARAMETER Forcecleanup Force cache clean-up when the user closes a session. You can specify all, none, or any combination of the client-side items. Possible values = none, all, cookie, addressbar, plugin, filesystemapplication, application, applicationdata, clientcertificate, autocomplete, cache .PARAMETER Clientoptions Display only the configured menu options when you select the "Configure Citrix Gateway" option in the Citrix Gateway Plug-in system tray icon for Windows. Possible values = none, all, services, filetransfer, configuration .PARAMETER Clientconfiguration Allow users to change client Debug logging level in Configuration tab of the Citrix Gateway Plug-in for Windows. Possible values = none, trace .PARAMETER Sso Set single sign-on (SSO) for the session. When the user accesses a server, the user's logon credentials are passed to the server for authentication. NOTE : This configuration does not honor the following authentication types for security reason. BASIC, DIGEST, and NTLM (without Negotiate NTLM2 Key or Negotiate Sign Flag). Use VPN TrafficAction to configure SSO for these authentication types. Possible values = ON, OFF .PARAMETER Ssocredential Specify whether to use the primary or secondary authentication credentials for single sign-on to the server. Possible values = PRIMARY, SECONDARY .PARAMETER Windowsautologon Enable or disable the Windows Auto Logon for the session. If a VPN session is established after this setting is enabled, the user is automatically logged on by using Windows credentials after the system is restarted. Possible values = ON, OFF .PARAMETER Usemip Enable or disable the use of a unique IP address alias, or a mapped IP address, as the client IP address for each client session. Allow Citrix Gateway to use the mapped IP address as an intranet IP address when all other IP addresses are not available. When IP pooling is configured and the mapped IP is used as an intranet IP address, the mapped IP address is used when an intranet IP address cannot be assigned. Possible values = NS, OFF .PARAMETER Useiip Define IP address pool options. Available settings function as follows: * SPILLOVER - When an address pool is configured and the mapped IP is used as an intranet IP address, the mapped IP address is used when an intranet IP address cannot be assigned. * NOSPILLOVER - When intranet IP addresses are enabled and the mapped IP address is not used, the Transfer Login page appears for users who have used all available intranet IP addresses. * OFF - Address pool is not configured. Possible values = NOSPILLOVER, SPILLOVER, OFF .PARAMETER Clientdebug Set the trace level on Citrix Gateway. Technical support technicians use these debug logs for in-depth debugging and troubleshooting purposes. Available settings function as follows: * DEBUG - Detailed debug messages are collected and written into the specified file. * STATS - Application audit level error messages and debug statistic counters are written into the specified file. * EVENTS - Application audit-level error messages are written into the specified file. * OFF - Only critical events are logged into the Windows Application Log. Possible values = debug, stats, events, OFF .PARAMETER Loginscript Path to the logon script that is run when a session is established. Separate multiple scripts by using comma. A "$" in the path signifies that the word following the "$" is an environment variable. .PARAMETER Logoutscript Path to the logout script. Separate multiple scripts by using comma. A "$" in the path signifies that the word following the "$" is an environment variable. .PARAMETER Homepage Web address of the home page that appears when users log on. Otherwise, users receive the default home page for Citrix Gateway, which is the Access Interface. .PARAMETER Icaproxy Enable ICA proxy to configure secure Internet access to servers running Citrix XenApp or XenDesktop by using Citrix Receiver instead of the Citrix Gateway Plug-in. Possible values = ON, OFF .PARAMETER Wihome Web address of the Web Interface server, such as http://<ipAddress>/Citrix/XenApp, or Receiver for Web, which enumerates the virtualized resources, such as XenApp, XenDesktop, and cloud applications. This web address is used as the home page in ICA proxy mode. If Client Choices is ON, you must configure this setting. Because the user can choose between FullClient and ICAProxy, the user may see a different home page. An Internet web site may appear if the user gets the FullClient option, or a Web Interface site if the user gets the ICAProxy option. If the setting is not configured, the XenApp option does not appear as a client choice. .PARAMETER Citrixreceiverhome Web address for the Citrix Receiver home page. Configure Citrix Gateway so that when users log on to the appliance, the Citrix Gateway Plug-in opens a web browser that allows single sign-on to the Citrix Receiver home page. .PARAMETER Wiportalmode Layout on the Access Interface. The COMPACT value indicates the use of small icons. Possible values = NORMAL, COMPACT .PARAMETER Clientchoices Provide users with multiple logon options. With client choices, users have the option of logging on by using the Citrix Gateway Plug-in for Windows, Citrix Gateway Plug-in for Java, the Web Interface, or clientless access from one location. Depending on how Citrix Gateway is configured, users are presented with up to three icons for logon choices. The most common are the Citrix Gateway Plug-in for Windows, Web Interface, and clientless access. Possible values = ON, OFF .PARAMETER Epaclienttype Choose between two types of End point Windows Client a) Application Agent - which always runs in the task bar as a standalone application and also has a supporting service which runs permanently when installed b) Activex Control - ActiveX control run by Microsoft Internet Explorer. Possible values = AGENT, PLUGIN .PARAMETER Iipdnssuffix An intranet IP DNS suffix. When a user logs on to Citrix Gateway and is assigned an IP address, a DNS record for the user name and IP address combination is added to the Citrix Gateway DNS cache. You can configure a DNS suffix to append to the user name when the DNS record is added to the cache. You can reach to the host from where the user is logged on by using the user's name, which can be easier to remember than an IP address. When the user logs off from Citrix Gateway, the record is removed from the DNS cache. .PARAMETER Forcedtimeout Force a disconnection from the Citrix Gateway Plug-in with Citrix Gateway after a specified number of minutes. If the session closes, the user must log on again. Maximum value = 65535 .PARAMETER Forcedtimeoutwarning Number of minutes to warn a user before the user session is disconnected. Maximum value = 255 .PARAMETER Ntdomain Single sign-on domain to use for single sign-on to applications in the internal network. This setting can be overwritten by the domain that users specify at the time of logon or by the domain that the authentication server returns. .PARAMETER Clientlessvpnmode Enable clientless access for web, XenApp or XenDesktop, and FileShare resources without installing the Citrix Gateway Plug-in. Available settings function as follows: * ON - Allow only clientless access. * OFF - Allow clientless access after users log on with the Citrix Gateway Plug-in. * DISABLED - Do not allow clientless access. Possible values = ON, OFF, DISABLED .PARAMETER Emailhome Web address for the web-based email, such as Outlook Web Access. .PARAMETER Clientlessmodeurlencoding When clientless access is enabled, you can choose to encode the addresses of internal web applications or to leave the address as clear text. Available settings function as follows: * OPAQUE - Use standard encoding mechanisms to make the domain and protocol part of the resource unclear to users. * CLEAR - Do not encode the web address and make it visible to users. * ENCRYPT - Allow the domain and protocol to be encrypted using a session key. When the web address is encrypted, the URL is different for each user session for the same web resource. If users bookmark the encoded web address, save it in the web browser and then log off, they cannot connect to the web address when they log on and use the bookmark. If users save the encrypted bookmark in the Access Interface during their session, the bookmark works each time the user logs on. Possible values = TRANSPARENT, OPAQUE, ENCRYPT .PARAMETER Clientlesspersistentcookie State of persistent cookies in clientless access mode. Persistent cookies are required for accessing certain features of SharePoint, such as opening and editing Microsoft Word, Excel, and PowerPoint documents hosted on the SharePoint server. A persistent cookie remains on the user device and is sent with each HTTP request. Citrix Gateway encrypts the persistent cookie before sending it to the plug-in on the user device, and refreshes the cookie periodically as long as the session exists. The cookie becomes stale if the session ends. Available settings function as follows: * ALLOW - Enable persistent cookies. Users can open and edit Microsoft documents stored in SharePoint. * DENY - Disable persistent cookies. Users cannot open and edit Microsoft documents stored in SharePoint. * PROMPT - Prompt users to allow or deny persistent cookies during the session. Persistent cookies are not required for clientless access if users do not connect to SharePoint. Possible values = ALLOW, DENY, PROMPT .PARAMETER Allowedlogingroups Specify groups that have permission to log on to Citrix Gateway. Users who do not belong to this group or groups are denied access even if they have valid credentials. .PARAMETER Securebrowse Allow users to connect through Citrix Gateway to network resources from iOS and Android mobile devices with Citrix Receiver. Users do not need to establish a full VPN tunnel to access resources in the secure network. Possible values = ENABLED, DISABLED .PARAMETER Storefronturl Web address for StoreFront to be used in this session for enumeration of resources from XenApp or XenDesktop. .PARAMETER Sfgatewayauthtype The authentication type configured for the Citrix Gateway on StoreFront. Possible values = domain, RSA, domainAndRSA, SMS, smartCard, sfAuth, sfAuthAndRSA .PARAMETER Kcdaccount The kcd account details to be used in SSO. .PARAMETER Rdpclientprofilename Name of the RDP profile associated with the vserver. .PARAMETER Windowspluginupgrade Option to set plugin upgrade behaviour for Win. Possible values = Always, Essential, Never .PARAMETER Macpluginupgrade Option to set plugin upgrade behaviour for Mac. Possible values = Always, Essential, Never .PARAMETER Linuxpluginupgrade Option to set plugin upgrade behaviour for Linux. Possible values = Always, Essential, Never .PARAMETER Iconwithreceiver Option to decide whether to show plugin icon along with receiver. Possible values = ON, OFF .PARAMETER Alwaysonprofilename Name of the AlwaysON profile associated with the session action. The builtin profile named none can be used to explicitly disable AlwaysON for the session action. .PARAMETER Autoproxyurl URL to auto proxy config file. .PARAMETER Advancedclientlessvpnmode Option to enable/disable Advanced ClientlessVpnMode. Additionaly, it can be set to STRICT to block Classic ClientlessVpnMode while in AdvancedClientlessMode. Possible values = ENABLED, DISABLED, STRICT .PARAMETER Pcoipprofilename Name of the PCOIP profile associated with the session action. The builtin profile named none can be used to explicitly disable PCOIP for the session action. .PARAMETER Fqdnspoofedip Spoofed IP address range that can be used by client for FQDN based split tunneling. .PARAMETER Netmask The netmask for the spoofed ip address. .EXAMPLE PS C:\>Invoke-NSUnsetVpnsessionaction -name <string> An example how to unset vpnsessionaction config Object(s). .NOTES File Name : Invoke-NSUnsetVpnsessionaction Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnsessionaction Requires : PowerShell v5.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]$Name, [Boolean]$useraccounting, [Boolean]$httpport, [Boolean]$winsip, [Boolean]$dnsvservername, [Boolean]$splitdns, [Boolean]$sesstimeout, [Boolean]$clientsecurity, [Boolean]$clientsecuritygroup, [Boolean]$clientsecuritymessage, [Boolean]$clientsecuritylog, [Boolean]$splittunnel, [Boolean]$locallanaccess, [Boolean]$rfc1918, [Boolean]$spoofiip, [Boolean]$killconnections, [Boolean]$transparentinterception, [Boolean]$windowsclienttype, [Boolean]$defaultauthorizationaction, [Boolean]$authorizationgroup, [Boolean]$smartgroup, [Boolean]$clientidletimeout, [Boolean]$proxy, [Boolean]$allprotocolproxy, [Boolean]$httpproxy, [Boolean]$ftpproxy, [Boolean]$socksproxy, [Boolean]$gopherproxy, [Boolean]$sslproxy, [Boolean]$proxyexception, [Boolean]$proxylocalbypass, [Boolean]$clientcleanupprompt, [Boolean]$forcecleanup, [Boolean]$clientoptions, [Boolean]$clientconfiguration, [Boolean]$sso, [Boolean]$ssocredential, [Boolean]$windowsautologon, [Boolean]$usemip, [Boolean]$useiip, [Boolean]$clientdebug, [Boolean]$loginscript, [Boolean]$logoutscript, [Boolean]$homepage, [Boolean]$icaproxy, [Boolean]$wihome, [Boolean]$citrixreceiverhome, [Boolean]$wiportalmode, [Boolean]$clientchoices, [Boolean]$epaclienttype, [Boolean]$iipdnssuffix, [Boolean]$forcedtimeout, [Boolean]$forcedtimeoutwarning, [Boolean]$ntdomain, [Boolean]$clientlessvpnmode, [Boolean]$emailhome, [Boolean]$clientlessmodeurlencoding, [Boolean]$clientlesspersistentcookie, [Boolean]$allowedlogingroups, [Boolean]$securebrowse, [Boolean]$storefronturl, [Boolean]$sfgatewayauthtype, [Boolean]$kcdaccount, [Boolean]$rdpclientprofilename, [Boolean]$windowspluginupgrade, [Boolean]$macpluginupgrade, [Boolean]$linuxpluginupgrade, [Boolean]$iconwithreceiver, [Boolean]$alwaysonprofilename, [Boolean]$autoproxyurl, [Boolean]$advancedclientlessvpnmode, [Boolean]$pcoipprofilename, [Boolean]$fqdnspoofedip, [Boolean]$netmask ) begin { Write-Verbose "Invoke-NSUnsetVpnsessionaction: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('useraccounting') ) { $payload.Add('useraccounting', $useraccounting) } if ( $PSBoundParameters.ContainsKey('httpport') ) { $payload.Add('httpport', $httpport) } if ( $PSBoundParameters.ContainsKey('winsip') ) { $payload.Add('winsip', $winsip) } if ( $PSBoundParameters.ContainsKey('dnsvservername') ) { $payload.Add('dnsvservername', $dnsvservername) } if ( $PSBoundParameters.ContainsKey('splitdns') ) { $payload.Add('splitdns', $splitdns) } if ( $PSBoundParameters.ContainsKey('sesstimeout') ) { $payload.Add('sesstimeout', $sesstimeout) } if ( $PSBoundParameters.ContainsKey('clientsecurity') ) { $payload.Add('clientsecurity', $clientsecurity) } if ( $PSBoundParameters.ContainsKey('clientsecuritygroup') ) { $payload.Add('clientsecuritygroup', $clientsecuritygroup) } if ( $PSBoundParameters.ContainsKey('clientsecuritymessage') ) { $payload.Add('clientsecuritymessage', $clientsecuritymessage) } if ( $PSBoundParameters.ContainsKey('clientsecuritylog') ) { $payload.Add('clientsecuritylog', $clientsecuritylog) } if ( $PSBoundParameters.ContainsKey('splittunnel') ) { $payload.Add('splittunnel', $splittunnel) } if ( $PSBoundParameters.ContainsKey('locallanaccess') ) { $payload.Add('locallanaccess', $locallanaccess) } if ( $PSBoundParameters.ContainsKey('rfc1918') ) { $payload.Add('rfc1918', $rfc1918) } if ( $PSBoundParameters.ContainsKey('spoofiip') ) { $payload.Add('spoofiip', $spoofiip) } if ( $PSBoundParameters.ContainsKey('killconnections') ) { $payload.Add('killconnections', $killconnections) } if ( $PSBoundParameters.ContainsKey('transparentinterception') ) { $payload.Add('transparentinterception', $transparentinterception) } if ( $PSBoundParameters.ContainsKey('windowsclienttype') ) { $payload.Add('windowsclienttype', $windowsclienttype) } if ( $PSBoundParameters.ContainsKey('defaultauthorizationaction') ) { $payload.Add('defaultauthorizationaction', $defaultauthorizationaction) } if ( $PSBoundParameters.ContainsKey('authorizationgroup') ) { $payload.Add('authorizationgroup', $authorizationgroup) } if ( $PSBoundParameters.ContainsKey('smartgroup') ) { $payload.Add('smartgroup', $smartgroup) } if ( $PSBoundParameters.ContainsKey('clientidletimeout') ) { $payload.Add('clientidletimeout', $clientidletimeout) } if ( $PSBoundParameters.ContainsKey('proxy') ) { $payload.Add('proxy', $proxy) } if ( $PSBoundParameters.ContainsKey('allprotocolproxy') ) { $payload.Add('allprotocolproxy', $allprotocolproxy) } if ( $PSBoundParameters.ContainsKey('httpproxy') ) { $payload.Add('httpproxy', $httpproxy) } if ( $PSBoundParameters.ContainsKey('ftpproxy') ) { $payload.Add('ftpproxy', $ftpproxy) } if ( $PSBoundParameters.ContainsKey('socksproxy') ) { $payload.Add('socksproxy', $socksproxy) } if ( $PSBoundParameters.ContainsKey('gopherproxy') ) { $payload.Add('gopherproxy', $gopherproxy) } if ( $PSBoundParameters.ContainsKey('sslproxy') ) { $payload.Add('sslproxy', $sslproxy) } if ( $PSBoundParameters.ContainsKey('proxyexception') ) { $payload.Add('proxyexception', $proxyexception) } if ( $PSBoundParameters.ContainsKey('proxylocalbypass') ) { $payload.Add('proxylocalbypass', $proxylocalbypass) } if ( $PSBoundParameters.ContainsKey('clientcleanupprompt') ) { $payload.Add('clientcleanupprompt', $clientcleanupprompt) } if ( $PSBoundParameters.ContainsKey('forcecleanup') ) { $payload.Add('forcecleanup', $forcecleanup) } if ( $PSBoundParameters.ContainsKey('clientoptions') ) { $payload.Add('clientoptions', $clientoptions) } if ( $PSBoundParameters.ContainsKey('clientconfiguration') ) { $payload.Add('clientconfiguration', $clientconfiguration) } if ( $PSBoundParameters.ContainsKey('sso') ) { $payload.Add('sso', $sso) } if ( $PSBoundParameters.ContainsKey('ssocredential') ) { $payload.Add('ssocredential', $ssocredential) } if ( $PSBoundParameters.ContainsKey('windowsautologon') ) { $payload.Add('windowsautologon', $windowsautologon) } if ( $PSBoundParameters.ContainsKey('usemip') ) { $payload.Add('usemip', $usemip) } if ( $PSBoundParameters.ContainsKey('useiip') ) { $payload.Add('useiip', $useiip) } if ( $PSBoundParameters.ContainsKey('clientdebug') ) { $payload.Add('clientdebug', $clientdebug) } if ( $PSBoundParameters.ContainsKey('loginscript') ) { $payload.Add('loginscript', $loginscript) } if ( $PSBoundParameters.ContainsKey('logoutscript') ) { $payload.Add('logoutscript', $logoutscript) } if ( $PSBoundParameters.ContainsKey('homepage') ) { $payload.Add('homepage', $homepage) } if ( $PSBoundParameters.ContainsKey('icaproxy') ) { $payload.Add('icaproxy', $icaproxy) } if ( $PSBoundParameters.ContainsKey('wihome') ) { $payload.Add('wihome', $wihome) } if ( $PSBoundParameters.ContainsKey('citrixreceiverhome') ) { $payload.Add('citrixreceiverhome', $citrixreceiverhome) } if ( $PSBoundParameters.ContainsKey('wiportalmode') ) { $payload.Add('wiportalmode', $wiportalmode) } if ( $PSBoundParameters.ContainsKey('clientchoices') ) { $payload.Add('clientchoices', $clientchoices) } if ( $PSBoundParameters.ContainsKey('epaclienttype') ) { $payload.Add('epaclienttype', $epaclienttype) } if ( $PSBoundParameters.ContainsKey('iipdnssuffix') ) { $payload.Add('iipdnssuffix', $iipdnssuffix) } if ( $PSBoundParameters.ContainsKey('forcedtimeout') ) { $payload.Add('forcedtimeout', $forcedtimeout) } if ( $PSBoundParameters.ContainsKey('forcedtimeoutwarning') ) { $payload.Add('forcedtimeoutwarning', $forcedtimeoutwarning) } if ( $PSBoundParameters.ContainsKey('ntdomain') ) { $payload.Add('ntdomain', $ntdomain) } if ( $PSBoundParameters.ContainsKey('clientlessvpnmode') ) { $payload.Add('clientlessvpnmode', $clientlessvpnmode) } if ( $PSBoundParameters.ContainsKey('emailhome') ) { $payload.Add('emailhome', $emailhome) } if ( $PSBoundParameters.ContainsKey('clientlessmodeurlencoding') ) { $payload.Add('clientlessmodeurlencoding', $clientlessmodeurlencoding) } if ( $PSBoundParameters.ContainsKey('clientlesspersistentcookie') ) { $payload.Add('clientlesspersistentcookie', $clientlesspersistentcookie) } if ( $PSBoundParameters.ContainsKey('allowedlogingroups') ) { $payload.Add('allowedlogingroups', $allowedlogingroups) } if ( $PSBoundParameters.ContainsKey('securebrowse') ) { $payload.Add('securebrowse', $securebrowse) } if ( $PSBoundParameters.ContainsKey('storefronturl') ) { $payload.Add('storefronturl', $storefronturl) } if ( $PSBoundParameters.ContainsKey('sfgatewayauthtype') ) { $payload.Add('sfgatewayauthtype', $sfgatewayauthtype) } if ( $PSBoundParameters.ContainsKey('kcdaccount') ) { $payload.Add('kcdaccount', $kcdaccount) } if ( $PSBoundParameters.ContainsKey('rdpclientprofilename') ) { $payload.Add('rdpclientprofilename', $rdpclientprofilename) } if ( $PSBoundParameters.ContainsKey('windowspluginupgrade') ) { $payload.Add('windowspluginupgrade', $windowspluginupgrade) } if ( $PSBoundParameters.ContainsKey('macpluginupgrade') ) { $payload.Add('macpluginupgrade', $macpluginupgrade) } if ( $PSBoundParameters.ContainsKey('linuxpluginupgrade') ) { $payload.Add('linuxpluginupgrade', $linuxpluginupgrade) } if ( $PSBoundParameters.ContainsKey('iconwithreceiver') ) { $payload.Add('iconwithreceiver', $iconwithreceiver) } if ( $PSBoundParameters.ContainsKey('alwaysonprofilename') ) { $payload.Add('alwaysonprofilename', $alwaysonprofilename) } if ( $PSBoundParameters.ContainsKey('autoproxyurl') ) { $payload.Add('autoproxyurl', $autoproxyurl) } if ( $PSBoundParameters.ContainsKey('advancedclientlessvpnmode') ) { $payload.Add('advancedclientlessvpnmode', $advancedclientlessvpnmode) } if ( $PSBoundParameters.ContainsKey('pcoipprofilename') ) { $payload.Add('pcoipprofilename', $pcoipprofilename) } if ( $PSBoundParameters.ContainsKey('fqdnspoofedip') ) { $payload.Add('fqdnspoofedip', $fqdnspoofedip) } if ( $PSBoundParameters.ContainsKey('netmask') ) { $payload.Add('netmask', $netmask) } if ( $PSCmdlet.ShouldProcess("$name", "Unset Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type vpnsessionaction -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-NSUnsetVpnsessionaction: Finished" } } function Invoke-NSGetVpnsessionaction { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Configuration for VPN session action resource. .PARAMETER Name Name for the Citrix Gateway profile (action). Must begin with an ASCII alphabetic or underscore (_) character, and must consist only of ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the profile is created. .PARAMETER GetAll Retrieve all vpnsessionaction object(s). .PARAMETER Count If specified, the count of the vpnsessionaction 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-NSGetVpnsessionaction Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnsessionaction -GetAll Get all vpnsessionaction data. .EXAMPLE PS C:\>Invoke-NSGetVpnsessionaction -Count Get the number of vpnsessionaction objects. .EXAMPLE PS C:\>Invoke-NSGetVpnsessionaction -name <string> Get vpnsessionaction object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnsessionaction -Filter @{ 'name'='<value>' } Get vpnsessionaction data with a filter. .NOTES File Name : Invoke-NSGetVpnsessionaction Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnsessionaction/ Requires : PowerShell v5.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]$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-NSGetVpnsessionaction: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all vpnsessionaction objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionaction -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 vpnsessionaction objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionaction -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnsessionaction objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionaction -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnsessionaction configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionaction -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnsessionaction configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionaction -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-NSGetVpnsessionaction: Ended" } } function Invoke-NSAddVpnsessionpolicy { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN session policy resource. .PARAMETER Name Name for the new session policy that is applied after the user logs on to Citrix Gateway. .PARAMETER Rule Expression, or name of a named expression, specifying the traffic that matches the policy. The following requirements apply only to the Citrix ADC CLI: * If the expression includes one or more spaces, enclose the entire expression in double quotation marks. * If the expression itself includes double quotation marks, escape the quotations by using the \ character. * Alternatively, you can use single quotation marks to enclose the rule, in which case you do not have to escape the double quotation marks. .PARAMETER Action Action to be applied by the new session policy if the rule criteria are met. .PARAMETER PassThru Return details about the created vpnsessionpolicy item. .EXAMPLE PS C:\>Invoke-NSAddVpnsessionpolicy -name <string> -rule <string> -action <string> An example how to add vpnsessionpolicy config Object(s). .NOTES File Name : Invoke-NSAddVpnsessionpolicy Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnsessionpolicy/ Requires : PowerShell v5.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]$Rule, [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Action, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnsessionpolicy: Starting" } process { try { $payload = @{ name = $name rule = $rule action = $action } if ( $PSCmdlet.ShouldProcess("vpnsessionpolicy", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type vpnsessionpolicy -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-NSGetVpnsessionpolicy -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnsessionpolicy: Finished" } } function Invoke-NSDeleteVpnsessionpolicy { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN session policy resource. .PARAMETER Name Name for the new session policy that is applied after the user logs on to Citrix Gateway. .EXAMPLE PS C:\>Invoke-NSDeleteVpnsessionpolicy -Name <string> An example how to delete vpnsessionpolicy config Object(s). .NOTES File Name : Invoke-NSDeleteVpnsessionpolicy Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnsessionpolicy/ Requires : PowerShell v5.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-NSDeleteVpnsessionpolicy: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnsessionpolicy -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-NSDeleteVpnsessionpolicy: Finished" } } function Invoke-NSUpdateVpnsessionpolicy { <# .SYNOPSIS Update Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN session policy resource. .PARAMETER Name Name for the new session policy that is applied after the user logs on to Citrix Gateway. .PARAMETER Rule Expression, or name of a named expression, specifying the traffic that matches the policy. The following requirements apply only to the Citrix ADC CLI: * If the expression includes one or more spaces, enclose the entire expression in double quotation marks. * If the expression itself includes double quotation marks, escape the quotations by using the \ character. * Alternatively, you can use single quotation marks to enclose the rule, in which case you do not have to escape the double quotation marks. .PARAMETER Action Action to be applied by the new session policy if the rule criteria are met. .PARAMETER PassThru Return details about the created vpnsessionpolicy item. .EXAMPLE PS C:\>Invoke-NSUpdateVpnsessionpolicy -name <string> An example how to update vpnsessionpolicy config Object(s). .NOTES File Name : Invoke-NSUpdateVpnsessionpolicy Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnsessionpolicy/ Requires : PowerShell v5.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, [string]$Rule, [ValidateScript({ $_.Length -gt 1 })] [string]$Action, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateVpnsessionpolicy: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('rule') ) { $payload.Add('rule', $rule) } if ( $PSBoundParameters.ContainsKey('action') ) { $payload.Add('action', $action) } if ( $PSCmdlet.ShouldProcess("vpnsessionpolicy", "Update Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnsessionpolicy -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-NSGetVpnsessionpolicy -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateVpnsessionpolicy: Finished" } } function Invoke-NSUnsetVpnsessionpolicy { <# .SYNOPSIS Unset Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN session policy resource. .PARAMETER Name Name for the new session policy that is applied after the user logs on to Citrix Gateway. .PARAMETER Rule Expression, or name of a named expression, specifying the traffic that matches the policy. The following requirements apply only to the Citrix ADC CLI: * If the expression includes one or more spaces, enclose the entire expression in double quotation marks. * If the expression itself includes double quotation marks, escape the quotations by using the \ character. * Alternatively, you can use single quotation marks to enclose the rule, in which case you do not have to escape the double quotation marks. .PARAMETER Action Action to be applied by the new session policy if the rule criteria are met. .EXAMPLE PS C:\>Invoke-NSUnsetVpnsessionpolicy -name <string> An example how to unset vpnsessionpolicy config Object(s). .NOTES File Name : Invoke-NSUnsetVpnsessionpolicy Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnsessionpolicy Requires : PowerShell v5.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]$rule, [Boolean]$action ) begin { Write-Verbose "Invoke-NSUnsetVpnsessionpolicy: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('rule') ) { $payload.Add('rule', $rule) } if ( $PSBoundParameters.ContainsKey('action') ) { $payload.Add('action', $action) } if ( $PSCmdlet.ShouldProcess("$name", "Unset Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type vpnsessionpolicy -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-NSUnsetVpnsessionpolicy: Finished" } } function Invoke-NSGetVpnsessionpolicy { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Configuration for VPN session policy resource. .PARAMETER Name Name for the new session policy that is applied after the user logs on to Citrix Gateway. .PARAMETER GetAll Retrieve all vpnsessionpolicy object(s). .PARAMETER Count If specified, the count of the vpnsessionpolicy 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-NSGetVpnsessionpolicy Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnsessionpolicy -GetAll Get all vpnsessionpolicy data. .EXAMPLE PS C:\>Invoke-NSGetVpnsessionpolicy -Count Get the number of vpnsessionpolicy objects. .EXAMPLE PS C:\>Invoke-NSGetVpnsessionpolicy -name <string> Get vpnsessionpolicy object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnsessionpolicy -Filter @{ 'name'='<value>' } Get vpnsessionpolicy data with a filter. .NOTES File Name : Invoke-NSGetVpnsessionpolicy Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnsessionpolicy/ Requires : PowerShell v5.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-NSGetVpnsessionpolicy: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all vpnsessionpolicy objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy -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 vpnsessionpolicy objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnsessionpolicy objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnsessionpolicy configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnsessionpolicy configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy -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-NSGetVpnsessionpolicy: Ended" } } function Invoke-NSGetVpnsessionpolicyAaagroupBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the aaagroup that can be bound to vpnsessionpolicy. .PARAMETER Name Name of the session policy to display. .PARAMETER GetAll Retrieve all vpnsessionpolicy_aaagroup_binding object(s). .PARAMETER Count If specified, the count of the vpnsessionpolicy_aaagroup_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-NSGetVpnsessionpolicyAaagroupBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnsessionpolicyAaagroupBinding -GetAll Get all vpnsessionpolicy_aaagroup_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnsessionpolicyAaagroupBinding -Count Get the number of vpnsessionpolicy_aaagroup_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnsessionpolicyAaagroupBinding -name <string> Get vpnsessionpolicy_aaagroup_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnsessionpolicyAaagroupBinding -Filter @{ 'name'='<value>' } Get vpnsessionpolicy_aaagroup_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnsessionpolicyAaagroupBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnsessionpolicy_aaagroup_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-NSGetVpnsessionpolicyAaagroupBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnsessionpolicy_aaagroup_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy_aaagroup_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 vpnsessionpolicy_aaagroup_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy_aaagroup_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnsessionpolicy_aaagroup_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy_aaagroup_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnsessionpolicy_aaagroup_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy_aaagroup_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnsessionpolicy_aaagroup_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy_aaagroup_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-NSGetVpnsessionpolicyAaagroupBinding: Ended" } } function Invoke-NSGetVpnsessionpolicyAaauserBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the aaauser that can be bound to vpnsessionpolicy. .PARAMETER Name Name of the session policy to display. .PARAMETER GetAll Retrieve all vpnsessionpolicy_aaauser_binding object(s). .PARAMETER Count If specified, the count of the vpnsessionpolicy_aaauser_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-NSGetVpnsessionpolicyAaauserBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnsessionpolicyAaauserBinding -GetAll Get all vpnsessionpolicy_aaauser_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnsessionpolicyAaauserBinding -Count Get the number of vpnsessionpolicy_aaauser_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnsessionpolicyAaauserBinding -name <string> Get vpnsessionpolicy_aaauser_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnsessionpolicyAaauserBinding -Filter @{ 'name'='<value>' } Get vpnsessionpolicy_aaauser_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnsessionpolicyAaauserBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnsessionpolicy_aaauser_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-NSGetVpnsessionpolicyAaauserBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnsessionpolicy_aaauser_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy_aaauser_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 vpnsessionpolicy_aaauser_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy_aaauser_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnsessionpolicy_aaauser_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy_aaauser_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnsessionpolicy_aaauser_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy_aaauser_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnsessionpolicy_aaauser_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy_aaauser_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-NSGetVpnsessionpolicyAaauserBinding: Ended" } } function Invoke-NSGetVpnsessionpolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object which returns the resources bound to vpnsessionpolicy. .PARAMETER Name Name of the session policy to display. .PARAMETER GetAll Retrieve all vpnsessionpolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnsessionpolicy_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-NSGetVpnsessionpolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnsessionpolicyBinding -GetAll Get all vpnsessionpolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnsessionpolicyBinding -name <string> Get vpnsessionpolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnsessionpolicyBinding -Filter @{ 'name'='<value>' } Get vpnsessionpolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnsessionpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnsessionpolicy_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-NSGetVpnsessionpolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnsessionpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy_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 vpnsessionpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnsessionpolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnsessionpolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnsessionpolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy_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-NSGetVpnsessionpolicyBinding: Ended" } } function Invoke-NSGetVpnsessionpolicyVpnglobalBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the vpnglobal that can be bound to vpnsessionpolicy. .PARAMETER Name Name of the session policy to display. .PARAMETER GetAll Retrieve all vpnsessionpolicy_vpnglobal_binding object(s). .PARAMETER Count If specified, the count of the vpnsessionpolicy_vpnglobal_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-NSGetVpnsessionpolicyVpnglobalBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnsessionpolicyVpnglobalBinding -GetAll Get all vpnsessionpolicy_vpnglobal_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnsessionpolicyVpnglobalBinding -Count Get the number of vpnsessionpolicy_vpnglobal_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnsessionpolicyVpnglobalBinding -name <string> Get vpnsessionpolicy_vpnglobal_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnsessionpolicyVpnglobalBinding -Filter @{ 'name'='<value>' } Get vpnsessionpolicy_vpnglobal_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnsessionpolicyVpnglobalBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnsessionpolicy_vpnglobal_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-NSGetVpnsessionpolicyVpnglobalBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnsessionpolicy_vpnglobal_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy_vpnglobal_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 vpnsessionpolicy_vpnglobal_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy_vpnglobal_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnsessionpolicy_vpnglobal_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy_vpnglobal_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnsessionpolicy_vpnglobal_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy_vpnglobal_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnsessionpolicy_vpnglobal_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy_vpnglobal_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-NSGetVpnsessionpolicyVpnglobalBinding: Ended" } } function Invoke-NSGetVpnsessionpolicyVpnvserverBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the vpnvserver that can be bound to vpnsessionpolicy. .PARAMETER Name Name of the session policy to display. .PARAMETER GetAll Retrieve all vpnsessionpolicy_vpnvserver_binding object(s). .PARAMETER Count If specified, the count of the vpnsessionpolicy_vpnvserver_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-NSGetVpnsessionpolicyVpnvserverBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnsessionpolicyVpnvserverBinding -GetAll Get all vpnsessionpolicy_vpnvserver_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnsessionpolicyVpnvserverBinding -Count Get the number of vpnsessionpolicy_vpnvserver_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnsessionpolicyVpnvserverBinding -name <string> Get vpnsessionpolicy_vpnvserver_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnsessionpolicyVpnvserverBinding -Filter @{ 'name'='<value>' } Get vpnsessionpolicy_vpnvserver_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnsessionpolicyVpnvserverBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnsessionpolicy_vpnvserver_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-NSGetVpnsessionpolicyVpnvserverBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnsessionpolicy_vpnvserver_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy_vpnvserver_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 vpnsessionpolicy_vpnvserver_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy_vpnvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnsessionpolicy_vpnvserver_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy_vpnvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnsessionpolicy_vpnvserver_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy_vpnvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnsessionpolicy_vpnvserver_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsessionpolicy_vpnvserver_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-NSGetVpnsessionpolicyVpnvserverBinding: Ended" } } function Invoke-NSGetVpnsfconfig { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Configuration for Create a StoreFront configuration file resource. .PARAMETER Vserver Name of Gateway virtual server. .PARAMETER GetAll Retrieve all vpnsfconfig object(s). .PARAMETER Count If specified, the count of the vpnsfconfig 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-NSGetVpnsfconfig Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnsfconfig -GetAll Get all vpnsfconfig data. .EXAMPLE PS C:\>Invoke-NSGetVpnsfconfig -Count Get the number of vpnsfconfig objects. .EXAMPLE PS C:\>Invoke-NSGetVpnsfconfig -name <string> Get vpnsfconfig object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnsfconfig -Filter @{ 'name'='<value>' } Get vpnsfconfig data with a filter. .NOTES File Name : Invoke-NSGetVpnsfconfig Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnsfconfig/ Requires : PowerShell v5.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[]]$Vserver, [Parameter(ParameterSetName = 'Count', Mandatory)] [Switch]$Count, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetVpnsfconfig: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all vpnsfconfig objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsfconfig -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 vpnsfconfig objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsfconfig -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnsfconfig objects by arguments" $arguments = @{ } if ( $PSBoundParameters.ContainsKey('vserver') ) { $arguments.Add('vserver', $vserver) } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsfconfig -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnsfconfig configuration for property ''" } else { Write-Verbose "Retrieving vpnsfconfig configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnsfconfig -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-NSGetVpnsfconfig: Ended" } } function Invoke-NSGetVpnstoreinfo { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Configuration for Store information for a URL resource. .PARAMETER Url StoreFront URL to be scanned. .PARAMETER GetAll Retrieve all vpnstoreinfo object(s). .PARAMETER Count If specified, the count of the vpnstoreinfo 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-NSGetVpnstoreinfo Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnstoreinfo -GetAll Get all vpnstoreinfo data. .EXAMPLE PS C:\>Invoke-NSGetVpnstoreinfo -Count Get the number of vpnstoreinfo objects. .EXAMPLE PS C:\>Invoke-NSGetVpnstoreinfo -name <string> Get vpnstoreinfo object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnstoreinfo -Filter @{ 'name'='<value>' } Get vpnstoreinfo data with a filter. .NOTES File Name : Invoke-NSGetVpnstoreinfo Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnstoreinfo/ Requires : PowerShell v5.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]$Url, [hashtable]$Filter = @{ }, [Parameter(ParameterSetName = 'GetAll')] [Switch]$GetAll, [Parameter(ParameterSetName = 'GetAll')] [Switch]$ViewSummary ) begin { Write-Verbose "Invoke-NSGetVpnstoreinfo: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all vpnstoreinfo objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnstoreinfo -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 vpnstoreinfo objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnstoreinfo -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnstoreinfo objects by arguments" $arguments = @{ } if ( $PSBoundParameters.ContainsKey('url') ) { $arguments.Add('url', $url) } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnstoreinfo -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnstoreinfo configuration for property ''" } else { Write-Verbose "Retrieving vpnstoreinfo configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnstoreinfo -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-NSGetVpnstoreinfo: Ended" } } function Invoke-NSAddVpntrafficaction { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN traffic action resource. .PARAMETER Name Name for the traffic action. 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 a traffic action is created. .PARAMETER Qual Protocol, either HTTP or TCP, to be used with the action. Possible values = http, tcp .PARAMETER Apptimeout Maximum amount of time, in minutes, a user can stay logged on to the web application. Maximum value = 715827 .PARAMETER Sso Provide single sign-on to the web application. NOTE : Authentication mechanisms like Basic-authentication require the user credentials to be sent in plaintext which is not secure if the server is running on HTTP (instead of HTTPS). Possible values = ON, OFF .PARAMETER Hdx Provide hdx proxy to the ICA traffic. Possible values = ON, OFF .PARAMETER Formssoaction Name of the form-based single sign-on profile. Form-based single sign-on allows users to log on one time to all protected applications in your network, instead of requiring them to log on separately to access each one. .PARAMETER Fta Specify file type association, which is a list of file extensions that users are allowed to open. Possible values = ON, OFF .PARAMETER Wanscaler Use the Repeater Plug-in to optimize network traffic. Possible values = ON, OFF .PARAMETER Kcdaccount Kerberos constrained delegation account name. .PARAMETER Samlssoprofile Profile to be used for doing SAML SSO to remote relying party. .PARAMETER Proxy IP address and Port of the proxy server to be used for HTTP access for this request. .PARAMETER Userexpression expression that will be evaluated to obtain username for SingleSignOn. .PARAMETER Passwdexpression expression that will be evaluated to obtain password for SingleSignOn. .PARAMETER PassThru Return details about the created vpntrafficaction item. .EXAMPLE PS C:\>Invoke-NSAddVpntrafficaction -name <string> -qual <string> An example how to add vpntrafficaction config Object(s). .NOTES File Name : Invoke-NSAddVpntrafficaction Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpntrafficaction/ Requires : PowerShell v5.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]$Name, [Parameter(Mandatory)] [ValidateSet('http', 'tcp')] [string]$Qual, [double]$Apptimeout, [ValidateSet('ON', 'OFF')] [string]$Sso, [ValidateSet('ON', 'OFF')] [string]$Hdx, [string]$Formssoaction, [ValidateSet('ON', 'OFF')] [string]$Fta, [ValidateSet('ON', 'OFF')] [string]$Wanscaler, [ValidateLength(1, 32)] [string]$Kcdaccount = '"Default"', [ValidateScript({ $_.Length -gt 1 })] [string]$Samlssoprofile, [ValidateScript({ $_.Length -gt 1 })] [string]$Proxy, [string]$Userexpression, [string]$Passwdexpression, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpntrafficaction: Starting" } process { try { $payload = @{ name = $name qual = $qual } if ( $PSBoundParameters.ContainsKey('apptimeout') ) { $payload.Add('apptimeout', $apptimeout) } if ( $PSBoundParameters.ContainsKey('sso') ) { $payload.Add('sso', $sso) } if ( $PSBoundParameters.ContainsKey('hdx') ) { $payload.Add('hdx', $hdx) } if ( $PSBoundParameters.ContainsKey('formssoaction') ) { $payload.Add('formssoaction', $formssoaction) } if ( $PSBoundParameters.ContainsKey('fta') ) { $payload.Add('fta', $fta) } if ( $PSBoundParameters.ContainsKey('wanscaler') ) { $payload.Add('wanscaler', $wanscaler) } if ( $PSBoundParameters.ContainsKey('kcdaccount') ) { $payload.Add('kcdaccount', $kcdaccount) } if ( $PSBoundParameters.ContainsKey('samlssoprofile') ) { $payload.Add('samlssoprofile', $samlssoprofile) } if ( $PSBoundParameters.ContainsKey('proxy') ) { $payload.Add('proxy', $proxy) } if ( $PSBoundParameters.ContainsKey('userexpression') ) { $payload.Add('userexpression', $userexpression) } if ( $PSBoundParameters.ContainsKey('passwdexpression') ) { $payload.Add('passwdexpression', $passwdexpression) } if ( $PSCmdlet.ShouldProcess("vpntrafficaction", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type vpntrafficaction -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-NSGetVpntrafficaction -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpntrafficaction: Finished" } } function Invoke-NSDeleteVpntrafficaction { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN traffic action resource. .PARAMETER Name Name for the traffic action. 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 a traffic action is created. .EXAMPLE PS C:\>Invoke-NSDeleteVpntrafficaction -Name <string> An example how to delete vpntrafficaction config Object(s). .NOTES File Name : Invoke-NSDeleteVpntrafficaction Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpntrafficaction/ Requires : PowerShell v5.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-NSDeleteVpntrafficaction: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpntrafficaction -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-NSDeleteVpntrafficaction: Finished" } } function Invoke-NSUpdateVpntrafficaction { <# .SYNOPSIS Update Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN traffic action resource. .PARAMETER Name Name for the traffic action. 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 a traffic action is created. .PARAMETER Apptimeout Maximum amount of time, in minutes, a user can stay logged on to the web application. Maximum value = 715827 .PARAMETER Sso Provide single sign-on to the web application. NOTE : Authentication mechanisms like Basic-authentication require the user credentials to be sent in plaintext which is not secure if the server is running on HTTP (instead of HTTPS). Possible values = ON, OFF .PARAMETER Hdx Provide hdx proxy to the ICA traffic. Possible values = ON, OFF .PARAMETER Formssoaction Name of the form-based single sign-on profile. Form-based single sign-on allows users to log on one time to all protected applications in your network, instead of requiring them to log on separately to access each one. .PARAMETER Fta Specify file type association, which is a list of file extensions that users are allowed to open. Possible values = ON, OFF .PARAMETER Wanscaler Use the Repeater Plug-in to optimize network traffic. Possible values = ON, OFF .PARAMETER Kcdaccount Kerberos constrained delegation account name. .PARAMETER Samlssoprofile Profile to be used for doing SAML SSO to remote relying party. .PARAMETER Proxy IP address and Port of the proxy server to be used for HTTP access for this request. .PARAMETER Userexpression expression that will be evaluated to obtain username for SingleSignOn. .PARAMETER Passwdexpression expression that will be evaluated to obtain password for SingleSignOn. .PARAMETER PassThru Return details about the created vpntrafficaction item. .EXAMPLE PS C:\>Invoke-NSUpdateVpntrafficaction -name <string> An example how to update vpntrafficaction config Object(s). .NOTES File Name : Invoke-NSUpdateVpntrafficaction Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpntrafficaction/ Requires : PowerShell v5.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]$Name, [double]$Apptimeout, [ValidateSet('ON', 'OFF')] [string]$Sso, [ValidateSet('ON', 'OFF')] [string]$Hdx, [string]$Formssoaction, [ValidateSet('ON', 'OFF')] [string]$Fta, [ValidateSet('ON', 'OFF')] [string]$Wanscaler, [ValidateLength(1, 32)] [string]$Kcdaccount, [ValidateScript({ $_.Length -gt 1 })] [string]$Samlssoprofile, [ValidateScript({ $_.Length -gt 1 })] [string]$Proxy, [string]$Userexpression, [string]$Passwdexpression, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateVpntrafficaction: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('apptimeout') ) { $payload.Add('apptimeout', $apptimeout) } if ( $PSBoundParameters.ContainsKey('sso') ) { $payload.Add('sso', $sso) } if ( $PSBoundParameters.ContainsKey('hdx') ) { $payload.Add('hdx', $hdx) } if ( $PSBoundParameters.ContainsKey('formssoaction') ) { $payload.Add('formssoaction', $formssoaction) } if ( $PSBoundParameters.ContainsKey('fta') ) { $payload.Add('fta', $fta) } if ( $PSBoundParameters.ContainsKey('wanscaler') ) { $payload.Add('wanscaler', $wanscaler) } if ( $PSBoundParameters.ContainsKey('kcdaccount') ) { $payload.Add('kcdaccount', $kcdaccount) } if ( $PSBoundParameters.ContainsKey('samlssoprofile') ) { $payload.Add('samlssoprofile', $samlssoprofile) } if ( $PSBoundParameters.ContainsKey('proxy') ) { $payload.Add('proxy', $proxy) } if ( $PSBoundParameters.ContainsKey('userexpression') ) { $payload.Add('userexpression', $userexpression) } if ( $PSBoundParameters.ContainsKey('passwdexpression') ) { $payload.Add('passwdexpression', $passwdexpression) } if ( $PSCmdlet.ShouldProcess("vpntrafficaction", "Update Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpntrafficaction -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-NSGetVpntrafficaction -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateVpntrafficaction: Finished" } } function Invoke-NSUnsetVpntrafficaction { <# .SYNOPSIS Unset Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN traffic action resource. .PARAMETER Name Name for the traffic action. 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 a traffic action is created. .PARAMETER Wanscaler Use the Repeater Plug-in to optimize network traffic. Possible values = ON, OFF .PARAMETER Kcdaccount Kerberos constrained delegation account name. .PARAMETER Proxy IP address and Port of the proxy server to be used for HTTP access for this request. .PARAMETER Userexpression expression that will be evaluated to obtain username for SingleSignOn. .PARAMETER Passwdexpression expression that will be evaluated to obtain password for SingleSignOn. .EXAMPLE PS C:\>Invoke-NSUnsetVpntrafficaction -name <string> An example how to unset vpntrafficaction config Object(s). .NOTES File Name : Invoke-NSUnsetVpntrafficaction Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpntrafficaction Requires : PowerShell v5.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]$Name, [Boolean]$wanscaler, [Boolean]$kcdaccount, [Boolean]$proxy, [Boolean]$userexpression, [Boolean]$passwdexpression ) begin { Write-Verbose "Invoke-NSUnsetVpntrafficaction: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('wanscaler') ) { $payload.Add('wanscaler', $wanscaler) } if ( $PSBoundParameters.ContainsKey('kcdaccount') ) { $payload.Add('kcdaccount', $kcdaccount) } if ( $PSBoundParameters.ContainsKey('proxy') ) { $payload.Add('proxy', $proxy) } if ( $PSBoundParameters.ContainsKey('userexpression') ) { $payload.Add('userexpression', $userexpression) } if ( $PSBoundParameters.ContainsKey('passwdexpression') ) { $payload.Add('passwdexpression', $passwdexpression) } if ( $PSCmdlet.ShouldProcess("$name", "Unset Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type vpntrafficaction -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-NSUnsetVpntrafficaction: Finished" } } function Invoke-NSGetVpntrafficaction { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Configuration for VPN traffic action resource. .PARAMETER Name Name for the traffic action. 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 a traffic action is created. .PARAMETER GetAll Retrieve all vpntrafficaction object(s). .PARAMETER Count If specified, the count of the vpntrafficaction 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-NSGetVpntrafficaction Get data. .EXAMPLE PS C:\>Invoke-NSGetVpntrafficaction -GetAll Get all vpntrafficaction data. .EXAMPLE PS C:\>Invoke-NSGetVpntrafficaction -Count Get the number of vpntrafficaction objects. .EXAMPLE PS C:\>Invoke-NSGetVpntrafficaction -name <string> Get vpntrafficaction object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpntrafficaction -Filter @{ 'name'='<value>' } Get vpntrafficaction data with a filter. .NOTES File Name : Invoke-NSGetVpntrafficaction Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpntrafficaction/ Requires : PowerShell v5.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]$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-NSGetVpntrafficaction: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all vpntrafficaction objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficaction -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 vpntrafficaction objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficaction -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpntrafficaction objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficaction -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpntrafficaction configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficaction -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpntrafficaction configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficaction -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-NSGetVpntrafficaction: Ended" } } function Invoke-NSAddVpntrafficpolicy { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN traffic policy resource. .PARAMETER Name Name for the traffic policy. 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 policy is created. .PARAMETER Rule Expression, or name of a named expression, against which traffic is evaluated. The following requirements apply only to the Citrix ADC CLI: * If the expression includes one or more spaces, enclose the entire expression in double quotation marks. * If the expression itself includes double quotation marks, escape the quotations by using the \ character. * Alternatively, you can use single quotation marks to enclose the rule, in which case you do not have to escape the double quotation marks. .PARAMETER Action Action to apply to traffic that matches the policy. .PARAMETER PassThru Return details about the created vpntrafficpolicy item. .EXAMPLE PS C:\>Invoke-NSAddVpntrafficpolicy -name <string> -rule <string> -action <string> An example how to add vpntrafficpolicy config Object(s). .NOTES File Name : Invoke-NSAddVpntrafficpolicy Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpntrafficpolicy/ Requires : PowerShell v5.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]$Name, [Parameter(Mandatory)] [string]$Rule, [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Action, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpntrafficpolicy: Starting" } process { try { $payload = @{ name = $name rule = $rule action = $action } if ( $PSCmdlet.ShouldProcess("vpntrafficpolicy", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type vpntrafficpolicy -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-NSGetVpntrafficpolicy -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpntrafficpolicy: Finished" } } function Invoke-NSDeleteVpntrafficpolicy { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN traffic policy resource. .PARAMETER Name Name for the traffic policy. 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 policy is created. .EXAMPLE PS C:\>Invoke-NSDeleteVpntrafficpolicy -Name <string> An example how to delete vpntrafficpolicy config Object(s). .NOTES File Name : Invoke-NSDeleteVpntrafficpolicy Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpntrafficpolicy/ Requires : PowerShell v5.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-NSDeleteVpntrafficpolicy: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpntrafficpolicy -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-NSDeleteVpntrafficpolicy: Finished" } } function Invoke-NSUpdateVpntrafficpolicy { <# .SYNOPSIS Update Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN traffic policy resource. .PARAMETER Name Name for the traffic policy. 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 policy is created. .PARAMETER Rule Expression, or name of a named expression, against which traffic is evaluated. The following requirements apply only to the Citrix ADC CLI: * If the expression includes one or more spaces, enclose the entire expression in double quotation marks. * If the expression itself includes double quotation marks, escape the quotations by using the \ character. * Alternatively, you can use single quotation marks to enclose the rule, in which case you do not have to escape the double quotation marks. .PARAMETER Action Action to apply to traffic that matches the policy. .PARAMETER PassThru Return details about the created vpntrafficpolicy item. .EXAMPLE PS C:\>Invoke-NSUpdateVpntrafficpolicy -name <string> An example how to update vpntrafficpolicy config Object(s). .NOTES File Name : Invoke-NSUpdateVpntrafficpolicy Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpntrafficpolicy/ Requires : PowerShell v5.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]$Name, [string]$Rule, [ValidateScript({ $_.Length -gt 1 })] [string]$Action, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateVpntrafficpolicy: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('rule') ) { $payload.Add('rule', $rule) } if ( $PSBoundParameters.ContainsKey('action') ) { $payload.Add('action', $action) } if ( $PSCmdlet.ShouldProcess("vpntrafficpolicy", "Update Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpntrafficpolicy -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-NSGetVpntrafficpolicy -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateVpntrafficpolicy: Finished" } } function Invoke-NSUnsetVpntrafficpolicy { <# .SYNOPSIS Unset Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN traffic policy resource. .PARAMETER Name Name for the traffic policy. 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 policy is created. .PARAMETER Rule Expression, or name of a named expression, against which traffic is evaluated. The following requirements apply only to the Citrix ADC CLI: * If the expression includes one or more spaces, enclose the entire expression in double quotation marks. * If the expression itself includes double quotation marks, escape the quotations by using the \ character. * Alternatively, you can use single quotation marks to enclose the rule, in which case you do not have to escape the double quotation marks. .PARAMETER Action Action to apply to traffic that matches the policy. .EXAMPLE PS C:\>Invoke-NSUnsetVpntrafficpolicy -name <string> An example how to unset vpntrafficpolicy config Object(s). .NOTES File Name : Invoke-NSUnsetVpntrafficpolicy Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpntrafficpolicy Requires : PowerShell v5.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]$Name, [Boolean]$rule, [Boolean]$action ) begin { Write-Verbose "Invoke-NSUnsetVpntrafficpolicy: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('rule') ) { $payload.Add('rule', $rule) } if ( $PSBoundParameters.ContainsKey('action') ) { $payload.Add('action', $action) } if ( $PSCmdlet.ShouldProcess("$name", "Unset Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type vpntrafficpolicy -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-NSUnsetVpntrafficpolicy: Finished" } } function Invoke-NSGetVpntrafficpolicy { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Configuration for VPN traffic policy resource. .PARAMETER Name Name for the traffic policy. 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 policy is created. .PARAMETER GetAll Retrieve all vpntrafficpolicy object(s). .PARAMETER Count If specified, the count of the vpntrafficpolicy 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-NSGetVpntrafficpolicy Get data. .EXAMPLE PS C:\>Invoke-NSGetVpntrafficpolicy -GetAll Get all vpntrafficpolicy data. .EXAMPLE PS C:\>Invoke-NSGetVpntrafficpolicy -Count Get the number of vpntrafficpolicy objects. .EXAMPLE PS C:\>Invoke-NSGetVpntrafficpolicy -name <string> Get vpntrafficpolicy object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpntrafficpolicy -Filter @{ 'name'='<value>' } Get vpntrafficpolicy data with a filter. .NOTES File Name : Invoke-NSGetVpntrafficpolicy Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpntrafficpolicy/ Requires : PowerShell v5.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]$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-NSGetVpntrafficpolicy: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all vpntrafficpolicy objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy -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 vpntrafficpolicy objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpntrafficpolicy objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpntrafficpolicy configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpntrafficpolicy configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy -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-NSGetVpntrafficpolicy: Ended" } } function Invoke-NSGetVpntrafficpolicyAaagroupBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the aaagroup that can be bound to vpntrafficpolicy. .PARAMETER Name Name of the traffic policy for which to display detailed information. .PARAMETER GetAll Retrieve all vpntrafficpolicy_aaagroup_binding object(s). .PARAMETER Count If specified, the count of the vpntrafficpolicy_aaagroup_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-NSGetVpntrafficpolicyAaagroupBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpntrafficpolicyAaagroupBinding -GetAll Get all vpntrafficpolicy_aaagroup_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpntrafficpolicyAaagroupBinding -Count Get the number of vpntrafficpolicy_aaagroup_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpntrafficpolicyAaagroupBinding -name <string> Get vpntrafficpolicy_aaagroup_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpntrafficpolicyAaagroupBinding -Filter @{ 'name'='<value>' } Get vpntrafficpolicy_aaagroup_binding data with a filter. .NOTES File Name : Invoke-NSGetVpntrafficpolicyAaagroupBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpntrafficpolicy_aaagroup_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-NSGetVpntrafficpolicyAaagroupBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpntrafficpolicy_aaagroup_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy_aaagroup_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 vpntrafficpolicy_aaagroup_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy_aaagroup_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpntrafficpolicy_aaagroup_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy_aaagroup_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpntrafficpolicy_aaagroup_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy_aaagroup_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpntrafficpolicy_aaagroup_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy_aaagroup_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-NSGetVpntrafficpolicyAaagroupBinding: Ended" } } function Invoke-NSGetVpntrafficpolicyAaauserBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the aaauser that can be bound to vpntrafficpolicy. .PARAMETER Name Name of the traffic policy for which to display detailed information. .PARAMETER GetAll Retrieve all vpntrafficpolicy_aaauser_binding object(s). .PARAMETER Count If specified, the count of the vpntrafficpolicy_aaauser_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-NSGetVpntrafficpolicyAaauserBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpntrafficpolicyAaauserBinding -GetAll Get all vpntrafficpolicy_aaauser_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpntrafficpolicyAaauserBinding -Count Get the number of vpntrafficpolicy_aaauser_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpntrafficpolicyAaauserBinding -name <string> Get vpntrafficpolicy_aaauser_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpntrafficpolicyAaauserBinding -Filter @{ 'name'='<value>' } Get vpntrafficpolicy_aaauser_binding data with a filter. .NOTES File Name : Invoke-NSGetVpntrafficpolicyAaauserBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpntrafficpolicy_aaauser_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-NSGetVpntrafficpolicyAaauserBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpntrafficpolicy_aaauser_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy_aaauser_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 vpntrafficpolicy_aaauser_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy_aaauser_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpntrafficpolicy_aaauser_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy_aaauser_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpntrafficpolicy_aaauser_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy_aaauser_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpntrafficpolicy_aaauser_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy_aaauser_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-NSGetVpntrafficpolicyAaauserBinding: Ended" } } function Invoke-NSGetVpntrafficpolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object which returns the resources bound to vpntrafficpolicy. .PARAMETER Name Name of the traffic policy for which to display detailed information. .PARAMETER GetAll Retrieve all vpntrafficpolicy_binding object(s). .PARAMETER Count If specified, the count of the vpntrafficpolicy_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-NSGetVpntrafficpolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpntrafficpolicyBinding -GetAll Get all vpntrafficpolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpntrafficpolicyBinding -name <string> Get vpntrafficpolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpntrafficpolicyBinding -Filter @{ 'name'='<value>' } Get vpntrafficpolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpntrafficpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpntrafficpolicy_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-NSGetVpntrafficpolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpntrafficpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy_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 vpntrafficpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpntrafficpolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpntrafficpolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpntrafficpolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy_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-NSGetVpntrafficpolicyBinding: Ended" } } function Invoke-NSGetVpntrafficpolicyVpnglobalBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the vpnglobal that can be bound to vpntrafficpolicy. .PARAMETER Name Name of the traffic policy for which to display detailed information. .PARAMETER GetAll Retrieve all vpntrafficpolicy_vpnglobal_binding object(s). .PARAMETER Count If specified, the count of the vpntrafficpolicy_vpnglobal_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-NSGetVpntrafficpolicyVpnglobalBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpntrafficpolicyVpnglobalBinding -GetAll Get all vpntrafficpolicy_vpnglobal_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpntrafficpolicyVpnglobalBinding -Count Get the number of vpntrafficpolicy_vpnglobal_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpntrafficpolicyVpnglobalBinding -name <string> Get vpntrafficpolicy_vpnglobal_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpntrafficpolicyVpnglobalBinding -Filter @{ 'name'='<value>' } Get vpntrafficpolicy_vpnglobal_binding data with a filter. .NOTES File Name : Invoke-NSGetVpntrafficpolicyVpnglobalBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpntrafficpolicy_vpnglobal_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-NSGetVpntrafficpolicyVpnglobalBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpntrafficpolicy_vpnglobal_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy_vpnglobal_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 vpntrafficpolicy_vpnglobal_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy_vpnglobal_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpntrafficpolicy_vpnglobal_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy_vpnglobal_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpntrafficpolicy_vpnglobal_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy_vpnglobal_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpntrafficpolicy_vpnglobal_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy_vpnglobal_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-NSGetVpntrafficpolicyVpnglobalBinding: Ended" } } function Invoke-NSGetVpntrafficpolicyVpnvserverBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the vpnvserver that can be bound to vpntrafficpolicy. .PARAMETER Name Name of the traffic policy for which to display detailed information. .PARAMETER GetAll Retrieve all vpntrafficpolicy_vpnvserver_binding object(s). .PARAMETER Count If specified, the count of the vpntrafficpolicy_vpnvserver_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-NSGetVpntrafficpolicyVpnvserverBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpntrafficpolicyVpnvserverBinding -GetAll Get all vpntrafficpolicy_vpnvserver_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpntrafficpolicyVpnvserverBinding -Count Get the number of vpntrafficpolicy_vpnvserver_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpntrafficpolicyVpnvserverBinding -name <string> Get vpntrafficpolicy_vpnvserver_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpntrafficpolicyVpnvserverBinding -Filter @{ 'name'='<value>' } Get vpntrafficpolicy_vpnvserver_binding data with a filter. .NOTES File Name : Invoke-NSGetVpntrafficpolicyVpnvserverBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpntrafficpolicy_vpnvserver_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-NSGetVpntrafficpolicyVpnvserverBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpntrafficpolicy_vpnvserver_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy_vpnvserver_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 vpntrafficpolicy_vpnvserver_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy_vpnvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpntrafficpolicy_vpnvserver_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy_vpnvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpntrafficpolicy_vpnvserver_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy_vpnvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpntrafficpolicy_vpnvserver_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpntrafficpolicy_vpnvserver_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-NSGetVpntrafficpolicyVpnvserverBinding: Ended" } } function Invoke-NSAddVpnurl { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN URL resource. .PARAMETER Urlname Name of the bookmark link. .PARAMETER Linkname Description of the bookmark link. The description appears in the Access Interface. .PARAMETER Actualurl Web address for the bookmark link. .PARAMETER Vservername Name of the associated LB/CS vserver. .PARAMETER Clientlessaccess If clientless access to the resource hosting the link is allowed, also use clientless access for the bookmarked web address in the Secure Client Access based session. Allows single sign-on and other HTTP processing on Citrix Gateway for HTTPS resources. Possible values = ON, OFF .PARAMETER Comment Any comments associated with the bookmark link. .PARAMETER Iconurl URL to fetch icon file for displaying this resource. .PARAMETER Ssotype Single sign on type for unified gateway. Possible values = unifiedgateway, selfauth, samlauth .PARAMETER Applicationtype The type of application this VPN URL represents. Possible values are CVPN/SaaS/VPN. Possible values = CVPN, VPN, SaaS .PARAMETER Samlssoprofile Profile to be used for doing SAML SSO. .PARAMETER Appjson To store the template details in the json format. .PARAMETER PassThru Return details about the created vpnurl item. .EXAMPLE PS C:\>Invoke-NSAddVpnurl -urlname <string> -linkname <string> -actualurl <string> An example how to add vpnurl config Object(s). .NOTES File Name : Invoke-NSAddVpnurl Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnurl/ Requires : PowerShell v5.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]$Urlname, [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Linkname, [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Actualurl, [string]$Vservername, [ValidateSet('ON', 'OFF')] [string]$Clientlessaccess = 'OFF', [string]$Comment, [string]$Iconurl, [ValidateSet('unifiedgateway', 'selfauth', 'samlauth')] [string]$Ssotype, [ValidateSet('CVPN', 'VPN', 'SaaS')] [string]$Applicationtype, [string]$Samlssoprofile, [string]$Appjson, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnurl: Starting" } process { try { $payload = @{ urlname = $urlname linkname = $linkname actualurl = $actualurl } if ( $PSBoundParameters.ContainsKey('vservername') ) { $payload.Add('vservername', $vservername) } if ( $PSBoundParameters.ContainsKey('clientlessaccess') ) { $payload.Add('clientlessaccess', $clientlessaccess) } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSBoundParameters.ContainsKey('iconurl') ) { $payload.Add('iconurl', $iconurl) } if ( $PSBoundParameters.ContainsKey('ssotype') ) { $payload.Add('ssotype', $ssotype) } if ( $PSBoundParameters.ContainsKey('applicationtype') ) { $payload.Add('applicationtype', $applicationtype) } if ( $PSBoundParameters.ContainsKey('samlssoprofile') ) { $payload.Add('samlssoprofile', $samlssoprofile) } if ( $PSBoundParameters.ContainsKey('appjson') ) { $payload.Add('appjson', $appjson) } if ( $PSCmdlet.ShouldProcess("vpnurl", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type vpnurl -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-NSGetVpnurl -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnurl: Finished" } } function Invoke-NSDeleteVpnurl { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN URL resource. .PARAMETER Urlname Name of the bookmark link. .EXAMPLE PS C:\>Invoke-NSDeleteVpnurl -Urlname <string> An example how to delete vpnurl config Object(s). .NOTES File Name : Invoke-NSDeleteVpnurl Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnurl/ Requires : PowerShell v5.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]$Urlname ) begin { Write-Verbose "Invoke-NSDeleteVpnurl: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$urlname", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnurl -NitroPath nitro/v1/config -Resource $urlname -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-NSDeleteVpnurl: Finished" } } function Invoke-NSUpdateVpnurl { <# .SYNOPSIS Update Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN URL resource. .PARAMETER Urlname Name of the bookmark link. .PARAMETER Linkname Description of the bookmark link. The description appears in the Access Interface. .PARAMETER Actualurl Web address for the bookmark link. .PARAMETER Vservername Name of the associated LB/CS vserver. .PARAMETER Clientlessaccess If clientless access to the resource hosting the link is allowed, also use clientless access for the bookmarked web address in the Secure Client Access based session. Allows single sign-on and other HTTP processing on Citrix Gateway for HTTPS resources. Possible values = ON, OFF .PARAMETER Comment Any comments associated with the bookmark link. .PARAMETER Iconurl URL to fetch icon file for displaying this resource. .PARAMETER Ssotype Single sign on type for unified gateway. Possible values = unifiedgateway, selfauth, samlauth .PARAMETER Applicationtype The type of application this VPN URL represents. Possible values are CVPN/SaaS/VPN. Possible values = CVPN, VPN, SaaS .PARAMETER Samlssoprofile Profile to be used for doing SAML SSO. .PARAMETER Appjson To store the template details in the json format. .PARAMETER PassThru Return details about the created vpnurl item. .EXAMPLE PS C:\>Invoke-NSUpdateVpnurl -urlname <string> An example how to update vpnurl config Object(s). .NOTES File Name : Invoke-NSUpdateVpnurl Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnurl/ Requires : PowerShell v5.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]$Urlname, [ValidateScript({ $_.Length -gt 1 })] [string]$Linkname, [ValidateScript({ $_.Length -gt 1 })] [string]$Actualurl, [string]$Vservername, [ValidateSet('ON', 'OFF')] [string]$Clientlessaccess, [string]$Comment, [string]$Iconurl, [ValidateSet('unifiedgateway', 'selfauth', 'samlauth')] [string]$Ssotype, [ValidateSet('CVPN', 'VPN', 'SaaS')] [string]$Applicationtype, [string]$Samlssoprofile, [string]$Appjson, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateVpnurl: Starting" } process { try { $payload = @{ urlname = $urlname } if ( $PSBoundParameters.ContainsKey('linkname') ) { $payload.Add('linkname', $linkname) } if ( $PSBoundParameters.ContainsKey('actualurl') ) { $payload.Add('actualurl', $actualurl) } if ( $PSBoundParameters.ContainsKey('vservername') ) { $payload.Add('vservername', $vservername) } if ( $PSBoundParameters.ContainsKey('clientlessaccess') ) { $payload.Add('clientlessaccess', $clientlessaccess) } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSBoundParameters.ContainsKey('iconurl') ) { $payload.Add('iconurl', $iconurl) } if ( $PSBoundParameters.ContainsKey('ssotype') ) { $payload.Add('ssotype', $ssotype) } if ( $PSBoundParameters.ContainsKey('applicationtype') ) { $payload.Add('applicationtype', $applicationtype) } if ( $PSBoundParameters.ContainsKey('samlssoprofile') ) { $payload.Add('samlssoprofile', $samlssoprofile) } if ( $PSBoundParameters.ContainsKey('appjson') ) { $payload.Add('appjson', $appjson) } if ( $PSCmdlet.ShouldProcess("vpnurl", "Update Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnurl -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-NSGetVpnurl -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateVpnurl: Finished" } } function Invoke-NSUnsetVpnurl { <# .SYNOPSIS Unset Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN URL resource. .PARAMETER Urlname Name of the bookmark link. .PARAMETER Vservername Name of the associated LB/CS vserver. .PARAMETER Clientlessaccess If clientless access to the resource hosting the link is allowed, also use clientless access for the bookmarked web address in the Secure Client Access based session. Allows single sign-on and other HTTP processing on Citrix Gateway for HTTPS resources. Possible values = ON, OFF .PARAMETER Comment Any comments associated with the bookmark link. .PARAMETER Iconurl URL to fetch icon file for displaying this resource. .PARAMETER Ssotype Single sign on type for unified gateway. Possible values = unifiedgateway, selfauth, samlauth .PARAMETER Applicationtype The type of application this VPN URL represents. Possible values are CVPN/SaaS/VPN. Possible values = CVPN, VPN, SaaS .PARAMETER Samlssoprofile Profile to be used for doing SAML SSO. .PARAMETER Appjson To store the template details in the json format. .EXAMPLE PS C:\>Invoke-NSUnsetVpnurl -urlname <string> An example how to unset vpnurl config Object(s). .NOTES File Name : Invoke-NSUnsetVpnurl Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnurl Requires : PowerShell v5.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]$Urlname, [Boolean]$vservername, [Boolean]$clientlessaccess, [Boolean]$comment, [Boolean]$iconurl, [Boolean]$ssotype, [Boolean]$applicationtype, [Boolean]$samlssoprofile, [Boolean]$appjson ) begin { Write-Verbose "Invoke-NSUnsetVpnurl: Starting" } process { try { $payload = @{ urlname = $urlname } if ( $PSBoundParameters.ContainsKey('vservername') ) { $payload.Add('vservername', $vservername) } if ( $PSBoundParameters.ContainsKey('clientlessaccess') ) { $payload.Add('clientlessaccess', $clientlessaccess) } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSBoundParameters.ContainsKey('iconurl') ) { $payload.Add('iconurl', $iconurl) } if ( $PSBoundParameters.ContainsKey('ssotype') ) { $payload.Add('ssotype', $ssotype) } if ( $PSBoundParameters.ContainsKey('applicationtype') ) { $payload.Add('applicationtype', $applicationtype) } if ( $PSBoundParameters.ContainsKey('samlssoprofile') ) { $payload.Add('samlssoprofile', $samlssoprofile) } if ( $PSBoundParameters.ContainsKey('appjson') ) { $payload.Add('appjson', $appjson) } if ( $PSCmdlet.ShouldProcess("$urlname", "Unset Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type vpnurl -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-NSUnsetVpnurl: Finished" } } function Invoke-NSGetVpnurl { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Configuration for VPN URL resource. .PARAMETER Urlname Name of the bookmark link. .PARAMETER GetAll Retrieve all vpnurl object(s). .PARAMETER Count If specified, the count of the vpnurl 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-NSGetVpnurl Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnurl -GetAll Get all vpnurl data. .EXAMPLE PS C:\>Invoke-NSGetVpnurl -Count Get the number of vpnurl objects. .EXAMPLE PS C:\>Invoke-NSGetVpnurl -name <string> Get vpnurl object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnurl -Filter @{ 'name'='<value>' } Get vpnurl data with a filter. .NOTES File Name : Invoke-NSGetVpnurl Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnurl/ Requires : PowerShell v5.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]$Urlname, [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-NSGetVpnurl: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all vpnurl objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurl -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 vpnurl objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurl -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnurl objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurl -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnurl configuration for property 'urlname'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurl -NitroPath nitro/v1/config -Resource $urlname -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnurl configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurl -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-NSGetVpnurl: Ended" } } function Invoke-NSAddVpnurlaction { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN url action resource. .PARAMETER Name Name of the bookmark link. .PARAMETER Linkname Description of the bookmark link. The description appears in the Access Interface. .PARAMETER Actualurl Web address for the bookmark link. .PARAMETER Vservername Name of the associated vserver to handle selfAuth SSO. .PARAMETER Clientlessaccess If clientless access to the resource hosting the link is allowed, also use clientless access for the bookmarked web address in the Secure Client Access based session. Allows single sign-on and other HTTP processing on NetScaler Gateway for HTTPS resources. Possible values = ON, OFF .PARAMETER Comment Any comments associated with the bookmark link. .PARAMETER Iconurl URL to fetch icon file for displaying this resource. .PARAMETER Ssotype Single sign on type for unified gateway. Possible values = unifiedgateway, selfauth, samlauth .PARAMETER Applicationtype The type of application this VPN URL represents. Possible values are CVPN/SaaS/VPN. Possible values = CVPN, VPN, SaaS .PARAMETER Samlssoprofile Profile to be used for doing SAML SSO. .PARAMETER PassThru Return details about the created vpnurlaction item. .EXAMPLE PS C:\>Invoke-NSAddVpnurlaction -name <string> -linkname <string> -actualurl <string> An example how to add vpnurlaction config Object(s). .NOTES File Name : Invoke-NSAddVpnurlaction Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnurlaction/ Requires : PowerShell v5.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]$Linkname, [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Actualurl, [string]$Vservername, [ValidateSet('ON', 'OFF')] [string]$Clientlessaccess = 'OFF', [string]$Comment, [string]$Iconurl, [ValidateSet('unifiedgateway', 'selfauth', 'samlauth')] [string]$Ssotype, [ValidateSet('CVPN', 'VPN', 'SaaS')] [string]$Applicationtype, [string]$Samlssoprofile, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnurlaction: Starting" } process { try { $payload = @{ name = $name linkname = $linkname actualurl = $actualurl } if ( $PSBoundParameters.ContainsKey('vservername') ) { $payload.Add('vservername', $vservername) } if ( $PSBoundParameters.ContainsKey('clientlessaccess') ) { $payload.Add('clientlessaccess', $clientlessaccess) } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSBoundParameters.ContainsKey('iconurl') ) { $payload.Add('iconurl', $iconurl) } if ( $PSBoundParameters.ContainsKey('ssotype') ) { $payload.Add('ssotype', $ssotype) } if ( $PSBoundParameters.ContainsKey('applicationtype') ) { $payload.Add('applicationtype', $applicationtype) } if ( $PSBoundParameters.ContainsKey('samlssoprofile') ) { $payload.Add('samlssoprofile', $samlssoprofile) } if ( $PSCmdlet.ShouldProcess("vpnurlaction", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type vpnurlaction -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-NSGetVpnurlaction -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnurlaction: Finished" } } function Invoke-NSDeleteVpnurlaction { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN url action resource. .PARAMETER Name Name of the bookmark link. .EXAMPLE PS C:\>Invoke-NSDeleteVpnurlaction -Name <string> An example how to delete vpnurlaction config Object(s). .NOTES File Name : Invoke-NSDeleteVpnurlaction Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnurlaction/ Requires : PowerShell v5.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-NSDeleteVpnurlaction: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnurlaction -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-NSDeleteVpnurlaction: Finished" } } function Invoke-NSUpdateVpnurlaction { <# .SYNOPSIS Update Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN url action resource. .PARAMETER Name Name of the bookmark link. .PARAMETER Linkname Description of the bookmark link. The description appears in the Access Interface. .PARAMETER Actualurl Web address for the bookmark link. .PARAMETER Vservername Name of the associated vserver to handle selfAuth SSO. .PARAMETER Clientlessaccess If clientless access to the resource hosting the link is allowed, also use clientless access for the bookmarked web address in the Secure Client Access based session. Allows single sign-on and other HTTP processing on NetScaler Gateway for HTTPS resources. Possible values = ON, OFF .PARAMETER Comment Any comments associated with the bookmark link. .PARAMETER Iconurl URL to fetch icon file for displaying this resource. .PARAMETER Ssotype Single sign on type for unified gateway. Possible values = unifiedgateway, selfauth, samlauth .PARAMETER Applicationtype The type of application this VPN URL represents. Possible values are CVPN/SaaS/VPN. Possible values = CVPN, VPN, SaaS .PARAMETER Samlssoprofile Profile to be used for doing SAML SSO. .PARAMETER PassThru Return details about the created vpnurlaction item. .EXAMPLE PS C:\>Invoke-NSUpdateVpnurlaction -name <string> An example how to update vpnurlaction config Object(s). .NOTES File Name : Invoke-NSUpdateVpnurlaction Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnurlaction/ Requires : PowerShell v5.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]$Linkname, [ValidateScript({ $_.Length -gt 1 })] [string]$Actualurl, [string]$Vservername, [ValidateSet('ON', 'OFF')] [string]$Clientlessaccess, [string]$Comment, [string]$Iconurl, [ValidateSet('unifiedgateway', 'selfauth', 'samlauth')] [string]$Ssotype, [ValidateSet('CVPN', 'VPN', 'SaaS')] [string]$Applicationtype, [string]$Samlssoprofile, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateVpnurlaction: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('linkname') ) { $payload.Add('linkname', $linkname) } if ( $PSBoundParameters.ContainsKey('actualurl') ) { $payload.Add('actualurl', $actualurl) } if ( $PSBoundParameters.ContainsKey('vservername') ) { $payload.Add('vservername', $vservername) } if ( $PSBoundParameters.ContainsKey('clientlessaccess') ) { $payload.Add('clientlessaccess', $clientlessaccess) } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSBoundParameters.ContainsKey('iconurl') ) { $payload.Add('iconurl', $iconurl) } if ( $PSBoundParameters.ContainsKey('ssotype') ) { $payload.Add('ssotype', $ssotype) } if ( $PSBoundParameters.ContainsKey('applicationtype') ) { $payload.Add('applicationtype', $applicationtype) } if ( $PSBoundParameters.ContainsKey('samlssoprofile') ) { $payload.Add('samlssoprofile', $samlssoprofile) } if ( $PSCmdlet.ShouldProcess("vpnurlaction", "Update Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnurlaction -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-NSGetVpnurlaction -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateVpnurlaction: Finished" } } function Invoke-NSUnsetVpnurlaction { <# .SYNOPSIS Unset Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN url action resource. .PARAMETER Name Name of the bookmark link. .PARAMETER Vservername Name of the associated vserver to handle selfAuth SSO. .PARAMETER Clientlessaccess If clientless access to the resource hosting the link is allowed, also use clientless access for the bookmarked web address in the Secure Client Access based session. Allows single sign-on and other HTTP processing on NetScaler Gateway for HTTPS resources. Possible values = ON, OFF .PARAMETER Comment Any comments associated with the bookmark link. .PARAMETER Iconurl URL to fetch icon file for displaying this resource. .PARAMETER Ssotype Single sign on type for unified gateway. Possible values = unifiedgateway, selfauth, samlauth .PARAMETER Applicationtype The type of application this VPN URL represents. Possible values are CVPN/SaaS/VPN. Possible values = CVPN, VPN, SaaS .PARAMETER Samlssoprofile Profile to be used for doing SAML SSO. .EXAMPLE PS C:\>Invoke-NSUnsetVpnurlaction -name <string> An example how to unset vpnurlaction config Object(s). .NOTES File Name : Invoke-NSUnsetVpnurlaction Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnurlaction Requires : PowerShell v5.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]$vservername, [Boolean]$clientlessaccess, [Boolean]$comment, [Boolean]$iconurl, [Boolean]$ssotype, [Boolean]$applicationtype, [Boolean]$samlssoprofile ) begin { Write-Verbose "Invoke-NSUnsetVpnurlaction: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('vservername') ) { $payload.Add('vservername', $vservername) } if ( $PSBoundParameters.ContainsKey('clientlessaccess') ) { $payload.Add('clientlessaccess', $clientlessaccess) } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSBoundParameters.ContainsKey('iconurl') ) { $payload.Add('iconurl', $iconurl) } if ( $PSBoundParameters.ContainsKey('ssotype') ) { $payload.Add('ssotype', $ssotype) } if ( $PSBoundParameters.ContainsKey('applicationtype') ) { $payload.Add('applicationtype', $applicationtype) } if ( $PSBoundParameters.ContainsKey('samlssoprofile') ) { $payload.Add('samlssoprofile', $samlssoprofile) } if ( $PSCmdlet.ShouldProcess("$name", "Unset Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type vpnurlaction -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-NSUnsetVpnurlaction: Finished" } } function Invoke-NSRenameVpnurlaction { <# .SYNOPSIS Rename Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN url action resource. .PARAMETER Name Name of the bookmark link. .PARAMETER Newname New name for the vpn urlAction. 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. The following requirement applies only to the NetScaler CLI: If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, "my vpnurl action" or 'my vpnurl action'). .PARAMETER PassThru Return details about the created vpnurlaction item. .EXAMPLE PS C:\>Invoke-NSRenameVpnurlaction -name <string> -newname <string> An example how to rename vpnurlaction config Object(s). .NOTES File Name : Invoke-NSRenameVpnurlaction Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnurlaction/ Requires : PowerShell v5.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-NSRenameVpnurlaction: Starting" } process { try { $payload = @{ name = $name newname = $newname } if ( $PSCmdlet.ShouldProcess("vpnurlaction", "Rename Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type vpnurlaction -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-NSGetVpnurlaction -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSRenameVpnurlaction: Finished" } } function Invoke-NSGetVpnurlaction { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Configuration for VPN url action resource. .PARAMETER Name Name of the bookmark link. .PARAMETER GetAll Retrieve all vpnurlaction object(s). .PARAMETER Count If specified, the count of the vpnurlaction 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-NSGetVpnurlaction Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnurlaction -GetAll Get all vpnurlaction data. .EXAMPLE PS C:\>Invoke-NSGetVpnurlaction -Count Get the number of vpnurlaction objects. .EXAMPLE PS C:\>Invoke-NSGetVpnurlaction -name <string> Get vpnurlaction object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnurlaction -Filter @{ 'name'='<value>' } Get vpnurlaction data with a filter. .NOTES File Name : Invoke-NSGetVpnurlaction Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnurlaction/ Requires : PowerShell v5.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-NSGetVpnurlaction: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all vpnurlaction objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlaction -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 vpnurlaction objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlaction -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnurlaction objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlaction -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnurlaction configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlaction -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnurlaction configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlaction -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-NSGetVpnurlaction: Ended" } } function Invoke-NSAddVpnurlpolicy { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN url policy resource. .PARAMETER Name Name for the new urlPolicy. .PARAMETER Rule Expression, or name of a named expression, specifying the traffic that matches the policy. The following requirements apply only to the NetScaler CLI: * If the expression includes one or more spaces, enclose the entire expression in double quotation marks. * If the expression itself includes double quotation marks, escape the quotations by using the \ character. * Alternatively, you can use single quotation marks to enclose the rule, in which case you do not have to escape the double quotation marks. .PARAMETER Action Action to be applied by the new urlPolicy if the rule criteria are met. .PARAMETER Comment Any comments to preserve information about this policy. .PARAMETER Logaction Name of messagelog action to use when a request matches this policy. .PARAMETER PassThru Return details about the created vpnurlpolicy item. .EXAMPLE PS C:\>Invoke-NSAddVpnurlpolicy -name <string> -rule <string> -action <string> An example how to add vpnurlpolicy config Object(s). .NOTES File Name : Invoke-NSAddVpnurlpolicy Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnurlpolicy/ Requires : PowerShell v5.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]$Rule, [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [string]$Action, [string]$Comment, [string]$Logaction, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnurlpolicy: Starting" } process { try { $payload = @{ name = $name rule = $rule action = $action } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSBoundParameters.ContainsKey('logaction') ) { $payload.Add('logaction', $logaction) } if ( $PSCmdlet.ShouldProcess("vpnurlpolicy", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type vpnurlpolicy -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-NSGetVpnurlpolicy -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnurlpolicy: Finished" } } function Invoke-NSDeleteVpnurlpolicy { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN url policy resource. .PARAMETER Name Name for the new urlPolicy. .EXAMPLE PS C:\>Invoke-NSDeleteVpnurlpolicy -Name <string> An example how to delete vpnurlpolicy config Object(s). .NOTES File Name : Invoke-NSDeleteVpnurlpolicy Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnurlpolicy/ Requires : PowerShell v5.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-NSDeleteVpnurlpolicy: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnurlpolicy -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-NSDeleteVpnurlpolicy: Finished" } } function Invoke-NSUpdateVpnurlpolicy { <# .SYNOPSIS Update Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN url policy resource. .PARAMETER Name Name for the new urlPolicy. .PARAMETER Rule Expression, or name of a named expression, specifying the traffic that matches the policy. The following requirements apply only to the NetScaler CLI: * If the expression includes one or more spaces, enclose the entire expression in double quotation marks. * If the expression itself includes double quotation marks, escape the quotations by using the \ character. * Alternatively, you can use single quotation marks to enclose the rule, in which case you do not have to escape the double quotation marks. .PARAMETER Action Action to be applied by the new urlPolicy if the rule criteria are met. .PARAMETER Comment Any comments to preserve information about this policy. .PARAMETER Logaction Name of messagelog action to use when a request matches this policy. .PARAMETER PassThru Return details about the created vpnurlpolicy item. .EXAMPLE PS C:\>Invoke-NSUpdateVpnurlpolicy -name <string> An example how to update vpnurlpolicy config Object(s). .NOTES File Name : Invoke-NSUpdateVpnurlpolicy Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnurlpolicy/ Requires : PowerShell v5.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, [string]$Rule, [ValidateScript({ $_.Length -gt 1 })] [string]$Action, [string]$Comment, [string]$Logaction, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateVpnurlpolicy: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('rule') ) { $payload.Add('rule', $rule) } if ( $PSBoundParameters.ContainsKey('action') ) { $payload.Add('action', $action) } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSBoundParameters.ContainsKey('logaction') ) { $payload.Add('logaction', $logaction) } if ( $PSCmdlet.ShouldProcess("vpnurlpolicy", "Update Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnurlpolicy -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-NSGetVpnurlpolicy -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateVpnurlpolicy: Finished" } } function Invoke-NSUnsetVpnurlpolicy { <# .SYNOPSIS Unset Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN url policy resource. .PARAMETER Name Name for the new urlPolicy. .PARAMETER Comment Any comments to preserve information about this policy. .PARAMETER Logaction Name of messagelog action to use when a request matches this policy. .EXAMPLE PS C:\>Invoke-NSUnsetVpnurlpolicy -name <string> An example how to unset vpnurlpolicy config Object(s). .NOTES File Name : Invoke-NSUnsetVpnurlpolicy Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnurlpolicy Requires : PowerShell v5.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, [Boolean]$logaction ) begin { Write-Verbose "Invoke-NSUnsetVpnurlpolicy: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSBoundParameters.ContainsKey('logaction') ) { $payload.Add('logaction', $logaction) } if ( $PSCmdlet.ShouldProcess("$name", "Unset Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type vpnurlpolicy -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-NSUnsetVpnurlpolicy: Finished" } } function Invoke-NSRenameVpnurlpolicy { <# .SYNOPSIS Rename Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN url policy resource. .PARAMETER Name Name for the new urlPolicy. .PARAMETER Newname New name for the vpn urlPolicy. 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. The following requirement applies only to the NetScaler CLI: If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, "my vpnurl policy" or 'my vpnurl policy'). .PARAMETER PassThru Return details about the created vpnurlpolicy item. .EXAMPLE PS C:\>Invoke-NSRenameVpnurlpolicy -name <string> -newname <string> An example how to rename vpnurlpolicy config Object(s). .NOTES File Name : Invoke-NSRenameVpnurlpolicy Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnurlpolicy/ Requires : PowerShell v5.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-NSRenameVpnurlpolicy: Starting" } process { try { $payload = @{ name = $name newname = $newname } if ( $PSCmdlet.ShouldProcess("vpnurlpolicy", "Rename Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type vpnurlpolicy -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-NSGetVpnurlpolicy -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSRenameVpnurlpolicy: Finished" } } function Invoke-NSGetVpnurlpolicy { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Configuration for VPN url policy resource. .PARAMETER Name Name for the new urlPolicy. .PARAMETER GetAll Retrieve all vpnurlpolicy object(s). .PARAMETER Count If specified, the count of the vpnurlpolicy 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-NSGetVpnurlpolicy Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnurlpolicy -GetAll Get all vpnurlpolicy data. .EXAMPLE PS C:\>Invoke-NSGetVpnurlpolicy -Count Get the number of vpnurlpolicy objects. .EXAMPLE PS C:\>Invoke-NSGetVpnurlpolicy -name <string> Get vpnurlpolicy object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnurlpolicy -Filter @{ 'name'='<value>' } Get vpnurlpolicy data with a filter. .NOTES File Name : Invoke-NSGetVpnurlpolicy Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnurlpolicy/ Requires : PowerShell v5.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-NSGetVpnurlpolicy: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all vpnurlpolicy objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy -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 vpnurlpolicy objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnurlpolicy objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnurlpolicy configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnurlpolicy configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy -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-NSGetVpnurlpolicy: Ended" } } function Invoke-NSGetVpnurlpolicyAaagroupBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the aaagroup that can be bound to vpnurlpolicy. .PARAMETER Name Name for the new urlPolicy. .PARAMETER GetAll Retrieve all vpnurlpolicy_aaagroup_binding object(s). .PARAMETER Count If specified, the count of the vpnurlpolicy_aaagroup_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-NSGetVpnurlpolicyAaagroupBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnurlpolicyAaagroupBinding -GetAll Get all vpnurlpolicy_aaagroup_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnurlpolicyAaagroupBinding -Count Get the number of vpnurlpolicy_aaagroup_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnurlpolicyAaagroupBinding -name <string> Get vpnurlpolicy_aaagroup_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnurlpolicyAaagroupBinding -Filter @{ 'name'='<value>' } Get vpnurlpolicy_aaagroup_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnurlpolicyAaagroupBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnurlpolicy_aaagroup_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-NSGetVpnurlpolicyAaagroupBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnurlpolicy_aaagroup_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy_aaagroup_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 vpnurlpolicy_aaagroup_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy_aaagroup_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnurlpolicy_aaagroup_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy_aaagroup_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnurlpolicy_aaagroup_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy_aaagroup_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnurlpolicy_aaagroup_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy_aaagroup_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-NSGetVpnurlpolicyAaagroupBinding: Ended" } } function Invoke-NSGetVpnurlpolicyAaauserBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the aaauser that can be bound to vpnurlpolicy. .PARAMETER Name Name for the new urlPolicy. .PARAMETER GetAll Retrieve all vpnurlpolicy_aaauser_binding object(s). .PARAMETER Count If specified, the count of the vpnurlpolicy_aaauser_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-NSGetVpnurlpolicyAaauserBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnurlpolicyAaauserBinding -GetAll Get all vpnurlpolicy_aaauser_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnurlpolicyAaauserBinding -Count Get the number of vpnurlpolicy_aaauser_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnurlpolicyAaauserBinding -name <string> Get vpnurlpolicy_aaauser_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnurlpolicyAaauserBinding -Filter @{ 'name'='<value>' } Get vpnurlpolicy_aaauser_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnurlpolicyAaauserBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnurlpolicy_aaauser_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-NSGetVpnurlpolicyAaauserBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnurlpolicy_aaauser_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy_aaauser_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 vpnurlpolicy_aaauser_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy_aaauser_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnurlpolicy_aaauser_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy_aaauser_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnurlpolicy_aaauser_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy_aaauser_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnurlpolicy_aaauser_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy_aaauser_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-NSGetVpnurlpolicyAaauserBinding: Ended" } } function Invoke-NSGetVpnurlpolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object which returns the resources bound to vpnurlpolicy. .PARAMETER Name Name for the new urlPolicy. .PARAMETER GetAll Retrieve all vpnurlpolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnurlpolicy_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-NSGetVpnurlpolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnurlpolicyBinding -GetAll Get all vpnurlpolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnurlpolicyBinding -name <string> Get vpnurlpolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnurlpolicyBinding -Filter @{ 'name'='<value>' } Get vpnurlpolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnurlpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnurlpolicy_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-NSGetVpnurlpolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnurlpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy_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 vpnurlpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnurlpolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnurlpolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnurlpolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy_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-NSGetVpnurlpolicyBinding: Ended" } } function Invoke-NSGetVpnurlpolicyVpnglobalBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the vpnglobal that can be bound to vpnurlpolicy. .PARAMETER Name Name for the new urlPolicy. .PARAMETER GetAll Retrieve all vpnurlpolicy_vpnglobal_binding object(s). .PARAMETER Count If specified, the count of the vpnurlpolicy_vpnglobal_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-NSGetVpnurlpolicyVpnglobalBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnurlpolicyVpnglobalBinding -GetAll Get all vpnurlpolicy_vpnglobal_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnurlpolicyVpnglobalBinding -Count Get the number of vpnurlpolicy_vpnglobal_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnurlpolicyVpnglobalBinding -name <string> Get vpnurlpolicy_vpnglobal_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnurlpolicyVpnglobalBinding -Filter @{ 'name'='<value>' } Get vpnurlpolicy_vpnglobal_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnurlpolicyVpnglobalBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnurlpolicy_vpnglobal_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-NSGetVpnurlpolicyVpnglobalBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnurlpolicy_vpnglobal_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy_vpnglobal_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 vpnurlpolicy_vpnglobal_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy_vpnglobal_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnurlpolicy_vpnglobal_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy_vpnglobal_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnurlpolicy_vpnglobal_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy_vpnglobal_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnurlpolicy_vpnglobal_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy_vpnglobal_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-NSGetVpnurlpolicyVpnglobalBinding: Ended" } } function Invoke-NSGetVpnurlpolicyVpnvserverBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the vpnvserver that can be bound to vpnurlpolicy. .PARAMETER Name Name for the new urlPolicy. .PARAMETER GetAll Retrieve all vpnurlpolicy_vpnvserver_binding object(s). .PARAMETER Count If specified, the count of the vpnurlpolicy_vpnvserver_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-NSGetVpnurlpolicyVpnvserverBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnurlpolicyVpnvserverBinding -GetAll Get all vpnurlpolicy_vpnvserver_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnurlpolicyVpnvserverBinding -Count Get the number of vpnurlpolicy_vpnvserver_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnurlpolicyVpnvserverBinding -name <string> Get vpnurlpolicy_vpnvserver_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnurlpolicyVpnvserverBinding -Filter @{ 'name'='<value>' } Get vpnurlpolicy_vpnvserver_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnurlpolicyVpnvserverBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnurlpolicy_vpnvserver_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-NSGetVpnurlpolicyVpnvserverBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnurlpolicy_vpnvserver_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy_vpnvserver_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 vpnurlpolicy_vpnvserver_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy_vpnvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnurlpolicy_vpnvserver_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy_vpnvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnurlpolicy_vpnvserver_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy_vpnvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnurlpolicy_vpnvserver_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnurlpolicy_vpnvserver_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-NSGetVpnurlpolicyVpnvserverBinding: Ended" } } function Invoke-NSAddVpnvserver { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN virtual server resource. .PARAMETER Name Name for the Citrix Gateway virtual server. 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. Can be changed after the virtual server is created. .PARAMETER Servicetype Protocol used by the Citrix Gateway virtual server. Possible values = SSL, DTLS, HTTP_QUIC .PARAMETER Ipv46 IPv4 or IPv6 address of the Citrix Gateway virtual server. Usually a public IP address. User devices send connection requests to this IP address. .PARAMETER Range Range of Citrix Gateway virtual server IP addresses. The consecutively numbered range of IP addresses begins with the address specified by the IP Address parameter. In the configuration utility, select Network VServer to enter a range. .PARAMETER Port TCP port on which the virtual server listens. .PARAMETER Ipset The list of IPv4/IPv6 addresses bound to ipset would form a part of listening service on the current vpn vserver. .PARAMETER State State of the virtual server. If the virtual server is disabled, requests are not processed. Possible values = ENABLED, DISABLED .PARAMETER Authentication Require authentication for users connecting to Citrix Gateway. Possible values = ON, OFF .PARAMETER Doublehop Use the Citrix Gateway appliance in a double-hop configuration. A double-hop deployment provides an extra layer of security for the internal network by using three firewalls to divide the DMZ into two stages. Such a deployment can have one appliance in the DMZ and one appliance in the secure network. Possible values = ENABLED, DISABLED .PARAMETER Maxaaausers Maximum number of concurrent user sessions allowed on this virtual server. The actual number of users allowed to log on to this virtual server depends on the total number of user licenses. .PARAMETER Icaonly - When set to ON, it implies Basic mode where the user can log on using either Citrix Receiver or a browser and get access to the published apps configured at the XenApp/XenDEsktop environment pointed out by the WIHome parameter. Users are not allowed to connect using the Citrix Gateway Plug-in and end point scans cannot be configured. Number of users that can log in and access the apps are not limited by the license in this mode. - When set to OFF, it implies Smart Access mode where the user can log on using either Citrix Receiver or a browser or a Citrix Gateway Plug-in. The admin can configure end point scans to be run on the client systems and then use the results to control access to the published apps. In this mode, the client can connect to the gateway in other client modes namely VPN and CVPN. Number of users that can log in and access the resources are limited by the CCU licenses in this mode. Possible values = ON, OFF .PARAMETER Icaproxysessionmigration This option determines if an existing ICA Proxy session is transferred when the user logs on from another device. Possible values = ON, OFF .PARAMETER Dtls This option starts/stops the turn service on the vserver. Possible values = ON, OFF .PARAMETER Loginonce This option enables/disables seamless SSO for this Vserver. Possible values = ON, OFF .PARAMETER Advancedepa This option tells whether advanced EPA is enabled on this virtual server. Possible values = ON, OFF .PARAMETER Devicecert Indicates whether device certificate check as a part of EPA is on or off. Possible values = ON, OFF .PARAMETER Certkeynames Name of the certificate key that was bound to the corresponding SSL virtual server as the Certificate Authority for the device certificate. .PARAMETER Downstateflush Close existing connections when the virtual server is marked DOWN, which means the server might have timed out. Disconnecting existing connections frees resources and in certain cases speeds recovery of overloaded load balancing setups. Enable this setting on servers in which the connections can safely be closed when they are marked DOWN. Do not enable DOWN state flush on servers that must complete their transactions. Possible values = ENABLED, DISABLED .PARAMETER Listenpolicy String specifying the listen policy for the Citrix Gateway virtual server. Can be either a named expression or an expression. The Citrix Gateway virtual server processes only the traffic for which the expression evaluates to true. .PARAMETER Listenpriority Integer specifying the priority of the listen policy. A higher number specifies a lower priority. If a request matches the listen policies of more than one virtual server, the virtual server whose listen policy has the highest priority (the lowest priority number) accepts the request. Maximum value = 100 .PARAMETER Tcpprofilename Name of the TCP profile to assign to this virtual server. .PARAMETER Httpprofilename Name of the HTTP profile to assign to this virtual server. .PARAMETER Comment Any comments associated with the virtual server. .PARAMETER Appflowlog Log AppFlow records that contain standard NetFlow or IPFIX information, such as time stamps for the beginning and end of a flow, packet count, and byte count. Also log records that contain application-level information, such as HTTP web addresses, HTTP request methods and response status codes, server response time, and latency. Possible values = ENABLED, DISABLED .PARAMETER Icmpvsrresponse Criterion for responding to PING requests sent to this virtual server. If this parameter is set to ACTIVE, respond only if the virtual server is available. With the PASSIVE setting, respond even if the virtual server is not available. Possible values = PASSIVE, ACTIVE .PARAMETER Rhistate A host route is injected according to the setting on the virtual servers. * If set to PASSIVE on all the virtual servers that share the IP address, the appliance always injects the hostroute. * If set to ACTIVE on all the virtual servers that share the IP address, the appliance injects even if one virtual server is UP. * If set to ACTIVE on some virtual servers and PASSIVE on the others, the appliance injects even if one virtual server set to ACTIVE is UP. Possible values = PASSIVE, ACTIVE .PARAMETER Netprofile The name of the network profile. .PARAMETER Cginfrahomepageredirect When client requests ShareFile resources and Citrix Gateway detects that the user is unauthenticated or the user session has expired, disabling this option takes the user to the originally requested ShareFile resource after authentication (instead of taking the user to the default VPN home page). Possible values = ENABLED, DISABLED .PARAMETER Maxloginattempts Maximum number of logon attempts. Maximum value = 255 .PARAMETER Failedlogintimeout Number of minutes an account will be locked if user exceeds maximum permissible attempts. .PARAMETER L2conn Use Layer 2 parameters (channel number, MAC address, and VLAN ID) in addition to the 4-tuple (<source IP>:<source port>::<destination IP>:<destination port>) that is used to identify a connection. Allows multiple TCP and non-TCP connections with the same 4-tuple to coexist on the Citrix ADC. Possible values = ON, OFF .PARAMETER Deploymenttype . Possible values = NONE, ICA_WEBINTERFACE, ICA_STOREFRONT, MOBILITY .PARAMETER Rdpserverprofilename Name of the RDP server profile associated with the vserver. .PARAMETER Windowsepapluginupgrade Option to set plugin upgrade behaviour for Win. Possible values = Always, Essential, Never .PARAMETER Linuxepapluginupgrade Option to set plugin upgrade behaviour for Linux. Possible values = Always, Essential, Never .PARAMETER Macepapluginupgrade Option to set plugin upgrade behaviour for Mac. Possible values = Always, Essential, Never .PARAMETER Logoutonsmartcardremoval Option to VPN plugin behavior when smartcard or its reader is removed. Possible values = ON, OFF .PARAMETER Userdomains List of user domains specified as comma seperated value. .PARAMETER Authnprofile Authentication Profile entity on virtual server. This entity can be used to offload authentication to AAA vserver for multi-factor(nFactor) authentication. .PARAMETER Vserverfqdn Fully qualified domain name for a VPN virtual server. This is used during StoreFront configuration generation. .PARAMETER Pcoipvserverprofilename Name of the PCoIP vserver profile associated with the vserver. .PARAMETER Samesite SameSite attribute value for Cookies generated in VPN context. This attribute value will be appended only for the cookies which are specified in the builtin patset ns_cookies_samesite. Possible values = None, LAX, STRICT .PARAMETER Quicprofilename Name of the QUIC profile to assign to this virtual server. .PARAMETER PassThru Return details about the created vpnvserver item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserver -name <string> -servicetype <string> An example how to add vpnvserver config Object(s). .NOTES File Name : Invoke-NSAddVpnvserver Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver/ Requires : PowerShell v5.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]$Name, [Parameter(Mandatory)] [ValidateSet('SSL', 'DTLS', 'HTTP_QUIC')] [string]$Servicetype = 'SSL', [ValidateScript({ $_.Length -gt 1 })] [string]$Ipv46, [double]$Range = '1', [ValidateRange(1, 65535)] [int]$Port, [ValidateScript({ $_.Length -gt 1 })] [string]$Ipset, [ValidateSet('ENABLED', 'DISABLED')] [string]$State = 'ENABLED', [ValidateSet('ON', 'OFF')] [string]$Authentication = 'ON', [ValidateSet('ENABLED', 'DISABLED')] [string]$Doublehop = 'DISABLED', [double]$Maxaaausers, [ValidateSet('ON', 'OFF')] [string]$Icaonly = 'OFF', [ValidateSet('ON', 'OFF')] [string]$Icaproxysessionmigration = 'OFF', [ValidateSet('ON', 'OFF')] [string]$Dtls = 'ON', [ValidateSet('ON', 'OFF')] [string]$Loginonce = 'OFF', [ValidateSet('ON', 'OFF')] [string]$Advancedepa = 'OFF', [ValidateSet('ON', 'OFF')] [string]$Devicecert = 'OFF', [ValidateLength(1, 127)] [string]$Certkeynames, [ValidateSet('ENABLED', 'DISABLED')] [string]$Downstateflush = 'ENABLED', [string]$Listenpolicy = '"none"', [double]$Listenpriority = '101', [ValidateLength(1, 127)] [string]$Tcpprofilename, [ValidateLength(1, 127)] [string]$Httpprofilename = '"nshttp_default_strict_validation"', [string]$Comment, [ValidateSet('ENABLED', 'DISABLED')] [string]$Appflowlog = 'ENABLED', [ValidateSet('PASSIVE', 'ACTIVE')] [string]$Icmpvsrresponse = 'PASSIVE', [ValidateSet('PASSIVE', 'ACTIVE')] [string]$Rhistate = 'PASSIVE', [ValidateLength(1, 127)] [string]$Netprofile, [ValidateSet('ENABLED', 'DISABLED')] [string]$Cginfrahomepageredirect = 'ENABLED', [double]$Maxloginattempts, [double]$Failedlogintimeout, [ValidateSet('ON', 'OFF')] [string]$L2conn, [ValidateSet('NONE', 'ICA_WEBINTERFACE', 'ICA_STOREFRONT', 'MOBILITY')] [string]$Deploymenttype = '5', [ValidateLength(1, 31)] [string]$Rdpserverprofilename, [ValidateSet('Always', 'Essential', 'Never')] [string]$Windowsepapluginupgrade, [ValidateSet('Always', 'Essential', 'Never')] [string]$Linuxepapluginupgrade, [ValidateSet('Always', 'Essential', 'Never')] [string]$Macepapluginupgrade, [ValidateSet('ON', 'OFF')] [string]$Logoutonsmartcardremoval = 'OFF', [string]$Userdomains, [string]$Authnprofile, [string]$Vserverfqdn, [ValidateLength(1, 31)] [string]$Pcoipvserverprofilename, [ValidateSet('None', 'LAX', 'STRICT')] [string]$Samesite, [ValidateLength(1, 127)] [string]$Quicprofilename, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserver: Starting" } process { try { $payload = @{ name = $name servicetype = $servicetype } if ( $PSBoundParameters.ContainsKey('ipv46') ) { $payload.Add('ipv46', $ipv46) } if ( $PSBoundParameters.ContainsKey('range') ) { $payload.Add('range', $range) } if ( $PSBoundParameters.ContainsKey('port') ) { $payload.Add('port', $port) } if ( $PSBoundParameters.ContainsKey('ipset') ) { $payload.Add('ipset', $ipset) } if ( $PSBoundParameters.ContainsKey('state') ) { $payload.Add('state', $state) } if ( $PSBoundParameters.ContainsKey('authentication') ) { $payload.Add('authentication', $authentication) } if ( $PSBoundParameters.ContainsKey('doublehop') ) { $payload.Add('doublehop', $doublehop) } if ( $PSBoundParameters.ContainsKey('maxaaausers') ) { $payload.Add('maxaaausers', $maxaaausers) } if ( $PSBoundParameters.ContainsKey('icaonly') ) { $payload.Add('icaonly', $icaonly) } if ( $PSBoundParameters.ContainsKey('icaproxysessionmigration') ) { $payload.Add('icaproxysessionmigration', $icaproxysessionmigration) } if ( $PSBoundParameters.ContainsKey('dtls') ) { $payload.Add('dtls', $dtls) } if ( $PSBoundParameters.ContainsKey('loginonce') ) { $payload.Add('loginonce', $loginonce) } if ( $PSBoundParameters.ContainsKey('advancedepa') ) { $payload.Add('advancedepa', $advancedepa) } if ( $PSBoundParameters.ContainsKey('devicecert') ) { $payload.Add('devicecert', $devicecert) } if ( $PSBoundParameters.ContainsKey('certkeynames') ) { $payload.Add('certkeynames', $certkeynames) } if ( $PSBoundParameters.ContainsKey('downstateflush') ) { $payload.Add('downstateflush', $downstateflush) } if ( $PSBoundParameters.ContainsKey('listenpolicy') ) { $payload.Add('listenpolicy', $listenpolicy) } if ( $PSBoundParameters.ContainsKey('listenpriority') ) { $payload.Add('listenpriority', $listenpriority) } if ( $PSBoundParameters.ContainsKey('tcpprofilename') ) { $payload.Add('tcpprofilename', $tcpprofilename) } if ( $PSBoundParameters.ContainsKey('httpprofilename') ) { $payload.Add('httpprofilename', $httpprofilename) } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSBoundParameters.ContainsKey('appflowlog') ) { $payload.Add('appflowlog', $appflowlog) } if ( $PSBoundParameters.ContainsKey('icmpvsrresponse') ) { $payload.Add('icmpvsrresponse', $icmpvsrresponse) } if ( $PSBoundParameters.ContainsKey('rhistate') ) { $payload.Add('rhistate', $rhistate) } if ( $PSBoundParameters.ContainsKey('netprofile') ) { $payload.Add('netprofile', $netprofile) } if ( $PSBoundParameters.ContainsKey('cginfrahomepageredirect') ) { $payload.Add('cginfrahomepageredirect', $cginfrahomepageredirect) } if ( $PSBoundParameters.ContainsKey('maxloginattempts') ) { $payload.Add('maxloginattempts', $maxloginattempts) } if ( $PSBoundParameters.ContainsKey('failedlogintimeout') ) { $payload.Add('failedlogintimeout', $failedlogintimeout) } if ( $PSBoundParameters.ContainsKey('l2conn') ) { $payload.Add('l2conn', $l2conn) } if ( $PSBoundParameters.ContainsKey('deploymenttype') ) { $payload.Add('deploymenttype', $deploymenttype) } if ( $PSBoundParameters.ContainsKey('rdpserverprofilename') ) { $payload.Add('rdpserverprofilename', $rdpserverprofilename) } if ( $PSBoundParameters.ContainsKey('windowsepapluginupgrade') ) { $payload.Add('windowsepapluginupgrade', $windowsepapluginupgrade) } if ( $PSBoundParameters.ContainsKey('linuxepapluginupgrade') ) { $payload.Add('linuxepapluginupgrade', $linuxepapluginupgrade) } if ( $PSBoundParameters.ContainsKey('macepapluginupgrade') ) { $payload.Add('macepapluginupgrade', $macepapluginupgrade) } if ( $PSBoundParameters.ContainsKey('logoutonsmartcardremoval') ) { $payload.Add('logoutonsmartcardremoval', $logoutonsmartcardremoval) } if ( $PSBoundParameters.ContainsKey('userdomains') ) { $payload.Add('userdomains', $userdomains) } if ( $PSBoundParameters.ContainsKey('authnprofile') ) { $payload.Add('authnprofile', $authnprofile) } if ( $PSBoundParameters.ContainsKey('vserverfqdn') ) { $payload.Add('vserverfqdn', $vserverfqdn) } if ( $PSBoundParameters.ContainsKey('pcoipvserverprofilename') ) { $payload.Add('pcoipvserverprofilename', $pcoipvserverprofilename) } if ( $PSBoundParameters.ContainsKey('samesite') ) { $payload.Add('samesite', $samesite) } if ( $PSBoundParameters.ContainsKey('quicprofilename') ) { $payload.Add('quicprofilename', $quicprofilename) } if ( $PSCmdlet.ShouldProcess("vpnvserver", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type vpnvserver -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-NSGetVpnvserver -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserver: Finished" } } function Invoke-NSDeleteVpnvserver { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN virtual server resource. .PARAMETER Name Name for the Citrix Gateway virtual server. 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. Can be changed after the virtual server is created. .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserver -Name <string> An example how to delete vpnvserver config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserver Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver/ Requires : PowerShell v5.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-NSDeleteVpnvserver: Starting" } process { try { $arguments = @{ } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver -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-NSDeleteVpnvserver: Finished" } } function Invoke-NSUpdateVpnvserver { <# .SYNOPSIS Update Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN virtual server resource. .PARAMETER Name Name for the Citrix Gateway virtual server. 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. Can be changed after the virtual server is created. .PARAMETER Ipv46 IPv4 or IPv6 address of the Citrix Gateway virtual server. Usually a public IP address. User devices send connection requests to this IP address. .PARAMETER Ipset The list of IPv4/IPv6 addresses bound to ipset would form a part of listening service on the current vpn vserver. .PARAMETER Authentication Require authentication for users connecting to Citrix Gateway. Possible values = ON, OFF .PARAMETER Doublehop Use the Citrix Gateway appliance in a double-hop configuration. A double-hop deployment provides an extra layer of security for the internal network by using three firewalls to divide the DMZ into two stages. Such a deployment can have one appliance in the DMZ and one appliance in the secure network. Possible values = ENABLED, DISABLED .PARAMETER Icaonly - When set to ON, it implies Basic mode where the user can log on using either Citrix Receiver or a browser and get access to the published apps configured at the XenApp/XenDEsktop environment pointed out by the WIHome parameter. Users are not allowed to connect using the Citrix Gateway Plug-in and end point scans cannot be configured. Number of users that can log in and access the apps are not limited by the license in this mode. - When set to OFF, it implies Smart Access mode where the user can log on using either Citrix Receiver or a browser or a Citrix Gateway Plug-in. The admin can configure end point scans to be run on the client systems and then use the results to control access to the published apps. In this mode, the client can connect to the gateway in other client modes namely VPN and CVPN. Number of users that can log in and access the resources are limited by the CCU licenses in this mode. Possible values = ON, OFF .PARAMETER Icaproxysessionmigration This option determines if an existing ICA Proxy session is transferred when the user logs on from another device. Possible values = ON, OFF .PARAMETER Dtls This option starts/stops the turn service on the vserver. Possible values = ON, OFF .PARAMETER Loginonce This option enables/disables seamless SSO for this Vserver. Possible values = ON, OFF .PARAMETER Advancedepa This option tells whether advanced EPA is enabled on this virtual server. Possible values = ON, OFF .PARAMETER Devicecert Indicates whether device certificate check as a part of EPA is on or off. Possible values = ON, OFF .PARAMETER Certkeynames Name of the certificate key that was bound to the corresponding SSL virtual server as the Certificate Authority for the device certificate. .PARAMETER Maxaaausers Maximum number of concurrent user sessions allowed on this virtual server. The actual number of users allowed to log on to this virtual server depends on the total number of user licenses. .PARAMETER Downstateflush Close existing connections when the virtual server is marked DOWN, which means the server might have timed out. Disconnecting existing connections frees resources and in certain cases speeds recovery of overloaded load balancing setups. Enable this setting on servers in which the connections can safely be closed when they are marked DOWN. Do not enable DOWN state flush on servers that must complete their transactions. Possible values = ENABLED, DISABLED .PARAMETER Listenpolicy String specifying the listen policy for the Citrix Gateway virtual server. Can be either a named expression or an expression. The Citrix Gateway virtual server processes only the traffic for which the expression evaluates to true. .PARAMETER Listenpriority Integer specifying the priority of the listen policy. A higher number specifies a lower priority. If a request matches the listen policies of more than one virtual server, the virtual server whose listen policy has the highest priority (the lowest priority number) accepts the request. Maximum value = 100 .PARAMETER Tcpprofilename Name of the TCP profile to assign to this virtual server. .PARAMETER Httpprofilename Name of the HTTP profile to assign to this virtual server. .PARAMETER Comment Any comments associated with the virtual server. .PARAMETER Appflowlog Log AppFlow records that contain standard NetFlow or IPFIX information, such as time stamps for the beginning and end of a flow, packet count, and byte count. Also log records that contain application-level information, such as HTTP web addresses, HTTP request methods and response status codes, server response time, and latency. Possible values = ENABLED, DISABLED .PARAMETER Icmpvsrresponse Criterion for responding to PING requests sent to this virtual server. If this parameter is set to ACTIVE, respond only if the virtual server is available. With the PASSIVE setting, respond even if the virtual server is not available. Possible values = PASSIVE, ACTIVE .PARAMETER Rhistate A host route is injected according to the setting on the virtual servers. * If set to PASSIVE on all the virtual servers that share the IP address, the appliance always injects the hostroute. * If set to ACTIVE on all the virtual servers that share the IP address, the appliance injects even if one virtual server is UP. * If set to ACTIVE on some virtual servers and PASSIVE on the others, the appliance injects even if one virtual server set to ACTIVE is UP. Possible values = PASSIVE, ACTIVE .PARAMETER Netprofile The name of the network profile. .PARAMETER Cginfrahomepageredirect When client requests ShareFile resources and Citrix Gateway detects that the user is unauthenticated or the user session has expired, disabling this option takes the user to the originally requested ShareFile resource after authentication (instead of taking the user to the default VPN home page). Possible values = ENABLED, DISABLED .PARAMETER Maxloginattempts Maximum number of logon attempts. Maximum value = 255 .PARAMETER Rdpserverprofilename Name of the RDP server profile associated with the vserver. .PARAMETER Failedlogintimeout Number of minutes an account will be locked if user exceeds maximum permissible attempts. .PARAMETER L2conn Use Layer 2 parameters (channel number, MAC address, and VLAN ID) in addition to the 4-tuple (<source IP>:<source port>::<destination IP>:<destination port>) that is used to identify a connection. Allows multiple TCP and non-TCP connections with the same 4-tuple to coexist on the Citrix ADC. Possible values = ON, OFF .PARAMETER Windowsepapluginupgrade Option to set plugin upgrade behaviour for Win. Possible values = Always, Essential, Never .PARAMETER Macepapluginupgrade Option to set plugin upgrade behaviour for Mac. Possible values = Always, Essential, Never .PARAMETER Linuxepapluginupgrade Option to set plugin upgrade behaviour for Linux. Possible values = Always, Essential, Never .PARAMETER Logoutonsmartcardremoval Option to VPN plugin behavior when smartcard or its reader is removed. Possible values = ON, OFF .PARAMETER Userdomains List of user domains specified as comma seperated value. .PARAMETER Authnprofile Authentication Profile entity on virtual server. This entity can be used to offload authentication to AAA vserver for multi-factor(nFactor) authentication. .PARAMETER Vserverfqdn Fully qualified domain name for a VPN virtual server. This is used during StoreFront configuration generation. .PARAMETER Pcoipvserverprofilename Name of the PCoIP vserver profile associated with the vserver. .PARAMETER Samesite SameSite attribute value for Cookies generated in VPN context. This attribute value will be appended only for the cookies which are specified in the builtin patset ns_cookies_samesite. Possible values = None, LAX, STRICT .PARAMETER Quicprofilename Name of the QUIC profile to assign to this virtual server. .PARAMETER PassThru Return details about the created vpnvserver item. .EXAMPLE PS C:\>Invoke-NSUpdateVpnvserver -name <string> An example how to update vpnvserver config Object(s). .NOTES File Name : Invoke-NSUpdateVpnvserver Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver/ Requires : PowerShell v5.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]$Name, [ValidateScript({ $_.Length -gt 1 })] [string]$Ipv46, [ValidateScript({ $_.Length -gt 1 })] [string]$Ipset, [ValidateSet('ON', 'OFF')] [string]$Authentication, [ValidateSet('ENABLED', 'DISABLED')] [string]$Doublehop, [ValidateSet('ON', 'OFF')] [string]$Icaonly, [ValidateSet('ON', 'OFF')] [string]$Icaproxysessionmigration, [ValidateSet('ON', 'OFF')] [string]$Dtls, [ValidateSet('ON', 'OFF')] [string]$Loginonce, [ValidateSet('ON', 'OFF')] [string]$Advancedepa, [ValidateSet('ON', 'OFF')] [string]$Devicecert, [ValidateLength(1, 127)] [string]$Certkeynames, [double]$Maxaaausers, [ValidateSet('ENABLED', 'DISABLED')] [string]$Downstateflush, [string]$Listenpolicy, [double]$Listenpriority, [ValidateLength(1, 127)] [string]$Tcpprofilename, [ValidateLength(1, 127)] [string]$Httpprofilename, [string]$Comment, [ValidateSet('ENABLED', 'DISABLED')] [string]$Appflowlog, [ValidateSet('PASSIVE', 'ACTIVE')] [string]$Icmpvsrresponse, [ValidateSet('PASSIVE', 'ACTIVE')] [string]$Rhistate, [ValidateLength(1, 127)] [string]$Netprofile, [ValidateSet('ENABLED', 'DISABLED')] [string]$Cginfrahomepageredirect, [double]$Maxloginattempts, [ValidateLength(1, 31)] [string]$Rdpserverprofilename, [double]$Failedlogintimeout, [ValidateSet('ON', 'OFF')] [string]$L2conn, [ValidateSet('Always', 'Essential', 'Never')] [string]$Windowsepapluginupgrade, [ValidateSet('Always', 'Essential', 'Never')] [string]$Macepapluginupgrade, [ValidateSet('Always', 'Essential', 'Never')] [string]$Linuxepapluginupgrade, [ValidateSet('ON', 'OFF')] [string]$Logoutonsmartcardremoval, [string]$Userdomains, [string]$Authnprofile, [string]$Vserverfqdn, [ValidateLength(1, 31)] [string]$Pcoipvserverprofilename, [ValidateSet('None', 'LAX', 'STRICT')] [string]$Samesite, [ValidateLength(1, 127)] [string]$Quicprofilename, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSUpdateVpnvserver: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('ipv46') ) { $payload.Add('ipv46', $ipv46) } if ( $PSBoundParameters.ContainsKey('ipset') ) { $payload.Add('ipset', $ipset) } if ( $PSBoundParameters.ContainsKey('authentication') ) { $payload.Add('authentication', $authentication) } if ( $PSBoundParameters.ContainsKey('doublehop') ) { $payload.Add('doublehop', $doublehop) } if ( $PSBoundParameters.ContainsKey('icaonly') ) { $payload.Add('icaonly', $icaonly) } if ( $PSBoundParameters.ContainsKey('icaproxysessionmigration') ) { $payload.Add('icaproxysessionmigration', $icaproxysessionmigration) } if ( $PSBoundParameters.ContainsKey('dtls') ) { $payload.Add('dtls', $dtls) } if ( $PSBoundParameters.ContainsKey('loginonce') ) { $payload.Add('loginonce', $loginonce) } if ( $PSBoundParameters.ContainsKey('advancedepa') ) { $payload.Add('advancedepa', $advancedepa) } if ( $PSBoundParameters.ContainsKey('devicecert') ) { $payload.Add('devicecert', $devicecert) } if ( $PSBoundParameters.ContainsKey('certkeynames') ) { $payload.Add('certkeynames', $certkeynames) } if ( $PSBoundParameters.ContainsKey('maxaaausers') ) { $payload.Add('maxaaausers', $maxaaausers) } if ( $PSBoundParameters.ContainsKey('downstateflush') ) { $payload.Add('downstateflush', $downstateflush) } if ( $PSBoundParameters.ContainsKey('listenpolicy') ) { $payload.Add('listenpolicy', $listenpolicy) } if ( $PSBoundParameters.ContainsKey('listenpriority') ) { $payload.Add('listenpriority', $listenpriority) } if ( $PSBoundParameters.ContainsKey('tcpprofilename') ) { $payload.Add('tcpprofilename', $tcpprofilename) } if ( $PSBoundParameters.ContainsKey('httpprofilename') ) { $payload.Add('httpprofilename', $httpprofilename) } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSBoundParameters.ContainsKey('appflowlog') ) { $payload.Add('appflowlog', $appflowlog) } if ( $PSBoundParameters.ContainsKey('icmpvsrresponse') ) { $payload.Add('icmpvsrresponse', $icmpvsrresponse) } if ( $PSBoundParameters.ContainsKey('rhistate') ) { $payload.Add('rhistate', $rhistate) } if ( $PSBoundParameters.ContainsKey('netprofile') ) { $payload.Add('netprofile', $netprofile) } if ( $PSBoundParameters.ContainsKey('cginfrahomepageredirect') ) { $payload.Add('cginfrahomepageredirect', $cginfrahomepageredirect) } if ( $PSBoundParameters.ContainsKey('maxloginattempts') ) { $payload.Add('maxloginattempts', $maxloginattempts) } if ( $PSBoundParameters.ContainsKey('rdpserverprofilename') ) { $payload.Add('rdpserverprofilename', $rdpserverprofilename) } if ( $PSBoundParameters.ContainsKey('failedlogintimeout') ) { $payload.Add('failedlogintimeout', $failedlogintimeout) } if ( $PSBoundParameters.ContainsKey('l2conn') ) { $payload.Add('l2conn', $l2conn) } if ( $PSBoundParameters.ContainsKey('windowsepapluginupgrade') ) { $payload.Add('windowsepapluginupgrade', $windowsepapluginupgrade) } if ( $PSBoundParameters.ContainsKey('macepapluginupgrade') ) { $payload.Add('macepapluginupgrade', $macepapluginupgrade) } if ( $PSBoundParameters.ContainsKey('linuxepapluginupgrade') ) { $payload.Add('linuxepapluginupgrade', $linuxepapluginupgrade) } if ( $PSBoundParameters.ContainsKey('logoutonsmartcardremoval') ) { $payload.Add('logoutonsmartcardremoval', $logoutonsmartcardremoval) } if ( $PSBoundParameters.ContainsKey('userdomains') ) { $payload.Add('userdomains', $userdomains) } if ( $PSBoundParameters.ContainsKey('authnprofile') ) { $payload.Add('authnprofile', $authnprofile) } if ( $PSBoundParameters.ContainsKey('vserverfqdn') ) { $payload.Add('vserverfqdn', $vserverfqdn) } if ( $PSBoundParameters.ContainsKey('pcoipvserverprofilename') ) { $payload.Add('pcoipvserverprofilename', $pcoipvserverprofilename) } if ( $PSBoundParameters.ContainsKey('samesite') ) { $payload.Add('samesite', $samesite) } if ( $PSBoundParameters.ContainsKey('quicprofilename') ) { $payload.Add('quicprofilename', $quicprofilename) } if ( $PSCmdlet.ShouldProcess("vpnvserver", "Update Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver -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-NSGetVpnvserver -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSUpdateVpnvserver: Finished" } } function Invoke-NSUnsetVpnvserver { <# .SYNOPSIS Unset Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN virtual server resource. .PARAMETER Name Name for the Citrix Gateway virtual server. 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. Can be changed after the virtual server is created. .PARAMETER Ipset The list of IPv4/IPv6 addresses bound to ipset would form a part of listening service on the current vpn vserver. .PARAMETER Authentication Require authentication for users connecting to Citrix Gateway. Possible values = ON, OFF .PARAMETER Doublehop Use the Citrix Gateway appliance in a double-hop configuration. A double-hop deployment provides an extra layer of security for the internal network by using three firewalls to divide the DMZ into two stages. Such a deployment can have one appliance in the DMZ and one appliance in the secure network. Possible values = ENABLED, DISABLED .PARAMETER Icaonly - When set to ON, it implies Basic mode where the user can log on using either Citrix Receiver or a browser and get access to the published apps configured at the XenApp/XenDEsktop environment pointed out by the WIHome parameter. Users are not allowed to connect using the Citrix Gateway Plug-in and end point scans cannot be configured. Number of users that can log in and access the apps are not limited by the license in this mode. - When set to OFF, it implies Smart Access mode where the user can log on using either Citrix Receiver or a browser or a Citrix Gateway Plug-in. The admin can configure end point scans to be run on the client systems and then use the results to control access to the published apps. In this mode, the client can connect to the gateway in other client modes namely VPN and CVPN. Number of users that can log in and access the resources are limited by the CCU licenses in this mode. Possible values = ON, OFF .PARAMETER Icaproxysessionmigration This option determines if an existing ICA Proxy session is transferred when the user logs on from another device. Possible values = ON, OFF .PARAMETER Dtls This option starts/stops the turn service on the vserver. Possible values = ON, OFF .PARAMETER Loginonce This option enables/disables seamless SSO for this Vserver. Possible values = ON, OFF .PARAMETER Advancedepa This option tells whether advanced EPA is enabled on this virtual server. Possible values = ON, OFF .PARAMETER Devicecert Indicates whether device certificate check as a part of EPA is on or off. Possible values = ON, OFF .PARAMETER Certkeynames Name of the certificate key that was bound to the corresponding SSL virtual server as the Certificate Authority for the device certificate. .PARAMETER Maxaaausers Maximum number of concurrent user sessions allowed on this virtual server. The actual number of users allowed to log on to this virtual server depends on the total number of user licenses. .PARAMETER Downstateflush Close existing connections when the virtual server is marked DOWN, which means the server might have timed out. Disconnecting existing connections frees resources and in certain cases speeds recovery of overloaded load balancing setups. Enable this setting on servers in which the connections can safely be closed when they are marked DOWN. Do not enable DOWN state flush on servers that must complete their transactions. Possible values = ENABLED, DISABLED .PARAMETER Listenpolicy String specifying the listen policy for the Citrix Gateway virtual server. Can be either a named expression or an expression. The Citrix Gateway virtual server processes only the traffic for which the expression evaluates to true. .PARAMETER Listenpriority Integer specifying the priority of the listen policy. A higher number specifies a lower priority. If a request matches the listen policies of more than one virtual server, the virtual server whose listen policy has the highest priority (the lowest priority number) accepts the request. Maximum value = 100 .PARAMETER Tcpprofilename Name of the TCP profile to assign to this virtual server. .PARAMETER Httpprofilename Name of the HTTP profile to assign to this virtual server. .PARAMETER Comment Any comments associated with the virtual server. .PARAMETER Appflowlog Log AppFlow records that contain standard NetFlow or IPFIX information, such as time stamps for the beginning and end of a flow, packet count, and byte count. Also log records that contain application-level information, such as HTTP web addresses, HTTP request methods and response status codes, server response time, and latency. Possible values = ENABLED, DISABLED .PARAMETER Icmpvsrresponse Criterion for responding to PING requests sent to this virtual server. If this parameter is set to ACTIVE, respond only if the virtual server is available. With the PASSIVE setting, respond even if the virtual server is not available. Possible values = PASSIVE, ACTIVE .PARAMETER Rhistate A host route is injected according to the setting on the virtual servers. * If set to PASSIVE on all the virtual servers that share the IP address, the appliance always injects the hostroute. * If set to ACTIVE on all the virtual servers that share the IP address, the appliance injects even if one virtual server is UP. * If set to ACTIVE on some virtual servers and PASSIVE on the others, the appliance injects even if one virtual server set to ACTIVE is UP. Possible values = PASSIVE, ACTIVE .PARAMETER Netprofile The name of the network profile. .PARAMETER Cginfrahomepageredirect When client requests ShareFile resources and Citrix Gateway detects that the user is unauthenticated or the user session has expired, disabling this option takes the user to the originally requested ShareFile resource after authentication (instead of taking the user to the default VPN home page). Possible values = ENABLED, DISABLED .PARAMETER Maxloginattempts Maximum number of logon attempts. Maximum value = 255 .PARAMETER Rdpserverprofilename Name of the RDP server profile associated with the vserver. .PARAMETER L2conn Use Layer 2 parameters (channel number, MAC address, and VLAN ID) in addition to the 4-tuple (<source IP>:<source port>::<destination IP>:<destination port>) that is used to identify a connection. Allows multiple TCP and non-TCP connections with the same 4-tuple to coexist on the Citrix ADC. Possible values = ON, OFF .PARAMETER Windowsepapluginupgrade Option to set plugin upgrade behaviour for Win. Possible values = Always, Essential, Never .PARAMETER Macepapluginupgrade Option to set plugin upgrade behaviour for Mac. Possible values = Always, Essential, Never .PARAMETER Linuxepapluginupgrade Option to set plugin upgrade behaviour for Linux. Possible values = Always, Essential, Never .PARAMETER Logoutonsmartcardremoval Option to VPN plugin behavior when smartcard or its reader is removed. Possible values = ON, OFF .PARAMETER Userdomains List of user domains specified as comma seperated value. .PARAMETER Authnprofile Authentication Profile entity on virtual server. This entity can be used to offload authentication to AAA vserver for multi-factor(nFactor) authentication. .PARAMETER Vserverfqdn Fully qualified domain name for a VPN virtual server. This is used during StoreFront configuration generation. .PARAMETER Pcoipvserverprofilename Name of the PCoIP vserver profile associated with the vserver. .PARAMETER Samesite SameSite attribute value for Cookies generated in VPN context. This attribute value will be appended only for the cookies which are specified in the builtin patset ns_cookies_samesite. Possible values = None, LAX, STRICT .PARAMETER Quicprofilename Name of the QUIC profile to assign to this virtual server. .EXAMPLE PS C:\>Invoke-NSUnsetVpnvserver -name <string> An example how to unset vpnvserver config Object(s). .NOTES File Name : Invoke-NSUnsetVpnvserver Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver Requires : PowerShell v5.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]$Name, [Boolean]$ipset, [Boolean]$authentication, [Boolean]$doublehop, [Boolean]$icaonly, [Boolean]$icaproxysessionmigration, [Boolean]$dtls, [Boolean]$loginonce, [Boolean]$advancedepa, [Boolean]$devicecert, [Boolean]$certkeynames, [Boolean]$maxaaausers, [Boolean]$downstateflush, [Boolean]$listenpolicy, [Boolean]$listenpriority, [Boolean]$tcpprofilename, [Boolean]$httpprofilename, [Boolean]$comment, [Boolean]$appflowlog, [Boolean]$icmpvsrresponse, [Boolean]$rhistate, [Boolean]$netprofile, [Boolean]$cginfrahomepageredirect, [Boolean]$maxloginattempts, [Boolean]$rdpserverprofilename, [Boolean]$l2conn, [Boolean]$windowsepapluginupgrade, [Boolean]$macepapluginupgrade, [Boolean]$linuxepapluginupgrade, [Boolean]$logoutonsmartcardremoval, [Boolean]$userdomains, [Boolean]$authnprofile, [Boolean]$vserverfqdn, [Boolean]$pcoipvserverprofilename, [Boolean]$samesite, [Boolean]$quicprofilename ) begin { Write-Verbose "Invoke-NSUnsetVpnvserver: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('ipset') ) { $payload.Add('ipset', $ipset) } if ( $PSBoundParameters.ContainsKey('authentication') ) { $payload.Add('authentication', $authentication) } if ( $PSBoundParameters.ContainsKey('doublehop') ) { $payload.Add('doublehop', $doublehop) } if ( $PSBoundParameters.ContainsKey('icaonly') ) { $payload.Add('icaonly', $icaonly) } if ( $PSBoundParameters.ContainsKey('icaproxysessionmigration') ) { $payload.Add('icaproxysessionmigration', $icaproxysessionmigration) } if ( $PSBoundParameters.ContainsKey('dtls') ) { $payload.Add('dtls', $dtls) } if ( $PSBoundParameters.ContainsKey('loginonce') ) { $payload.Add('loginonce', $loginonce) } if ( $PSBoundParameters.ContainsKey('advancedepa') ) { $payload.Add('advancedepa', $advancedepa) } if ( $PSBoundParameters.ContainsKey('devicecert') ) { $payload.Add('devicecert', $devicecert) } if ( $PSBoundParameters.ContainsKey('certkeynames') ) { $payload.Add('certkeynames', $certkeynames) } if ( $PSBoundParameters.ContainsKey('maxaaausers') ) { $payload.Add('maxaaausers', $maxaaausers) } if ( $PSBoundParameters.ContainsKey('downstateflush') ) { $payload.Add('downstateflush', $downstateflush) } if ( $PSBoundParameters.ContainsKey('listenpolicy') ) { $payload.Add('listenpolicy', $listenpolicy) } if ( $PSBoundParameters.ContainsKey('listenpriority') ) { $payload.Add('listenpriority', $listenpriority) } if ( $PSBoundParameters.ContainsKey('tcpprofilename') ) { $payload.Add('tcpprofilename', $tcpprofilename) } if ( $PSBoundParameters.ContainsKey('httpprofilename') ) { $payload.Add('httpprofilename', $httpprofilename) } if ( $PSBoundParameters.ContainsKey('comment') ) { $payload.Add('comment', $comment) } if ( $PSBoundParameters.ContainsKey('appflowlog') ) { $payload.Add('appflowlog', $appflowlog) } if ( $PSBoundParameters.ContainsKey('icmpvsrresponse') ) { $payload.Add('icmpvsrresponse', $icmpvsrresponse) } if ( $PSBoundParameters.ContainsKey('rhistate') ) { $payload.Add('rhistate', $rhistate) } if ( $PSBoundParameters.ContainsKey('netprofile') ) { $payload.Add('netprofile', $netprofile) } if ( $PSBoundParameters.ContainsKey('cginfrahomepageredirect') ) { $payload.Add('cginfrahomepageredirect', $cginfrahomepageredirect) } if ( $PSBoundParameters.ContainsKey('maxloginattempts') ) { $payload.Add('maxloginattempts', $maxloginattempts) } if ( $PSBoundParameters.ContainsKey('rdpserverprofilename') ) { $payload.Add('rdpserverprofilename', $rdpserverprofilename) } if ( $PSBoundParameters.ContainsKey('l2conn') ) { $payload.Add('l2conn', $l2conn) } if ( $PSBoundParameters.ContainsKey('windowsepapluginupgrade') ) { $payload.Add('windowsepapluginupgrade', $windowsepapluginupgrade) } if ( $PSBoundParameters.ContainsKey('macepapluginupgrade') ) { $payload.Add('macepapluginupgrade', $macepapluginupgrade) } if ( $PSBoundParameters.ContainsKey('linuxepapluginupgrade') ) { $payload.Add('linuxepapluginupgrade', $linuxepapluginupgrade) } if ( $PSBoundParameters.ContainsKey('logoutonsmartcardremoval') ) { $payload.Add('logoutonsmartcardremoval', $logoutonsmartcardremoval) } if ( $PSBoundParameters.ContainsKey('userdomains') ) { $payload.Add('userdomains', $userdomains) } if ( $PSBoundParameters.ContainsKey('authnprofile') ) { $payload.Add('authnprofile', $authnprofile) } if ( $PSBoundParameters.ContainsKey('vserverfqdn') ) { $payload.Add('vserverfqdn', $vserverfqdn) } if ( $PSBoundParameters.ContainsKey('pcoipvserverprofilename') ) { $payload.Add('pcoipvserverprofilename', $pcoipvserverprofilename) } if ( $PSBoundParameters.ContainsKey('samesite') ) { $payload.Add('samesite', $samesite) } if ( $PSBoundParameters.ContainsKey('quicprofilename') ) { $payload.Add('quicprofilename', $quicprofilename) } if ( $PSCmdlet.ShouldProcess("$name", "Unset Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method POST -Type vpnvserver -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-NSUnsetVpnvserver: Finished" } } function Invoke-NSEnableVpnvserver { <# .SYNOPSIS Enable Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN virtual server resource. .PARAMETER Name Name for the Citrix Gateway virtual server. 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. Can be changed after the virtual server is created. .EXAMPLE PS C:\>Invoke-NSEnableVpnvserver -name <string> An example how to enable vpnvserver config Object(s). .NOTES File Name : Invoke-NSEnableVpnvserver Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver/ Requires : PowerShell v5.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]$Name ) begin { Write-Verbose "Invoke-NSEnableVpnvserver: Starting" } process { try { $payload = @{ name = $name } if ( $PSCmdlet.ShouldProcess($Name, "Enable Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type vpnvserver -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-NSEnableVpnvserver: Finished" } } function Invoke-NSDisableVpnvserver { <# .SYNOPSIS Disable Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN virtual server resource. .PARAMETER Name Name for the Citrix Gateway virtual server. 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. Can be changed after the virtual server is created. .EXAMPLE PS C:\>Invoke-NSDisableVpnvserver -name <string> An example how to disable vpnvserver config Object(s). .NOTES File Name : Invoke-NSDisableVpnvserver Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver/ Requires : PowerShell v5.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]$Name ) begin { Write-Verbose "Invoke-NSDisableVpnvserver: Starting" } process { try { $payload = @{ name = $name } if ( $PSCmdlet.ShouldProcess($Name, "Disable Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type vpnvserver -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-NSDisableVpnvserver: Finished" } } function Invoke-NSRenameVpnvserver { <# .SYNOPSIS Rename Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN virtual server resource. .PARAMETER Name Name for the Citrix Gateway virtual server. 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. Can be changed after the virtual server is created. .PARAMETER Newname New name for the Citrix Gateway virtual server. 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 vpnvserver item. .EXAMPLE PS C:\>Invoke-NSRenameVpnvserver -name <string> -newname <string> An example how to rename vpnvserver config Object(s). .NOTES File Name : Invoke-NSRenameVpnvserver Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver/ Requires : PowerShell v5.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]$Name, [Parameter(Mandatory)] [ValidateScript({ $_.Length -gt 1 })] [ValidatePattern('^(?>(?>[a-zA-Z0-9]|[_])+(?>[\x00-\x7F]|[_]|[#]|[.][ ]|[:]|[@]|[=]|[-])*)$')] [string]$Newname, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSRenameVpnvserver: Starting" } process { try { $payload = @{ name = $name newname = $newname } if ( $PSCmdlet.ShouldProcess("vpnvserver", "Rename Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type vpnvserver -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-NSGetVpnvserver -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSRenameVpnvserver: Finished" } } function Invoke-NSCheckVpnvserver { <# .SYNOPSIS Check Virtual Private Network configuration. config Object. .DESCRIPTION Configuration for VPN virtual server resource. .PARAMETER Name Name for the Citrix Gateway virtual server. 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. Can be changed after the virtual server is created. .EXAMPLE PS C:\>Invoke-NSCheckVpnvserver -name <string> An example how to check vpnvserver config Object(s). .NOTES File Name : Invoke-NSCheckVpnvserver Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver/ Requires : PowerShell v5.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]$Name ) begin { Write-Verbose "Invoke-NSCheckVpnvserver: Starting" } process { try { $payload = @{ name = $name } if ( $PSCmdlet.ShouldProcess($Name, "Check Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method POST -NitroPath nitro/v1/config -Type vpnvserver -Action check -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-NSCheckVpnvserver: Finished" } } function Invoke-NSGetVpnvserver { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Configuration for VPN virtual server resource. .PARAMETER Name Name for the Citrix Gateway virtual server. 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. Can be changed after the virtual server is created. .PARAMETER GetAll Retrieve all vpnvserver object(s). .PARAMETER Count If specified, the count of the vpnvserver 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-NSGetVpnvserver Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserver -GetAll Get all vpnvserver data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserver -Count Get the number of vpnvserver objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserver -name <string> Get vpnvserver object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserver -Filter @{ 'name'='<value>' } Get vpnvserver data with a filter. .NOTES File Name : Invoke-NSGetVpnvserver Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver/ Requires : PowerShell v5.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]$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-NSGetVpnvserver: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ } Write-Verbose "Retrieving all vpnvserver objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver -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 vpnvserver objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver -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-NSGetVpnvserver: Ended" } } function Invoke-NSAddVpnvserverAaapreauthenticationpolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the aaapreauthenticationpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Priority Integer specifying the policy's priority. The lower the number, the higher the priority. Policies are evaluated in the order of their priority numbers. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. Expression or other value specifying the next policy to evaluate if the current policy evaluates to TRUE. Specify one of the following values: * NEXT - Evaluate the policy with the next higher priority number. * END - End policy evaluation. * An expression that evaluates to a number. If you specify an expression, the number to which it evaluates determines the next policy to evaluate, as follows: * If the expression evaluates to a higher numbered priority, the policy with that priority is evaluated next. * If the expression evaluates to the priority of the current policy, the policy with the next higher numbered priority is evaluated next. * If the expression evaluates to a number that is larger than the largest numbered priority, policy evaluation ends. An UNDEF event is triggered if: * The expression is invalid. * The expression evaluates to a priority number that is numerically lower than the current policy's priority. * The expression evaluates to a priority number that is between the current policy's priority number (say, 30) and the highest priority number (say, 100), but does not match any configured priority number (for example, the expression evaluates to the number 85). This example assumes that the priority number increments by 10 for every successive policy, and therefore a priority number of 85 does not exist in the policy label. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .PARAMETER PassThru Return details about the created vpnvserver_aaapreauthenticationpolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverAaapreauthenticationpolicyBinding -name <string> An example how to add vpnvserver_aaapreauthenticationpolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverAaapreauthenticationpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_aaapreauthenticationpolicy_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, [string]$Policy, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')] [string]$Bindpoint, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverAaapreauthenticationpolicyBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) } if ( $PSCmdlet.ShouldProcess("vpnvserver_aaapreauthenticationpolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_aaapreauthenticationpolicy_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-NSGetVpnvserverAaapreauthenticationpolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverAaapreauthenticationpolicyBinding: Finished" } } function Invoke-NSDeleteVpnvserverAaapreauthenticationpolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the aaapreauthenticationpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverAaapreauthenticationpolicyBinding -Name <string> An example how to delete vpnvserver_aaapreauthenticationpolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverAaapreauthenticationpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_aaapreauthenticationpolicy_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]$Policy, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Bindpoint ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverAaapreauthenticationpolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_aaapreauthenticationpolicy_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-NSDeleteVpnvserverAaapreauthenticationpolicyBinding: Finished" } } function Invoke-NSGetVpnvserverAaapreauthenticationpolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the aaapreauthenticationpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_aaapreauthenticationpolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_aaapreauthenticationpolicy_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-NSGetVpnvserverAaapreauthenticationpolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAaapreauthenticationpolicyBinding -GetAll Get all vpnvserver_aaapreauthenticationpolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAaapreauthenticationpolicyBinding -Count Get the number of vpnvserver_aaapreauthenticationpolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAaapreauthenticationpolicyBinding -name <string> Get vpnvserver_aaapreauthenticationpolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAaapreauthenticationpolicyBinding -Filter @{ 'name'='<value>' } Get vpnvserver_aaapreauthenticationpolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverAaapreauthenticationpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_aaapreauthenticationpolicy_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-NSGetVpnvserverAaapreauthenticationpolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_aaapreauthenticationpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_aaapreauthenticationpolicy_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 vpnvserver_aaapreauthenticationpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_aaapreauthenticationpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_aaapreauthenticationpolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_aaapreauthenticationpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_aaapreauthenticationpolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_aaapreauthenticationpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_aaapreauthenticationpolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_aaapreauthenticationpolicy_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-NSGetVpnvserverAaapreauthenticationpolicyBinding: Ended" } } function Invoke-NSAddVpnvserverAnalyticsprofileBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the analyticsprofile that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Analyticsprofile Name of the analytics profile bound to the VPN Vserver. .PARAMETER PassThru Return details about the created vpnvserver_analyticsprofile_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverAnalyticsprofileBinding -name <string> An example how to add vpnvserver_analyticsprofile_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverAnalyticsprofileBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_analyticsprofile_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, [string]$Analyticsprofile, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverAnalyticsprofileBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('analyticsprofile') ) { $payload.Add('analyticsprofile', $analyticsprofile) } if ( $PSCmdlet.ShouldProcess("vpnvserver_analyticsprofile_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_analyticsprofile_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-NSGetVpnvserverAnalyticsprofileBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverAnalyticsprofileBinding: Finished" } } function Invoke-NSDeleteVpnvserverAnalyticsprofileBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the analyticsprofile that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Analyticsprofile Name of the analytics profile bound to the VPN Vserver. .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverAnalyticsprofileBinding -Name <string> An example how to delete vpnvserver_analyticsprofile_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverAnalyticsprofileBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_analyticsprofile_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]$Analyticsprofile ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverAnalyticsprofileBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Analyticsprofile') ) { $arguments.Add('analyticsprofile', $Analyticsprofile) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_analyticsprofile_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-NSDeleteVpnvserverAnalyticsprofileBinding: Finished" } } function Invoke-NSGetVpnvserverAnalyticsprofileBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the analyticsprofile that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_analyticsprofile_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_analyticsprofile_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-NSGetVpnvserverAnalyticsprofileBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAnalyticsprofileBinding -GetAll Get all vpnvserver_analyticsprofile_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAnalyticsprofileBinding -Count Get the number of vpnvserver_analyticsprofile_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAnalyticsprofileBinding -name <string> Get vpnvserver_analyticsprofile_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAnalyticsprofileBinding -Filter @{ 'name'='<value>' } Get vpnvserver_analyticsprofile_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverAnalyticsprofileBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_analyticsprofile_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-NSGetVpnvserverAnalyticsprofileBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_analyticsprofile_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_analyticsprofile_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 vpnvserver_analyticsprofile_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_analyticsprofile_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_analyticsprofile_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_analyticsprofile_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_analyticsprofile_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_analyticsprofile_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_analyticsprofile_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_analyticsprofile_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-NSGetVpnvserverAnalyticsprofileBinding: Ended" } } function Invoke-NSAddVpnvserverAppcontrollerBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the appcontroller that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Appcontroller Configured App Controller server in XenMobile deployment. .PARAMETER PassThru Return details about the created vpnvserver_appcontroller_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverAppcontrollerBinding -name <string> An example how to add vpnvserver_appcontroller_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverAppcontrollerBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_appcontroller_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, [string]$Appcontroller, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverAppcontrollerBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('appcontroller') ) { $payload.Add('appcontroller', $appcontroller) } if ( $PSCmdlet.ShouldProcess("vpnvserver_appcontroller_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_appcontroller_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-NSGetVpnvserverAppcontrollerBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverAppcontrollerBinding: Finished" } } function Invoke-NSDeleteVpnvserverAppcontrollerBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the appcontroller that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Appcontroller Configured App Controller server in XenMobile deployment. .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverAppcontrollerBinding -Name <string> An example how to delete vpnvserver_appcontroller_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverAppcontrollerBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_appcontroller_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]$Appcontroller ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverAppcontrollerBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Appcontroller') ) { $arguments.Add('appcontroller', $Appcontroller) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_appcontroller_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-NSDeleteVpnvserverAppcontrollerBinding: Finished" } } function Invoke-NSGetVpnvserverAppcontrollerBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the appcontroller that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_appcontroller_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_appcontroller_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-NSGetVpnvserverAppcontrollerBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAppcontrollerBinding -GetAll Get all vpnvserver_appcontroller_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAppcontrollerBinding -Count Get the number of vpnvserver_appcontroller_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAppcontrollerBinding -name <string> Get vpnvserver_appcontroller_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAppcontrollerBinding -Filter @{ 'name'='<value>' } Get vpnvserver_appcontroller_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverAppcontrollerBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_appcontroller_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-NSGetVpnvserverAppcontrollerBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_appcontroller_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_appcontroller_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 vpnvserver_appcontroller_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_appcontroller_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_appcontroller_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_appcontroller_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_appcontroller_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_appcontroller_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_appcontroller_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_appcontroller_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-NSGetVpnvserverAppcontrollerBinding: Ended" } } function Invoke-NSAddVpnvserverAppflowpolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the appflowpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Priority Integer specifying the policy's priority. The lower the number, the higher the priority. Policies are evaluated in the order of their priority numbers. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Next priority expression. .PARAMETER Bindpoint Bindpoint to which the policy is bound. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .PARAMETER PassThru Return details about the created vpnvserver_appflowpolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverAppflowpolicyBinding -name <string> An example how to add vpnvserver_appflowpolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverAppflowpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_appflowpolicy_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, [string]$Policy, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')] [string]$Bindpoint, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverAppflowpolicyBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) } if ( $PSCmdlet.ShouldProcess("vpnvserver_appflowpolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_appflowpolicy_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-NSGetVpnvserverAppflowpolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverAppflowpolicyBinding: Finished" } } function Invoke-NSDeleteVpnvserverAppflowpolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the appflowpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Bindpoint Bindpoint to which the policy is bound. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverAppflowpolicyBinding -Name <string> An example how to delete vpnvserver_appflowpolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverAppflowpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_appflowpolicy_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]$Policy, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Bindpoint ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverAppflowpolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_appflowpolicy_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-NSDeleteVpnvserverAppflowpolicyBinding: Finished" } } function Invoke-NSGetVpnvserverAppflowpolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the appflowpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_appflowpolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_appflowpolicy_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-NSGetVpnvserverAppflowpolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAppflowpolicyBinding -GetAll Get all vpnvserver_appflowpolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAppflowpolicyBinding -Count Get the number of vpnvserver_appflowpolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAppflowpolicyBinding -name <string> Get vpnvserver_appflowpolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAppflowpolicyBinding -Filter @{ 'name'='<value>' } Get vpnvserver_appflowpolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverAppflowpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_appflowpolicy_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-NSGetVpnvserverAppflowpolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_appflowpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_appflowpolicy_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 vpnvserver_appflowpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_appflowpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_appflowpolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_appflowpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_appflowpolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_appflowpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_appflowpolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_appflowpolicy_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-NSGetVpnvserverAppflowpolicyBinding: Ended" } } function Invoke-NSAddVpnvserverAppfwpolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the appfwpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Priority Integer specifying the policy's priority. The lower the number, the higher the priority. Policies are evaluated in the order of their priority numbers. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Next priority expression. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .PARAMETER PassThru Return details about the created vpnvserver_appfwpolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverAppfwpolicyBinding -name <string> An example how to add vpnvserver_appfwpolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverAppfwpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_appfwpolicy_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, [string]$Policy, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')] [string]$Bindpoint, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverAppfwpolicyBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) } if ( $PSCmdlet.ShouldProcess("vpnvserver_appfwpolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_appfwpolicy_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-NSGetVpnvserverAppfwpolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverAppfwpolicyBinding: Finished" } } function Invoke-NSDeleteVpnvserverAppfwpolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the appfwpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverAppfwpolicyBinding -Name <string> An example how to delete vpnvserver_appfwpolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverAppfwpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_appfwpolicy_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]$Policy, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Bindpoint ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverAppfwpolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_appfwpolicy_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-NSDeleteVpnvserverAppfwpolicyBinding: Finished" } } function Invoke-NSGetVpnvserverAppfwpolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the appfwpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_appfwpolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_appfwpolicy_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-NSGetVpnvserverAppfwpolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAppfwpolicyBinding -GetAll Get all vpnvserver_appfwpolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAppfwpolicyBinding -Count Get the number of vpnvserver_appfwpolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAppfwpolicyBinding -name <string> Get vpnvserver_appfwpolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAppfwpolicyBinding -Filter @{ 'name'='<value>' } Get vpnvserver_appfwpolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverAppfwpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_appfwpolicy_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-NSGetVpnvserverAppfwpolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_appfwpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_appfwpolicy_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 vpnvserver_appfwpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_appfwpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_appfwpolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_appfwpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_appfwpolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_appfwpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_appfwpolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_appfwpolicy_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-NSGetVpnvserverAppfwpolicyBinding: Ended" } } function Invoke-NSAddVpnvserverAuditnslogpolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the auditnslogpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Priority Integer specifying the policy's priority. The lower the number, the higher the priority. Policies are evaluated in the order of their priority numbers. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. Expression or other value specifying the next policy to evaluate if the current policy evaluates to TRUE. Specify one of the following values: * NEXT - Evaluate the policy with the next higher priority number. * END - End policy evaluation. * An expression that evaluates to a number. If you specify an expression, the number to which it evaluates determines the next policy to evaluate, as follows: * If the expression evaluates to a higher numbered priority, the policy with that priority is evaluated next. * If the expression evaluates to the priority of the current policy, the policy with the next higher numbered priority is evaluated next. * If the expression evaluates to a number that is larger than the largest numbered priority, policy evaluation ends. An UNDEF event is triggered if: * The expression is invalid. * The expression evaluates to a priority number that is numerically lower than the current policy's priority. * The expression evaluates to a priority number that is between the current policy's priority number (say, 30) and the highest priority number (say, 100), but does not match any configured priority number (for example, the expression evaluates to the number 85). This example assumes that the priority number increments by 10 for every successive policy, and therefore a priority number of 85 does not exist in the policy label. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .PARAMETER PassThru Return details about the created vpnvserver_auditnslogpolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverAuditnslogpolicyBinding -name <string> An example how to add vpnvserver_auditnslogpolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverAuditnslogpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_auditnslogpolicy_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, [string]$Policy, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')] [string]$Bindpoint, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverAuditnslogpolicyBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) } if ( $PSCmdlet.ShouldProcess("vpnvserver_auditnslogpolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_auditnslogpolicy_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-NSGetVpnvserverAuditnslogpolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverAuditnslogpolicyBinding: Finished" } } function Invoke-NSDeleteVpnvserverAuditnslogpolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the auditnslogpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverAuditnslogpolicyBinding -Name <string> An example how to delete vpnvserver_auditnslogpolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverAuditnslogpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_auditnslogpolicy_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]$Policy, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Bindpoint ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverAuditnslogpolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_auditnslogpolicy_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-NSDeleteVpnvserverAuditnslogpolicyBinding: Finished" } } function Invoke-NSGetVpnvserverAuditnslogpolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the auditnslogpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_auditnslogpolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_auditnslogpolicy_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-NSGetVpnvserverAuditnslogpolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuditnslogpolicyBinding -GetAll Get all vpnvserver_auditnslogpolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuditnslogpolicyBinding -Count Get the number of vpnvserver_auditnslogpolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuditnslogpolicyBinding -name <string> Get vpnvserver_auditnslogpolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuditnslogpolicyBinding -Filter @{ 'name'='<value>' } Get vpnvserver_auditnslogpolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverAuditnslogpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_auditnslogpolicy_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-NSGetVpnvserverAuditnslogpolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_auditnslogpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_auditnslogpolicy_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 vpnvserver_auditnslogpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_auditnslogpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_auditnslogpolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_auditnslogpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_auditnslogpolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_auditnslogpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_auditnslogpolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_auditnslogpolicy_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-NSGetVpnvserverAuditnslogpolicyBinding: Ended" } } function Invoke-NSAddVpnvserverAuditsyslogpolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the auditsyslogpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Priority Integer specifying the policy's priority. The lower the number, the higher the priority. Policies are evaluated in the order of their priority numbers. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. Expression or other value specifying the next policy to evaluate if the current policy evaluates to TRUE. Specify one of the following values: * NEXT - Evaluate the policy with the next higher priority number. * END - End policy evaluation. * An expression that evaluates to a number. If you specify an expression, the number to which it evaluates determines the next policy to evaluate, as follows: * If the expression evaluates to a higher numbered priority, the policy with that priority is evaluated next. * If the expression evaluates to the priority of the current policy, the policy with the next higher numbered priority is evaluated next. * If the expression evaluates to a number that is larger than the largest numbered priority, policy evaluation ends. An UNDEF event is triggered if: * The expression is invalid. * The expression evaluates to a priority number that is numerically lower than the current policy's priority. * The expression evaluates to a priority number that is between the current policy's priority number (say, 30) and the highest priority number (say, 100), but does not match any configured priority number (for example, the expression evaluates to the number 85). This example assumes that the priority number increments by 10 for every successive policy, and therefore a priority number of 85 does not exist in the policy label. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .PARAMETER PassThru Return details about the created vpnvserver_auditsyslogpolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverAuditsyslogpolicyBinding -name <string> An example how to add vpnvserver_auditsyslogpolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverAuditsyslogpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_auditsyslogpolicy_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, [string]$Policy, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')] [string]$Bindpoint, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverAuditsyslogpolicyBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) } if ( $PSCmdlet.ShouldProcess("vpnvserver_auditsyslogpolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_auditsyslogpolicy_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-NSGetVpnvserverAuditsyslogpolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverAuditsyslogpolicyBinding: Finished" } } function Invoke-NSDeleteVpnvserverAuditsyslogpolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the auditsyslogpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverAuditsyslogpolicyBinding -Name <string> An example how to delete vpnvserver_auditsyslogpolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverAuditsyslogpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_auditsyslogpolicy_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]$Policy, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Bindpoint ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverAuditsyslogpolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_auditsyslogpolicy_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-NSDeleteVpnvserverAuditsyslogpolicyBinding: Finished" } } function Invoke-NSGetVpnvserverAuditsyslogpolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the auditsyslogpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_auditsyslogpolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_auditsyslogpolicy_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-NSGetVpnvserverAuditsyslogpolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuditsyslogpolicyBinding -GetAll Get all vpnvserver_auditsyslogpolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuditsyslogpolicyBinding -Count Get the number of vpnvserver_auditsyslogpolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuditsyslogpolicyBinding -name <string> Get vpnvserver_auditsyslogpolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuditsyslogpolicyBinding -Filter @{ 'name'='<value>' } Get vpnvserver_auditsyslogpolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverAuditsyslogpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_auditsyslogpolicy_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-NSGetVpnvserverAuditsyslogpolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_auditsyslogpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_auditsyslogpolicy_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 vpnvserver_auditsyslogpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_auditsyslogpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_auditsyslogpolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_auditsyslogpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_auditsyslogpolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_auditsyslogpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_auditsyslogpolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_auditsyslogpolicy_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-NSGetVpnvserverAuditsyslogpolicyBinding: Ended" } } function Invoke-NSAddVpnvserverAuthenticationcertpolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationcertpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Priority Integer specifying the policy's priority. The lower the number, the higher the priority. Policies are evaluated in the order of their priority numbers. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. Expression or other value specifying the next policy to evaluate if the current policy evaluates to TRUE. Specify one of the following values: * NEXT - Evaluate the policy with the next higher priority number. * END - End policy evaluation. * An expression that evaluates to a number. If you specify an expression, the number to which it evaluates determines the next policy to evaluate, as follows: * If the expression evaluates to a higher numbered priority, the policy with that priority is evaluated next. * If the expression evaluates to the priority of the current policy, the policy with the next higher numbered priority is evaluated next. * If the expression evaluates to a number that is larger than the largest numbered priority, policy evaluation ends. An UNDEF event is triggered if: * The expression is invalid. * The expression evaluates to a priority number that is numerically lower than the current policy's priority. * The expression evaluates to a priority number that is between the current policy's priority number (say, 30) and the highest priority number (say, 100), but does not match any configured priority number (for example, the expression evaluates to the number 85). This example assumes that the priority number increments by 10 for every successive policy, and therefore a priority number of 85 does not exist in the policy label. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .PARAMETER PassThru Return details about the created vpnvserver_authenticationcertpolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverAuthenticationcertpolicyBinding -name <string> An example how to add vpnvserver_authenticationcertpolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverAuthenticationcertpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationcertpolicy_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, [string]$Policy, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')] [string]$Bindpoint, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverAuthenticationcertpolicyBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) } if ( $PSCmdlet.ShouldProcess("vpnvserver_authenticationcertpolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_authenticationcertpolicy_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-NSGetVpnvserverAuthenticationcertpolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverAuthenticationcertpolicyBinding: Finished" } } function Invoke-NSDeleteVpnvserverAuthenticationcertpolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationcertpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverAuthenticationcertpolicyBinding -Name <string> An example how to delete vpnvserver_authenticationcertpolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverAuthenticationcertpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationcertpolicy_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]$Policy, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Bindpoint ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverAuthenticationcertpolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_authenticationcertpolicy_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-NSDeleteVpnvserverAuthenticationcertpolicyBinding: Finished" } } function Invoke-NSGetVpnvserverAuthenticationcertpolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the authenticationcertpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_authenticationcertpolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_authenticationcertpolicy_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-NSGetVpnvserverAuthenticationcertpolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationcertpolicyBinding -GetAll Get all vpnvserver_authenticationcertpolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationcertpolicyBinding -Count Get the number of vpnvserver_authenticationcertpolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationcertpolicyBinding -name <string> Get vpnvserver_authenticationcertpolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationcertpolicyBinding -Filter @{ 'name'='<value>' } Get vpnvserver_authenticationcertpolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverAuthenticationcertpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationcertpolicy_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-NSGetVpnvserverAuthenticationcertpolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_authenticationcertpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationcertpolicy_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 vpnvserver_authenticationcertpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationcertpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_authenticationcertpolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationcertpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_authenticationcertpolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationcertpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_authenticationcertpolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationcertpolicy_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-NSGetVpnvserverAuthenticationcertpolicyBinding: Ended" } } function Invoke-NSAddVpnvserverAuthenticationdfapolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationdfapolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Priority Integer specifying the policy's priority. The lower the number, the higher the priority. Policies are evaluated in the order of their priority numbers. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. Expression or other value specifying the next policy to evaluate if the current policy evaluates to TRUE. Specify one of the following values: * NEXT - Evaluate the policy with the next higher priority number. * END - End policy evaluation. * An expression that evaluates to a number. If you specify an expression, the number to which it evaluates determines the next policy to evaluate, as follows: * If the expression evaluates to a higher numbered priority, the policy with that priority is evaluated next. * If the expression evaluates to the priority of the current policy, the policy with the next higher numbered priority is evaluated next. * If the expression evaluates to a number that is larger than the largest numbered priority, policy evaluation ends. An UNDEF event is triggered if: * The expression is invalid. * The expression evaluates to a priority number that is numerically lower than the current policy's priority. * The expression evaluates to a priority number that is between the current policy's priority number (say, 30) and the highest priority number (say, 100), but does not match any configured priority number (for example, the expression evaluates to the number 85). This example assumes that the priority number increments by 10 for every successive policy, and therefore a priority number of 85 does not exist in the policy label. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .PARAMETER PassThru Return details about the created vpnvserver_authenticationdfapolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverAuthenticationdfapolicyBinding -name <string> An example how to add vpnvserver_authenticationdfapolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverAuthenticationdfapolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationdfapolicy_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, [string]$Policy, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')] [string]$Bindpoint, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverAuthenticationdfapolicyBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) } if ( $PSCmdlet.ShouldProcess("vpnvserver_authenticationdfapolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_authenticationdfapolicy_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-NSGetVpnvserverAuthenticationdfapolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverAuthenticationdfapolicyBinding: Finished" } } function Invoke-NSDeleteVpnvserverAuthenticationdfapolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationdfapolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverAuthenticationdfapolicyBinding -Name <string> An example how to delete vpnvserver_authenticationdfapolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverAuthenticationdfapolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationdfapolicy_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]$Policy, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Bindpoint ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverAuthenticationdfapolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_authenticationdfapolicy_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-NSDeleteVpnvserverAuthenticationdfapolicyBinding: Finished" } } function Invoke-NSGetVpnvserverAuthenticationdfapolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the authenticationdfapolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_authenticationdfapolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_authenticationdfapolicy_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-NSGetVpnvserverAuthenticationdfapolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationdfapolicyBinding -GetAll Get all vpnvserver_authenticationdfapolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationdfapolicyBinding -Count Get the number of vpnvserver_authenticationdfapolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationdfapolicyBinding -name <string> Get vpnvserver_authenticationdfapolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationdfapolicyBinding -Filter @{ 'name'='<value>' } Get vpnvserver_authenticationdfapolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverAuthenticationdfapolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationdfapolicy_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-NSGetVpnvserverAuthenticationdfapolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_authenticationdfapolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationdfapolicy_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 vpnvserver_authenticationdfapolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationdfapolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_authenticationdfapolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationdfapolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_authenticationdfapolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationdfapolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_authenticationdfapolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationdfapolicy_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-NSGetVpnvserverAuthenticationdfapolicyBinding: Ended" } } function Invoke-NSAddVpnvserverAuthenticationldappolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationldappolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Priority Integer specifying the policy's priority. The lower the number, the higher the priority. Policies are evaluated in the order of their priority numbers. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. Expression or other value specifying the next policy to evaluate if the current policy evaluates to TRUE. Specify one of the following values: * NEXT - Evaluate the policy with the next higher priority number. * END - End policy evaluation. * An expression that evaluates to a number. If you specify an expression, the number to which it evaluates determines the next policy to evaluate, as follows: * If the expression evaluates to a higher numbered priority, the policy with that priority is evaluated next. * If the expression evaluates to the priority of the current policy, the policy with the next higher numbered priority is evaluated next. * If the expression evaluates to a number that is larger than the largest numbered priority, policy evaluation ends. An UNDEF event is triggered if: * The expression is invalid. * The expression evaluates to a priority number that is numerically lower than the current policy's priority. * The expression evaluates to a priority number that is between the current policy's priority number (say, 30) and the highest priority number (say, 100), but does not match any configured priority number (for example, the expression evaluates to the number 85). This example assumes that the priority number increments by 10 for every successive policy, and therefore a priority number of 85 does not exist in the policy label. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .PARAMETER PassThru Return details about the created vpnvserver_authenticationldappolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverAuthenticationldappolicyBinding -name <string> An example how to add vpnvserver_authenticationldappolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverAuthenticationldappolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationldappolicy_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, [string]$Policy, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')] [string]$Bindpoint, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverAuthenticationldappolicyBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) } if ( $PSCmdlet.ShouldProcess("vpnvserver_authenticationldappolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_authenticationldappolicy_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-NSGetVpnvserverAuthenticationldappolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverAuthenticationldappolicyBinding: Finished" } } function Invoke-NSDeleteVpnvserverAuthenticationldappolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationldappolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverAuthenticationldappolicyBinding -Name <string> An example how to delete vpnvserver_authenticationldappolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverAuthenticationldappolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationldappolicy_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]$Policy, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Bindpoint ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverAuthenticationldappolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_authenticationldappolicy_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-NSDeleteVpnvserverAuthenticationldappolicyBinding: Finished" } } function Invoke-NSGetVpnvserverAuthenticationldappolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the authenticationldappolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_authenticationldappolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_authenticationldappolicy_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-NSGetVpnvserverAuthenticationldappolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationldappolicyBinding -GetAll Get all vpnvserver_authenticationldappolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationldappolicyBinding -Count Get the number of vpnvserver_authenticationldappolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationldappolicyBinding -name <string> Get vpnvserver_authenticationldappolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationldappolicyBinding -Filter @{ 'name'='<value>' } Get vpnvserver_authenticationldappolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverAuthenticationldappolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationldappolicy_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-NSGetVpnvserverAuthenticationldappolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_authenticationldappolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationldappolicy_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 vpnvserver_authenticationldappolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationldappolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_authenticationldappolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationldappolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_authenticationldappolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationldappolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_authenticationldappolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationldappolicy_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-NSGetVpnvserverAuthenticationldappolicyBinding: Ended" } } function Invoke-NSAddVpnvserverAuthenticationlocalpolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationlocalpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Priority Integer specifying the policy's priority. The lower the number, the higher the priority. Policies are evaluated in the order of their priority numbers. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. Expression or other value specifying the next policy to evaluate if the current policy evaluates to TRUE. Specify one of the following values: * NEXT - Evaluate the policy with the next higher priority number. * END - End policy evaluation. * An expression that evaluates to a number. If you specify an expression, the number to which it evaluates determines the next policy to evaluate, as follows: * If the expression evaluates to a higher numbered priority, the policy with that priority is evaluated next. * If the expression evaluates to the priority of the current policy, the policy with the next higher numbered priority is evaluated next. * If the expression evaluates to a number that is larger than the largest numbered priority, policy evaluation ends. An UNDEF event is triggered if: * The expression is invalid. * The expression evaluates to a priority number that is numerically lower than the current policy's priority. * The expression evaluates to a priority number that is between the current policy's priority number (say, 30) and the highest priority number (say, 100), but does not match any configured priority number (for example, the expression evaluates to the number 85). This example assumes that the priority number increments by 10 for every successive policy, and therefore a priority number of 85 does not exist in the policy label. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .PARAMETER PassThru Return details about the created vpnvserver_authenticationlocalpolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverAuthenticationlocalpolicyBinding -name <string> An example how to add vpnvserver_authenticationlocalpolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverAuthenticationlocalpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationlocalpolicy_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, [string]$Policy, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')] [string]$Bindpoint, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverAuthenticationlocalpolicyBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) } if ( $PSCmdlet.ShouldProcess("vpnvserver_authenticationlocalpolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_authenticationlocalpolicy_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-NSGetVpnvserverAuthenticationlocalpolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverAuthenticationlocalpolicyBinding: Finished" } } function Invoke-NSDeleteVpnvserverAuthenticationlocalpolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationlocalpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverAuthenticationlocalpolicyBinding -Name <string> An example how to delete vpnvserver_authenticationlocalpolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverAuthenticationlocalpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationlocalpolicy_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]$Policy, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Bindpoint ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverAuthenticationlocalpolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_authenticationlocalpolicy_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-NSDeleteVpnvserverAuthenticationlocalpolicyBinding: Finished" } } function Invoke-NSGetVpnvserverAuthenticationlocalpolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the authenticationlocalpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_authenticationlocalpolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_authenticationlocalpolicy_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-NSGetVpnvserverAuthenticationlocalpolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationlocalpolicyBinding -GetAll Get all vpnvserver_authenticationlocalpolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationlocalpolicyBinding -Count Get the number of vpnvserver_authenticationlocalpolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationlocalpolicyBinding -name <string> Get vpnvserver_authenticationlocalpolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationlocalpolicyBinding -Filter @{ 'name'='<value>' } Get vpnvserver_authenticationlocalpolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverAuthenticationlocalpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationlocalpolicy_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-NSGetVpnvserverAuthenticationlocalpolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_authenticationlocalpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationlocalpolicy_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 vpnvserver_authenticationlocalpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationlocalpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_authenticationlocalpolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationlocalpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_authenticationlocalpolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationlocalpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_authenticationlocalpolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationlocalpolicy_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-NSGetVpnvserverAuthenticationlocalpolicyBinding: Ended" } } function Invoke-NSAddVpnvserverAuthenticationloginschemapolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationloginschemapolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Priority Integer specifying the policy's priority. The lower the number, the higher the priority. Policies are evaluated in the order of their priority numbers. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Next priority expression. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .PARAMETER PassThru Return details about the created vpnvserver_authenticationloginschemapolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverAuthenticationloginschemapolicyBinding -name <string> An example how to add vpnvserver_authenticationloginschemapolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverAuthenticationloginschemapolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationloginschemapolicy_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, [string]$Policy, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')] [string]$Bindpoint, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverAuthenticationloginschemapolicyBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) } if ( $PSCmdlet.ShouldProcess("vpnvserver_authenticationloginschemapolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_authenticationloginschemapolicy_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-NSGetVpnvserverAuthenticationloginschemapolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverAuthenticationloginschemapolicyBinding: Finished" } } function Invoke-NSDeleteVpnvserverAuthenticationloginschemapolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationloginschemapolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverAuthenticationloginschemapolicyBinding -Name <string> An example how to delete vpnvserver_authenticationloginschemapolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverAuthenticationloginschemapolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationloginschemapolicy_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]$Policy, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Bindpoint ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverAuthenticationloginschemapolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_authenticationloginschemapolicy_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-NSDeleteVpnvserverAuthenticationloginschemapolicyBinding: Finished" } } function Invoke-NSGetVpnvserverAuthenticationloginschemapolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the authenticationloginschemapolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_authenticationloginschemapolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_authenticationloginschemapolicy_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-NSGetVpnvserverAuthenticationloginschemapolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationloginschemapolicyBinding -GetAll Get all vpnvserver_authenticationloginschemapolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationloginschemapolicyBinding -Count Get the number of vpnvserver_authenticationloginschemapolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationloginschemapolicyBinding -name <string> Get vpnvserver_authenticationloginschemapolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationloginschemapolicyBinding -Filter @{ 'name'='<value>' } Get vpnvserver_authenticationloginschemapolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverAuthenticationloginschemapolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationloginschemapolicy_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-NSGetVpnvserverAuthenticationloginschemapolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_authenticationloginschemapolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationloginschemapolicy_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 vpnvserver_authenticationloginschemapolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationloginschemapolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_authenticationloginschemapolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationloginschemapolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_authenticationloginschemapolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationloginschemapolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_authenticationloginschemapolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationloginschemapolicy_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-NSGetVpnvserverAuthenticationloginschemapolicyBinding: Ended" } } function Invoke-NSAddVpnvserverAuthenticationnegotiatepolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationnegotiatepolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Priority Integer specifying the policy's priority. The lower the number, the higher the priority. Policies are evaluated in the order of their priority numbers. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. Expression or other value specifying the next policy to evaluate if the current policy evaluates to TRUE. Specify one of the following values: * NEXT - Evaluate the policy with the next higher priority number. * END - End policy evaluation. * An expression that evaluates to a number. If you specify an expression, the number to which it evaluates determines the next policy to evaluate, as follows: * If the expression evaluates to a higher numbered priority, the policy with that priority is evaluated next. * If the expression evaluates to the priority of the current policy, the policy with the next higher numbered priority is evaluated next. * If the expression evaluates to a number that is larger than the largest numbered priority, policy evaluation ends. An UNDEF event is triggered if: * The expression is invalid. * The expression evaluates to a priority number that is numerically lower than the current policy's priority. * The expression evaluates to a priority number that is between the current policy's priority number (say, 30) and the highest priority number (say, 100), but does not match any configured priority number (for example, the expression evaluates to the number 85). This example assumes that the priority number increments by 10 for every successive policy, and therefore a priority number of 85 does not exist in the policy label. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .PARAMETER PassThru Return details about the created vpnvserver_authenticationnegotiatepolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverAuthenticationnegotiatepolicyBinding -name <string> An example how to add vpnvserver_authenticationnegotiatepolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverAuthenticationnegotiatepolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationnegotiatepolicy_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, [string]$Policy, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')] [string]$Bindpoint, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverAuthenticationnegotiatepolicyBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) } if ( $PSCmdlet.ShouldProcess("vpnvserver_authenticationnegotiatepolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_authenticationnegotiatepolicy_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-NSGetVpnvserverAuthenticationnegotiatepolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverAuthenticationnegotiatepolicyBinding: Finished" } } function Invoke-NSDeleteVpnvserverAuthenticationnegotiatepolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationnegotiatepolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverAuthenticationnegotiatepolicyBinding -Name <string> An example how to delete vpnvserver_authenticationnegotiatepolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverAuthenticationnegotiatepolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationnegotiatepolicy_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]$Policy, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Bindpoint ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverAuthenticationnegotiatepolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_authenticationnegotiatepolicy_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-NSDeleteVpnvserverAuthenticationnegotiatepolicyBinding: Finished" } } function Invoke-NSGetVpnvserverAuthenticationnegotiatepolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the authenticationnegotiatepolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_authenticationnegotiatepolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_authenticationnegotiatepolicy_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-NSGetVpnvserverAuthenticationnegotiatepolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationnegotiatepolicyBinding -GetAll Get all vpnvserver_authenticationnegotiatepolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationnegotiatepolicyBinding -Count Get the number of vpnvserver_authenticationnegotiatepolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationnegotiatepolicyBinding -name <string> Get vpnvserver_authenticationnegotiatepolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationnegotiatepolicyBinding -Filter @{ 'name'='<value>' } Get vpnvserver_authenticationnegotiatepolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverAuthenticationnegotiatepolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationnegotiatepolicy_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-NSGetVpnvserverAuthenticationnegotiatepolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_authenticationnegotiatepolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationnegotiatepolicy_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 vpnvserver_authenticationnegotiatepolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationnegotiatepolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_authenticationnegotiatepolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationnegotiatepolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_authenticationnegotiatepolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationnegotiatepolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_authenticationnegotiatepolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationnegotiatepolicy_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-NSGetVpnvserverAuthenticationnegotiatepolicyBinding: Ended" } } function Invoke-NSAddVpnvserverAuthenticationoauthidppolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationoauthidppolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Priority Integer specifying the policy's priority. The lower the number, the higher the priority. Policies are evaluated in the order of their priority numbers. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Next priority expression. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .PARAMETER PassThru Return details about the created vpnvserver_authenticationoauthidppolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverAuthenticationoauthidppolicyBinding -name <string> An example how to add vpnvserver_authenticationoauthidppolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverAuthenticationoauthidppolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationoauthidppolicy_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, [string]$Policy, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')] [string]$Bindpoint, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverAuthenticationoauthidppolicyBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) } if ( $PSCmdlet.ShouldProcess("vpnvserver_authenticationoauthidppolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_authenticationoauthidppolicy_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-NSGetVpnvserverAuthenticationoauthidppolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverAuthenticationoauthidppolicyBinding: Finished" } } function Invoke-NSDeleteVpnvserverAuthenticationoauthidppolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationoauthidppolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverAuthenticationoauthidppolicyBinding -Name <string> An example how to delete vpnvserver_authenticationoauthidppolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverAuthenticationoauthidppolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationoauthidppolicy_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]$Policy, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Bindpoint ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverAuthenticationoauthidppolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_authenticationoauthidppolicy_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-NSDeleteVpnvserverAuthenticationoauthidppolicyBinding: Finished" } } function Invoke-NSGetVpnvserverAuthenticationoauthidppolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the authenticationoauthidppolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_authenticationoauthidppolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_authenticationoauthidppolicy_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-NSGetVpnvserverAuthenticationoauthidppolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationoauthidppolicyBinding -GetAll Get all vpnvserver_authenticationoauthidppolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationoauthidppolicyBinding -Count Get the number of vpnvserver_authenticationoauthidppolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationoauthidppolicyBinding -name <string> Get vpnvserver_authenticationoauthidppolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationoauthidppolicyBinding -Filter @{ 'name'='<value>' } Get vpnvserver_authenticationoauthidppolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverAuthenticationoauthidppolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationoauthidppolicy_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-NSGetVpnvserverAuthenticationoauthidppolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_authenticationoauthidppolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationoauthidppolicy_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 vpnvserver_authenticationoauthidppolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationoauthidppolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_authenticationoauthidppolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationoauthidppolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_authenticationoauthidppolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationoauthidppolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_authenticationoauthidppolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationoauthidppolicy_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-NSGetVpnvserverAuthenticationoauthidppolicyBinding: Ended" } } function Invoke-NSAddVpnvserverAuthenticationpolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Priority Integer specifying the policy's priority. The lower the number, the higher the priority. Policies are evaluated in the order of their priority numbers. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. Expression or other value specifying the next policy to evaluate if the current policy evaluates to TRUE. Specify one of the following values: * NEXT - Evaluate the policy with the next higher priority number. * END - End policy evaluation. * An expression that evaluates to a number. If you specify an expression, the number to which it evaluates determines the next policy to evaluate, as follows: * If the expression evaluates to a higher numbered priority, the policy with that priority is evaluated next. * If the expression evaluates to the priority of the current policy, the policy with the next higher numbered priority is evaluated next. * If the expression evaluates to a number that is larger than the largest numbered priority, policy evaluation ends. An UNDEF event is triggered if: * The expression is invalid. * The expression evaluates to a priority number that is numerically lower than the current policy's priority. * The expression evaluates to a priority number that is between the current policy's priority number (say, 30) and the highest priority number (say, 100), but does not match any configured priority number (for example, the expression evaluates to the number 85). This example assumes that the priority number increments by 10 for every successive policy, and therefore a priority number of 85 does not exist in the policy label. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .PARAMETER PassThru Return details about the created vpnvserver_authenticationpolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverAuthenticationpolicyBinding -name <string> An example how to add vpnvserver_authenticationpolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverAuthenticationpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationpolicy_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, [string]$Policy, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')] [string]$Bindpoint, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverAuthenticationpolicyBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) } if ( $PSCmdlet.ShouldProcess("vpnvserver_authenticationpolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_authenticationpolicy_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-NSGetVpnvserverAuthenticationpolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverAuthenticationpolicyBinding: Finished" } } function Invoke-NSDeleteVpnvserverAuthenticationpolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverAuthenticationpolicyBinding -Name <string> An example how to delete vpnvserver_authenticationpolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverAuthenticationpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationpolicy_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]$Policy, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Bindpoint ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverAuthenticationpolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_authenticationpolicy_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-NSDeleteVpnvserverAuthenticationpolicyBinding: Finished" } } function Invoke-NSGetVpnvserverAuthenticationpolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the authenticationpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_authenticationpolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_authenticationpolicy_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-NSGetVpnvserverAuthenticationpolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationpolicyBinding -GetAll Get all vpnvserver_authenticationpolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationpolicyBinding -Count Get the number of vpnvserver_authenticationpolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationpolicyBinding -name <string> Get vpnvserver_authenticationpolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationpolicyBinding -Filter @{ 'name'='<value>' } Get vpnvserver_authenticationpolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverAuthenticationpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationpolicy_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-NSGetVpnvserverAuthenticationpolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_authenticationpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationpolicy_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 vpnvserver_authenticationpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_authenticationpolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_authenticationpolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_authenticationpolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationpolicy_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-NSGetVpnvserverAuthenticationpolicyBinding: Ended" } } function Invoke-NSAddVpnvserverAuthenticationradiuspolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationradiuspolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Priority Integer specifying the policy's priority. The lower the number, the higher the priority. Policies are evaluated in the order of their priority numbers. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. Expression or other value specifying the next policy to evaluate if the current policy evaluates to TRUE. Specify one of the following values: * NEXT - Evaluate the policy with the next higher priority number. * END - End policy evaluation. * An expression that evaluates to a number. If you specify an expression, the number to which it evaluates determines the next policy to evaluate, as follows: * If the expression evaluates to a higher numbered priority, the policy with that priority is evaluated next. * If the expression evaluates to the priority of the current policy, the policy with the next higher numbered priority is evaluated next. * If the expression evaluates to a number that is larger than the largest numbered priority, policy evaluation ends. An UNDEF event is triggered if: * The expression is invalid. * The expression evaluates to a priority number that is numerically lower than the current policy's priority. * The expression evaluates to a priority number that is between the current policy's priority number (say, 30) and the highest priority number (say, 100), but does not match any configured priority number (for example, the expression evaluates to the number 85). This example assumes that the priority number increments by 10 for every successive policy, and therefore a priority number of 85 does not exist in the policy label. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .PARAMETER PassThru Return details about the created vpnvserver_authenticationradiuspolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverAuthenticationradiuspolicyBinding -name <string> An example how to add vpnvserver_authenticationradiuspolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverAuthenticationradiuspolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationradiuspolicy_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, [string]$Policy, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')] [string]$Bindpoint, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverAuthenticationradiuspolicyBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) } if ( $PSCmdlet.ShouldProcess("vpnvserver_authenticationradiuspolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_authenticationradiuspolicy_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-NSGetVpnvserverAuthenticationradiuspolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverAuthenticationradiuspolicyBinding: Finished" } } function Invoke-NSDeleteVpnvserverAuthenticationradiuspolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationradiuspolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverAuthenticationradiuspolicyBinding -Name <string> An example how to delete vpnvserver_authenticationradiuspolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverAuthenticationradiuspolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationradiuspolicy_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]$Policy, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Bindpoint ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverAuthenticationradiuspolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_authenticationradiuspolicy_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-NSDeleteVpnvserverAuthenticationradiuspolicyBinding: Finished" } } function Invoke-NSGetVpnvserverAuthenticationradiuspolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the authenticationradiuspolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_authenticationradiuspolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_authenticationradiuspolicy_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-NSGetVpnvserverAuthenticationradiuspolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationradiuspolicyBinding -GetAll Get all vpnvserver_authenticationradiuspolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationradiuspolicyBinding -Count Get the number of vpnvserver_authenticationradiuspolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationradiuspolicyBinding -name <string> Get vpnvserver_authenticationradiuspolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationradiuspolicyBinding -Filter @{ 'name'='<value>' } Get vpnvserver_authenticationradiuspolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverAuthenticationradiuspolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationradiuspolicy_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-NSGetVpnvserverAuthenticationradiuspolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_authenticationradiuspolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationradiuspolicy_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 vpnvserver_authenticationradiuspolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationradiuspolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_authenticationradiuspolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationradiuspolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_authenticationradiuspolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationradiuspolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_authenticationradiuspolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationradiuspolicy_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-NSGetVpnvserverAuthenticationradiuspolicyBinding: Ended" } } function Invoke-NSAddVpnvserverAuthenticationsamlidppolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationsamlidppolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Priority Integer specifying the policy's priority. The lower the number, the higher the priority. Policies are evaluated in the order of their priority numbers. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Next priority expression. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .PARAMETER PassThru Return details about the created vpnvserver_authenticationsamlidppolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverAuthenticationsamlidppolicyBinding -name <string> An example how to add vpnvserver_authenticationsamlidppolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverAuthenticationsamlidppolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationsamlidppolicy_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, [string]$Policy, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')] [string]$Bindpoint, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverAuthenticationsamlidppolicyBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) } if ( $PSCmdlet.ShouldProcess("vpnvserver_authenticationsamlidppolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_authenticationsamlidppolicy_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-NSGetVpnvserverAuthenticationsamlidppolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverAuthenticationsamlidppolicyBinding: Finished" } } function Invoke-NSDeleteVpnvserverAuthenticationsamlidppolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationsamlidppolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverAuthenticationsamlidppolicyBinding -Name <string> An example how to delete vpnvserver_authenticationsamlidppolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverAuthenticationsamlidppolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationsamlidppolicy_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]$Policy, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Bindpoint ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverAuthenticationsamlidppolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_authenticationsamlidppolicy_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-NSDeleteVpnvserverAuthenticationsamlidppolicyBinding: Finished" } } function Invoke-NSGetVpnvserverAuthenticationsamlidppolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the authenticationsamlidppolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_authenticationsamlidppolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_authenticationsamlidppolicy_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-NSGetVpnvserverAuthenticationsamlidppolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationsamlidppolicyBinding -GetAll Get all vpnvserver_authenticationsamlidppolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationsamlidppolicyBinding -Count Get the number of vpnvserver_authenticationsamlidppolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationsamlidppolicyBinding -name <string> Get vpnvserver_authenticationsamlidppolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationsamlidppolicyBinding -Filter @{ 'name'='<value>' } Get vpnvserver_authenticationsamlidppolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverAuthenticationsamlidppolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationsamlidppolicy_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-NSGetVpnvserverAuthenticationsamlidppolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_authenticationsamlidppolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationsamlidppolicy_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 vpnvserver_authenticationsamlidppolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationsamlidppolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_authenticationsamlidppolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationsamlidppolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_authenticationsamlidppolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationsamlidppolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_authenticationsamlidppolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationsamlidppolicy_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-NSGetVpnvserverAuthenticationsamlidppolicyBinding: Ended" } } function Invoke-NSAddVpnvserverAuthenticationsamlpolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationsamlpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Priority Integer specifying the policy's priority. The lower the number, the higher the priority. Policies are evaluated in the order of their priority numbers. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. Expression or other value specifying the next policy to evaluate if the current policy evaluates to TRUE. Specify one of the following values: * NEXT - Evaluate the policy with the next higher priority number. * END - End policy evaluation. * An expression that evaluates to a number. If you specify an expression, the number to which it evaluates determines the next policy to evaluate, as follows: * If the expression evaluates to a higher numbered priority, the policy with that priority is evaluated next. * If the expression evaluates to the priority of the current policy, the policy with the next higher numbered priority is evaluated next. * If the expression evaluates to a number that is larger than the largest numbered priority, policy evaluation ends. An UNDEF event is triggered if: * The expression is invalid. * The expression evaluates to a priority number that is numerically lower than the current policy's priority. * The expression evaluates to a priority number that is between the current policy's priority number (say, 30) and the highest priority number (say, 100), but does not match any configured priority number (for example, the expression evaluates to the number 85). This example assumes that the priority number increments by 10 for every successive policy, and therefore a priority number of 85 does not exist in the policy label. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .PARAMETER PassThru Return details about the created vpnvserver_authenticationsamlpolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverAuthenticationsamlpolicyBinding -name <string> An example how to add vpnvserver_authenticationsamlpolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverAuthenticationsamlpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationsamlpolicy_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, [string]$Policy, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')] [string]$Bindpoint, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverAuthenticationsamlpolicyBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) } if ( $PSCmdlet.ShouldProcess("vpnvserver_authenticationsamlpolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_authenticationsamlpolicy_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-NSGetVpnvserverAuthenticationsamlpolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverAuthenticationsamlpolicyBinding: Finished" } } function Invoke-NSDeleteVpnvserverAuthenticationsamlpolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationsamlpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverAuthenticationsamlpolicyBinding -Name <string> An example how to delete vpnvserver_authenticationsamlpolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverAuthenticationsamlpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationsamlpolicy_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]$Policy, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Bindpoint ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverAuthenticationsamlpolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_authenticationsamlpolicy_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-NSDeleteVpnvserverAuthenticationsamlpolicyBinding: Finished" } } function Invoke-NSGetVpnvserverAuthenticationsamlpolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the authenticationsamlpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_authenticationsamlpolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_authenticationsamlpolicy_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-NSGetVpnvserverAuthenticationsamlpolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationsamlpolicyBinding -GetAll Get all vpnvserver_authenticationsamlpolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationsamlpolicyBinding -Count Get the number of vpnvserver_authenticationsamlpolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationsamlpolicyBinding -name <string> Get vpnvserver_authenticationsamlpolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationsamlpolicyBinding -Filter @{ 'name'='<value>' } Get vpnvserver_authenticationsamlpolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverAuthenticationsamlpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationsamlpolicy_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-NSGetVpnvserverAuthenticationsamlpolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_authenticationsamlpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationsamlpolicy_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 vpnvserver_authenticationsamlpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationsamlpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_authenticationsamlpolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationsamlpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_authenticationsamlpolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationsamlpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_authenticationsamlpolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationsamlpolicy_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-NSGetVpnvserverAuthenticationsamlpolicyBinding: Ended" } } function Invoke-NSAddVpnvserverAuthenticationtacacspolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationtacacspolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Priority Integer specifying the policy's priority. The lower the number, the higher the priority. Policies are evaluated in the order of their priority numbers. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. Expression or other value specifying the next policy to evaluate if the current policy evaluates to TRUE. Specify one of the following values: * NEXT - Evaluate the policy with the next higher priority number. * END - End policy evaluation. * An expression that evaluates to a number. If you specify an expression, the number to which it evaluates determines the next policy to evaluate, as follows: * If the expression evaluates to a higher numbered priority, the policy with that priority is evaluated next. * If the expression evaluates to the priority of the current policy, the policy with the next higher numbered priority is evaluated next. * If the expression evaluates to a number that is larger than the largest numbered priority, policy evaluation ends. An UNDEF event is triggered if: * The expression is invalid. * The expression evaluates to a priority number that is numerically lower than the current policy's priority. * The expression evaluates to a priority number that is between the current policy's priority number (say, 30) and the highest priority number (say, 100), but does not match any configured priority number (for example, the expression evaluates to the number 85). This example assumes that the priority number increments by 10 for every successive policy, and therefore a priority number of 85 does not exist in the policy label. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .PARAMETER PassThru Return details about the created vpnvserver_authenticationtacacspolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverAuthenticationtacacspolicyBinding -name <string> An example how to add vpnvserver_authenticationtacacspolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverAuthenticationtacacspolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationtacacspolicy_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, [string]$Policy, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')] [string]$Bindpoint, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverAuthenticationtacacspolicyBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) } if ( $PSCmdlet.ShouldProcess("vpnvserver_authenticationtacacspolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_authenticationtacacspolicy_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-NSGetVpnvserverAuthenticationtacacspolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverAuthenticationtacacspolicyBinding: Finished" } } function Invoke-NSDeleteVpnvserverAuthenticationtacacspolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationtacacspolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverAuthenticationtacacspolicyBinding -Name <string> An example how to delete vpnvserver_authenticationtacacspolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverAuthenticationtacacspolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationtacacspolicy_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]$Policy, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Bindpoint ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverAuthenticationtacacspolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_authenticationtacacspolicy_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-NSDeleteVpnvserverAuthenticationtacacspolicyBinding: Finished" } } function Invoke-NSGetVpnvserverAuthenticationtacacspolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the authenticationtacacspolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_authenticationtacacspolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_authenticationtacacspolicy_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-NSGetVpnvserverAuthenticationtacacspolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationtacacspolicyBinding -GetAll Get all vpnvserver_authenticationtacacspolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationtacacspolicyBinding -Count Get the number of vpnvserver_authenticationtacacspolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationtacacspolicyBinding -name <string> Get vpnvserver_authenticationtacacspolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationtacacspolicyBinding -Filter @{ 'name'='<value>' } Get vpnvserver_authenticationtacacspolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverAuthenticationtacacspolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationtacacspolicy_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-NSGetVpnvserverAuthenticationtacacspolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_authenticationtacacspolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationtacacspolicy_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 vpnvserver_authenticationtacacspolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationtacacspolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_authenticationtacacspolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationtacacspolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_authenticationtacacspolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationtacacspolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_authenticationtacacspolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationtacacspolicy_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-NSGetVpnvserverAuthenticationtacacspolicyBinding: Ended" } } function Invoke-NSAddVpnvserverAuthenticationwebauthpolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationwebauthpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Priority Integer specifying the policy's priority. The lower the number, the higher the priority. Policies are evaluated in the order of their priority numbers. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. Expression or other value specifying the next policy to evaluate if the current policy evaluates to TRUE. Specify one of the following values: * NEXT - Evaluate the policy with the next higher priority number. * END - End policy evaluation. * An expression that evaluates to a number. If you specify an expression, the number to which it evaluates determines the next policy to evaluate, as follows: * If the expression evaluates to a higher numbered priority, the policy with that priority is evaluated next. * If the expression evaluates to the priority of the current policy, the policy with the next higher numbered priority is evaluated next. * If the expression evaluates to a number that is larger than the largest numbered priority, policy evaluation ends. An UNDEF event is triggered if: * The expression is invalid. * The expression evaluates to a priority number that is numerically lower than the current policy's priority. * The expression evaluates to a priority number that is between the current policy's priority number (say, 30) and the highest priority number (say, 100), but does not match any configured priority number (for example, the expression evaluates to the number 85). This example assumes that the priority number increments by 10 for every successive policy, and therefore a priority number of 85 does not exist in the policy label. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .PARAMETER PassThru Return details about the created vpnvserver_authenticationwebauthpolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverAuthenticationwebauthpolicyBinding -name <string> An example how to add vpnvserver_authenticationwebauthpolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverAuthenticationwebauthpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationwebauthpolicy_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, [string]$Policy, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')] [string]$Bindpoint, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverAuthenticationwebauthpolicyBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) } if ( $PSCmdlet.ShouldProcess("vpnvserver_authenticationwebauthpolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_authenticationwebauthpolicy_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-NSGetVpnvserverAuthenticationwebauthpolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverAuthenticationwebauthpolicyBinding: Finished" } } function Invoke-NSDeleteVpnvserverAuthenticationwebauthpolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the authenticationwebauthpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverAuthenticationwebauthpolicyBinding -Name <string> An example how to delete vpnvserver_authenticationwebauthpolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverAuthenticationwebauthpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationwebauthpolicy_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]$Policy, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Bindpoint ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverAuthenticationwebauthpolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_authenticationwebauthpolicy_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-NSDeleteVpnvserverAuthenticationwebauthpolicyBinding: Finished" } } function Invoke-NSGetVpnvserverAuthenticationwebauthpolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the authenticationwebauthpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_authenticationwebauthpolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_authenticationwebauthpolicy_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-NSGetVpnvserverAuthenticationwebauthpolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationwebauthpolicyBinding -GetAll Get all vpnvserver_authenticationwebauthpolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationwebauthpolicyBinding -Count Get the number of vpnvserver_authenticationwebauthpolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationwebauthpolicyBinding -name <string> Get vpnvserver_authenticationwebauthpolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverAuthenticationwebauthpolicyBinding -Filter @{ 'name'='<value>' } Get vpnvserver_authenticationwebauthpolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverAuthenticationwebauthpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_authenticationwebauthpolicy_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-NSGetVpnvserverAuthenticationwebauthpolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_authenticationwebauthpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationwebauthpolicy_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 vpnvserver_authenticationwebauthpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationwebauthpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_authenticationwebauthpolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationwebauthpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_authenticationwebauthpolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationwebauthpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_authenticationwebauthpolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_authenticationwebauthpolicy_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-NSGetVpnvserverAuthenticationwebauthpolicyBinding: Ended" } } function Invoke-NSGetVpnvserverBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object which returns the resources bound to vpnvserver. .PARAMETER Name Name of the Citrix Gateway virtual server for which to show detailed information. .PARAMETER GetAll Retrieve all vpnvserver_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_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-NSGetVpnvserverBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverBinding -GetAll Get all vpnvserver_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverBinding -name <string> Get vpnvserver_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverBinding -Filter @{ 'name'='<value>' } Get vpnvserver_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_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-NSGetVpnvserverBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_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 vpnvserver_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_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-NSGetVpnvserverBinding: Ended" } } function Invoke-NSAddVpnvserverCachepolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the cachepolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Priority Integer specifying the policy's priority. The lower the number, the higher the priority. Policies are evaluated in the order of their priority numbers. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Next priority expression. .PARAMETER Bindpoint Bindpoint to which the policy is bound. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .PARAMETER PassThru Return details about the created vpnvserver_cachepolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverCachepolicyBinding -name <string> An example how to add vpnvserver_cachepolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverCachepolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_cachepolicy_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, [string]$Policy, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')] [string]$Bindpoint, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverCachepolicyBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) } if ( $PSCmdlet.ShouldProcess("vpnvserver_cachepolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_cachepolicy_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-NSGetVpnvserverCachepolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverCachepolicyBinding: Finished" } } function Invoke-NSDeleteVpnvserverCachepolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the cachepolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Bindpoint Bindpoint to which the policy is bound. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverCachepolicyBinding -Name <string> An example how to delete vpnvserver_cachepolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverCachepolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_cachepolicy_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]$Policy, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Bindpoint ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverCachepolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_cachepolicy_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-NSDeleteVpnvserverCachepolicyBinding: Finished" } } function Invoke-NSGetVpnvserverCachepolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the cachepolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_cachepolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_cachepolicy_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-NSGetVpnvserverCachepolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverCachepolicyBinding -GetAll Get all vpnvserver_cachepolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverCachepolicyBinding -Count Get the number of vpnvserver_cachepolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverCachepolicyBinding -name <string> Get vpnvserver_cachepolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverCachepolicyBinding -Filter @{ 'name'='<value>' } Get vpnvserver_cachepolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverCachepolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_cachepolicy_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-NSGetVpnvserverCachepolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_cachepolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_cachepolicy_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 vpnvserver_cachepolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_cachepolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_cachepolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_cachepolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_cachepolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_cachepolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_cachepolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_cachepolicy_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-NSGetVpnvserverCachepolicyBinding: Ended" } } function Invoke-NSAddVpnvserverCspolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the cspolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Priority Integer specifying the policy's priority. The lower the number, the higher the priority. Policies are evaluated in the order of their priority numbers. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Next priority expression. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .PARAMETER PassThru Return details about the created vpnvserver_cspolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverCspolicyBinding -name <string> An example how to add vpnvserver_cspolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverCspolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_cspolicy_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, [string]$Policy, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')] [string]$Bindpoint, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverCspolicyBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) } if ( $PSCmdlet.ShouldProcess("vpnvserver_cspolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_cspolicy_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-NSGetVpnvserverCspolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverCspolicyBinding: Finished" } } function Invoke-NSDeleteVpnvserverCspolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the cspolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverCspolicyBinding -Name <string> An example how to delete vpnvserver_cspolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverCspolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_cspolicy_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]$Policy, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Bindpoint ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverCspolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_cspolicy_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-NSDeleteVpnvserverCspolicyBinding: Finished" } } function Invoke-NSGetVpnvserverCspolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the cspolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_cspolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_cspolicy_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-NSGetVpnvserverCspolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverCspolicyBinding -GetAll Get all vpnvserver_cspolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverCspolicyBinding -Count Get the number of vpnvserver_cspolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverCspolicyBinding -name <string> Get vpnvserver_cspolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverCspolicyBinding -Filter @{ 'name'='<value>' } Get vpnvserver_cspolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverCspolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_cspolicy_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-NSGetVpnvserverCspolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_cspolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_cspolicy_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 vpnvserver_cspolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_cspolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_cspolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_cspolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_cspolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_cspolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_cspolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_cspolicy_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-NSGetVpnvserverCspolicyBinding: Ended" } } function Invoke-NSAddVpnvserverFeopolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the feopolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy Name of a policy to bind to the virtual server (for example, the name of an authentication, session, or endpoint analysis policy). .PARAMETER Priority Integer specifying the policy's priority. The lower the number, the higher the priority. Policies are evaluated in the order of their priority numbers. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Next priority expression. .PARAMETER Bindpoint Bindpoint to which the policy is bound. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .PARAMETER PassThru Return details about the created vpnvserver_feopolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverFeopolicyBinding -name <string> An example how to add vpnvserver_feopolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverFeopolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_feopolicy_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, [ValidateScript({ $_.Length -gt 1 })] [string]$Policy, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')] [string]$Bindpoint, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverFeopolicyBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) } if ( $PSCmdlet.ShouldProcess("vpnvserver_feopolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_feopolicy_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-NSGetVpnvserverFeopolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverFeopolicyBinding: Finished" } } function Invoke-NSDeleteVpnvserverFeopolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the feopolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy Name of a policy to bind to the virtual server (for example, the name of an authentication, session, or endpoint analysis policy). .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Bindpoint Bindpoint to which the policy is bound. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverFeopolicyBinding -Name <string> An example how to delete vpnvserver_feopolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverFeopolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_feopolicy_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]$Policy, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Bindpoint ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverFeopolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_feopolicy_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-NSDeleteVpnvserverFeopolicyBinding: Finished" } } function Invoke-NSGetVpnvserverFeopolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the feopolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_feopolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_feopolicy_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-NSGetVpnvserverFeopolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverFeopolicyBinding -GetAll Get all vpnvserver_feopolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverFeopolicyBinding -Count Get the number of vpnvserver_feopolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverFeopolicyBinding -name <string> Get vpnvserver_feopolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverFeopolicyBinding -Filter @{ 'name'='<value>' } Get vpnvserver_feopolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverFeopolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_feopolicy_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-NSGetVpnvserverFeopolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_feopolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_feopolicy_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 vpnvserver_feopolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_feopolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_feopolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_feopolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_feopolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_feopolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_feopolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_feopolicy_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-NSGetVpnvserverFeopolicyBinding: Ended" } } function Invoke-NSAddVpnvserverIcapolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the icapolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Priority Integer specifying the policy's priority. The lower the number, the higher the priority. Policies are evaluated in the order of their priority numbers. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Next priority expression. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .PARAMETER PassThru Return details about the created vpnvserver_icapolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverIcapolicyBinding -name <string> An example how to add vpnvserver_icapolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverIcapolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_icapolicy_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, [string]$Policy, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')] [string]$Bindpoint, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverIcapolicyBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) } if ( $PSCmdlet.ShouldProcess("vpnvserver_icapolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_icapolicy_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-NSGetVpnvserverIcapolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverIcapolicyBinding: Finished" } } function Invoke-NSDeleteVpnvserverIcapolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the icapolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverIcapolicyBinding -Name <string> An example how to delete vpnvserver_icapolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverIcapolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_icapolicy_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]$Policy, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Bindpoint ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverIcapolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_icapolicy_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-NSDeleteVpnvserverIcapolicyBinding: Finished" } } function Invoke-NSGetVpnvserverIcapolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the icapolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_icapolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_icapolicy_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-NSGetVpnvserverIcapolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverIcapolicyBinding -GetAll Get all vpnvserver_icapolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverIcapolicyBinding -Count Get the number of vpnvserver_icapolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverIcapolicyBinding -name <string> Get vpnvserver_icapolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverIcapolicyBinding -Filter @{ 'name'='<value>' } Get vpnvserver_icapolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverIcapolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_icapolicy_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-NSGetVpnvserverIcapolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_icapolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_icapolicy_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 vpnvserver_icapolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_icapolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_icapolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_icapolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_icapolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_icapolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_icapolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_icapolicy_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-NSGetVpnvserverIcapolicyBinding: Ended" } } function Invoke-NSAddVpnvserverIntranetip6Binding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the intranetip6 that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Intranetip6 The network id for the range of intranet IP6 addresses or individual intranet ip to be bound to the vserver. .PARAMETER Numaddr The number of ipv6 addresses. .PARAMETER PassThru Return details about the created vpnvserver_intranetip6_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverIntranetip6Binding -name <string> An example how to add vpnvserver_intranetip6_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverIntranetip6Binding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_intranetip6_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, [string]$Intranetip6, [double]$Numaddr, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverIntranetip6Binding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('intranetip6') ) { $payload.Add('intranetip6', $intranetip6) } if ( $PSBoundParameters.ContainsKey('numaddr') ) { $payload.Add('numaddr', $numaddr) } if ( $PSCmdlet.ShouldProcess("vpnvserver_intranetip6_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_intranetip6_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-NSGetVpnvserverIntranetip6Binding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverIntranetip6Binding: Finished" } } function Invoke-NSDeleteVpnvserverIntranetip6Binding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the intranetip6 that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Intranetip6 The network id for the range of intranet IP6 addresses or individual intranet ip to be bound to the vserver. .PARAMETER Numaddr The number of ipv6 addresses. .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverIntranetip6Binding -Name <string> An example how to delete vpnvserver_intranetip6_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverIntranetip6Binding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_intranetip6_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]$Intranetip6, [double]$Numaddr ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverIntranetip6Binding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Intranetip6') ) { $arguments.Add('intranetip6', $Intranetip6) } if ( $PSBoundParameters.ContainsKey('Numaddr') ) { $arguments.Add('numaddr', $Numaddr) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_intranetip6_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-NSDeleteVpnvserverIntranetip6Binding: Finished" } } function Invoke-NSGetVpnvserverIntranetip6Binding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the intranetip6 that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_intranetip6_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_intranetip6_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-NSGetVpnvserverIntranetip6Binding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverIntranetip6Binding -GetAll Get all vpnvserver_intranetip6_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverIntranetip6Binding -Count Get the number of vpnvserver_intranetip6_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverIntranetip6Binding -name <string> Get vpnvserver_intranetip6_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverIntranetip6Binding -Filter @{ 'name'='<value>' } Get vpnvserver_intranetip6_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverIntranetip6Binding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_intranetip6_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-NSGetVpnvserverIntranetip6Binding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_intranetip6_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_intranetip6_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 vpnvserver_intranetip6_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_intranetip6_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_intranetip6_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_intranetip6_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_intranetip6_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_intranetip6_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_intranetip6_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_intranetip6_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-NSGetVpnvserverIntranetip6Binding: Ended" } } function Invoke-NSAddVpnvserverIntranetipBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the intranetip that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Intranetip The network ID for the range of intranet IP addresses or individual intranet IP addresses to be bound to the virtual server. .PARAMETER Netmask The netmask of the intranet IP address or range. .PARAMETER PassThru Return details about the created vpnvserver_intranetip_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverIntranetipBinding -name <string> An example how to add vpnvserver_intranetip_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverIntranetipBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_intranetip_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, [string]$Intranetip, [string]$Netmask, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverIntranetipBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('intranetip') ) { $payload.Add('intranetip', $intranetip) } if ( $PSBoundParameters.ContainsKey('netmask') ) { $payload.Add('netmask', $netmask) } if ( $PSCmdlet.ShouldProcess("vpnvserver_intranetip_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_intranetip_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-NSGetVpnvserverIntranetipBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverIntranetipBinding: Finished" } } function Invoke-NSDeleteVpnvserverIntranetipBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the intranetip that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Intranetip The network ID for the range of intranet IP addresses or individual intranet IP addresses to be bound to the virtual server. .PARAMETER Netmask The netmask of the intranet IP address or range. .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverIntranetipBinding -Name <string> An example how to delete vpnvserver_intranetip_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverIntranetipBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_intranetip_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]$Intranetip, [string]$Netmask ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverIntranetipBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Intranetip') ) { $arguments.Add('intranetip', $Intranetip) } if ( $PSBoundParameters.ContainsKey('Netmask') ) { $arguments.Add('netmask', $Netmask) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_intranetip_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-NSDeleteVpnvserverIntranetipBinding: Finished" } } function Invoke-NSGetVpnvserverIntranetipBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the intranetip that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_intranetip_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_intranetip_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-NSGetVpnvserverIntranetipBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverIntranetipBinding -GetAll Get all vpnvserver_intranetip_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverIntranetipBinding -Count Get the number of vpnvserver_intranetip_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverIntranetipBinding -name <string> Get vpnvserver_intranetip_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverIntranetipBinding -Filter @{ 'name'='<value>' } Get vpnvserver_intranetip_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverIntranetipBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_intranetip_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-NSGetVpnvserverIntranetipBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_intranetip_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_intranetip_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 vpnvserver_intranetip_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_intranetip_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_intranetip_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_intranetip_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_intranetip_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_intranetip_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_intranetip_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_intranetip_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-NSGetVpnvserverIntranetipBinding: Ended" } } function Invoke-NSAddVpnvserverResponderpolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the responderpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Priority Integer specifying the policy's priority. The lower the number, the higher the priority. Policies are evaluated in the order of their priority numbers. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Next priority expression. .PARAMETER Bindpoint Bindpoint to which the policy is bound. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .PARAMETER PassThru Return details about the created vpnvserver_responderpolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverResponderpolicyBinding -name <string> An example how to add vpnvserver_responderpolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverResponderpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_responderpolicy_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, [string]$Policy, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')] [string]$Bindpoint, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverResponderpolicyBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) } if ( $PSCmdlet.ShouldProcess("vpnvserver_responderpolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_responderpolicy_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-NSGetVpnvserverResponderpolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverResponderpolicyBinding: Finished" } } function Invoke-NSDeleteVpnvserverResponderpolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the responderpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Bindpoint Bindpoint to which the policy is bound. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverResponderpolicyBinding -Name <string> An example how to delete vpnvserver_responderpolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverResponderpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_responderpolicy_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]$Policy, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Bindpoint ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverResponderpolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_responderpolicy_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-NSDeleteVpnvserverResponderpolicyBinding: Finished" } } function Invoke-NSGetVpnvserverResponderpolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the responderpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_responderpolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_responderpolicy_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-NSGetVpnvserverResponderpolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverResponderpolicyBinding -GetAll Get all vpnvserver_responderpolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverResponderpolicyBinding -Count Get the number of vpnvserver_responderpolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverResponderpolicyBinding -name <string> Get vpnvserver_responderpolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverResponderpolicyBinding -Filter @{ 'name'='<value>' } Get vpnvserver_responderpolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverResponderpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_responderpolicy_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-NSGetVpnvserverResponderpolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_responderpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_responderpolicy_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 vpnvserver_responderpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_responderpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_responderpolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_responderpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_responderpolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_responderpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_responderpolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_responderpolicy_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-NSGetVpnvserverResponderpolicyBinding: Ended" } } function Invoke-NSAddVpnvserverRewritepolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the rewritepolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Priority Integer specifying the policy's priority. The lower the number, the higher the priority. Policies are evaluated in the order of their priority numbers. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Next priority expression. .PARAMETER Bindpoint Bindpoint to which the policy is bound. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .PARAMETER PassThru Return details about the created vpnvserver_rewritepolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverRewritepolicyBinding -name <string> An example how to add vpnvserver_rewritepolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverRewritepolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_rewritepolicy_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, [string]$Policy, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')] [string]$Bindpoint, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverRewritepolicyBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) } if ( $PSCmdlet.ShouldProcess("vpnvserver_rewritepolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_rewritepolicy_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-NSGetVpnvserverRewritepolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverRewritepolicyBinding: Finished" } } function Invoke-NSDeleteVpnvserverRewritepolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the rewritepolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Bindpoint Bindpoint to which the policy is bound. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverRewritepolicyBinding -Name <string> An example how to delete vpnvserver_rewritepolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverRewritepolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_rewritepolicy_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]$Policy, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Bindpoint ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverRewritepolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_rewritepolicy_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-NSDeleteVpnvserverRewritepolicyBinding: Finished" } } function Invoke-NSGetVpnvserverRewritepolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the rewritepolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_rewritepolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_rewritepolicy_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-NSGetVpnvserverRewritepolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverRewritepolicyBinding -GetAll Get all vpnvserver_rewritepolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverRewritepolicyBinding -Count Get the number of vpnvserver_rewritepolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverRewritepolicyBinding -name <string> Get vpnvserver_rewritepolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverRewritepolicyBinding -Filter @{ 'name'='<value>' } Get vpnvserver_rewritepolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverRewritepolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_rewritepolicy_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-NSGetVpnvserverRewritepolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_rewritepolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_rewritepolicy_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 vpnvserver_rewritepolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_rewritepolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_rewritepolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_rewritepolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_rewritepolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_rewritepolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_rewritepolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_rewritepolicy_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-NSGetVpnvserverRewritepolicyBinding: Ended" } } function Invoke-NSAddVpnvserverSharefileserverBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the sharefileserver that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Sharefile Configured ShareFile server in XenMobile deployment. Format IP:PORT / FQDN:PORT. .PARAMETER PassThru Return details about the created vpnvserver_sharefileserver_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverSharefileserverBinding -name <string> An example how to add vpnvserver_sharefileserver_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverSharefileserverBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_sharefileserver_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, [string]$Sharefile, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverSharefileserverBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('sharefile') ) { $payload.Add('sharefile', $sharefile) } if ( $PSCmdlet.ShouldProcess("vpnvserver_sharefileserver_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_sharefileserver_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-NSGetVpnvserverSharefileserverBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverSharefileserverBinding: Finished" } } function Invoke-NSDeleteVpnvserverSharefileserverBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the sharefileserver that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Sharefile Configured ShareFile server in XenMobile deployment. Format IP:PORT / FQDN:PORT. .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverSharefileserverBinding -Name <string> An example how to delete vpnvserver_sharefileserver_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverSharefileserverBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_sharefileserver_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]$Sharefile ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverSharefileserverBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Sharefile') ) { $arguments.Add('sharefile', $Sharefile) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_sharefileserver_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-NSDeleteVpnvserverSharefileserverBinding: Finished" } } function Invoke-NSGetVpnvserverSharefileserverBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the sharefileserver that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_sharefileserver_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_sharefileserver_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-NSGetVpnvserverSharefileserverBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverSharefileserverBinding -GetAll Get all vpnvserver_sharefileserver_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverSharefileserverBinding -Count Get the number of vpnvserver_sharefileserver_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverSharefileserverBinding -name <string> Get vpnvserver_sharefileserver_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverSharefileserverBinding -Filter @{ 'name'='<value>' } Get vpnvserver_sharefileserver_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverSharefileserverBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_sharefileserver_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-NSGetVpnvserverSharefileserverBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_sharefileserver_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_sharefileserver_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 vpnvserver_sharefileserver_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_sharefileserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_sharefileserver_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_sharefileserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_sharefileserver_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_sharefileserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_sharefileserver_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_sharefileserver_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-NSGetVpnvserverSharefileserverBinding: Ended" } } function Invoke-NSAddVpnvserverStaserverBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the staserver that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Staserver Configured Secure Ticketing Authority (STA) server. .PARAMETER Staaddresstype Type of the STA server address(ipv4/v6). Possible values = IPV4, IPV6 .PARAMETER PassThru Return details about the created vpnvserver_staserver_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverStaserverBinding -name <string> An example how to add vpnvserver_staserver_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverStaserverBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_staserver_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, [string]$Staserver, [ValidateSet('IPV4', 'IPV6')] [string]$Staaddresstype, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverStaserverBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('staserver') ) { $payload.Add('staserver', $staserver) } if ( $PSBoundParameters.ContainsKey('staaddresstype') ) { $payload.Add('staaddresstype', $staaddresstype) } if ( $PSCmdlet.ShouldProcess("vpnvserver_staserver_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_staserver_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-NSGetVpnvserverStaserverBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverStaserverBinding: Finished" } } function Invoke-NSDeleteVpnvserverStaserverBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the staserver that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Staserver Configured Secure Ticketing Authority (STA) server. .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverStaserverBinding -Name <string> An example how to delete vpnvserver_staserver_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverStaserverBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_staserver_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]$Staserver ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverStaserverBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Staserver') ) { $arguments.Add('staserver', $Staserver) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_staserver_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-NSDeleteVpnvserverStaserverBinding: Finished" } } function Invoke-NSGetVpnvserverStaserverBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the staserver that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_staserver_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_staserver_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-NSGetVpnvserverStaserverBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverStaserverBinding -GetAll Get all vpnvserver_staserver_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverStaserverBinding -Count Get the number of vpnvserver_staserver_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverStaserverBinding -name <string> Get vpnvserver_staserver_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverStaserverBinding -Filter @{ 'name'='<value>' } Get vpnvserver_staserver_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverStaserverBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_staserver_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-NSGetVpnvserverStaserverBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_staserver_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_staserver_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 vpnvserver_staserver_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_staserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_staserver_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_staserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_staserver_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_staserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_staserver_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_staserver_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-NSGetVpnvserverStaserverBinding: Ended" } } function Invoke-NSAddVpnvserverVpnclientlessaccesspolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnclientlessaccesspolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Priority Integer specifying the policy's priority. The lower the number, the higher the priority. Policies are evaluated in the order of their priority numbers. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Next priority expression. .PARAMETER Bindpoint Bindpoint to which the policy is bound. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .PARAMETER PassThru Return details about the created vpnvserver_vpnclientlessaccesspolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverVpnclientlessaccesspolicyBinding -name <string> An example how to add vpnvserver_vpnclientlessaccesspolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverVpnclientlessaccesspolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpnclientlessaccesspolicy_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, [string]$Policy, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')] [string]$Bindpoint, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverVpnclientlessaccesspolicyBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) } if ( $PSCmdlet.ShouldProcess("vpnvserver_vpnclientlessaccesspolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_vpnclientlessaccesspolicy_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-NSGetVpnvserverVpnclientlessaccesspolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverVpnclientlessaccesspolicyBinding: Finished" } } function Invoke-NSDeleteVpnvserverVpnclientlessaccesspolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnclientlessaccesspolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Bindpoint Bindpoint to which the policy is bound. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverVpnclientlessaccesspolicyBinding -Name <string> An example how to delete vpnvserver_vpnclientlessaccesspolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverVpnclientlessaccesspolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpnclientlessaccesspolicy_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]$Policy, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Bindpoint ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverVpnclientlessaccesspolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_vpnclientlessaccesspolicy_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-NSDeleteVpnvserverVpnclientlessaccesspolicyBinding: Finished" } } function Invoke-NSGetVpnvserverVpnclientlessaccesspolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the vpnclientlessaccesspolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_vpnclientlessaccesspolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_vpnclientlessaccesspolicy_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-NSGetVpnvserverVpnclientlessaccesspolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnclientlessaccesspolicyBinding -GetAll Get all vpnvserver_vpnclientlessaccesspolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnclientlessaccesspolicyBinding -Count Get the number of vpnvserver_vpnclientlessaccesspolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnclientlessaccesspolicyBinding -name <string> Get vpnvserver_vpnclientlessaccesspolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnclientlessaccesspolicyBinding -Filter @{ 'name'='<value>' } Get vpnvserver_vpnclientlessaccesspolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverVpnclientlessaccesspolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpnclientlessaccesspolicy_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-NSGetVpnvserverVpnclientlessaccesspolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_vpnclientlessaccesspolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnclientlessaccesspolicy_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 vpnvserver_vpnclientlessaccesspolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnclientlessaccesspolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_vpnclientlessaccesspolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnclientlessaccesspolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_vpnclientlessaccesspolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnclientlessaccesspolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_vpnclientlessaccesspolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnclientlessaccesspolicy_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-NSGetVpnvserverVpnclientlessaccesspolicyBinding: Ended" } } function Invoke-NSAddVpnvserverVpnepaprofileBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnepaprofile that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Epaprofile Advanced EPA profile to bind. .PARAMETER Epaprofileoptional Mark the EPA profile optional for preauthentication EPA profile. User would be shown a logon page even if the EPA profile fails to evaluate. .PARAMETER PassThru Return details about the created vpnvserver_vpnepaprofile_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverVpnepaprofileBinding -name <string> An example how to add vpnvserver_vpnepaprofile_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverVpnepaprofileBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpnepaprofile_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, [string]$Epaprofile, [boolean]$Epaprofileoptional, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverVpnepaprofileBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('epaprofile') ) { $payload.Add('epaprofile', $epaprofile) } if ( $PSBoundParameters.ContainsKey('epaprofileoptional') ) { $payload.Add('epaprofileoptional', $epaprofileoptional) } if ( $PSCmdlet.ShouldProcess("vpnvserver_vpnepaprofile_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_vpnepaprofile_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-NSGetVpnvserverVpnepaprofileBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverVpnepaprofileBinding: Finished" } } function Invoke-NSDeleteVpnvserverVpnepaprofileBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnepaprofile that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Epaprofile Advanced EPA profile to bind. .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverVpnepaprofileBinding -Name <string> An example how to delete vpnvserver_vpnepaprofile_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverVpnepaprofileBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpnepaprofile_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]$Epaprofile ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverVpnepaprofileBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Epaprofile') ) { $arguments.Add('epaprofile', $Epaprofile) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_vpnepaprofile_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-NSDeleteVpnvserverVpnepaprofileBinding: Finished" } } function Invoke-NSGetVpnvserverVpnepaprofileBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the vpnepaprofile that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_vpnepaprofile_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_vpnepaprofile_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-NSGetVpnvserverVpnepaprofileBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnepaprofileBinding -GetAll Get all vpnvserver_vpnepaprofile_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnepaprofileBinding -Count Get the number of vpnvserver_vpnepaprofile_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnepaprofileBinding -name <string> Get vpnvserver_vpnepaprofile_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnepaprofileBinding -Filter @{ 'name'='<value>' } Get vpnvserver_vpnepaprofile_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverVpnepaprofileBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpnepaprofile_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-NSGetVpnvserverVpnepaprofileBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_vpnepaprofile_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnepaprofile_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 vpnvserver_vpnepaprofile_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnepaprofile_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_vpnepaprofile_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnepaprofile_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_vpnepaprofile_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnepaprofile_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_vpnepaprofile_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnepaprofile_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-NSGetVpnvserverVpnepaprofileBinding: Ended" } } function Invoke-NSAddVpnvserverVpneulaBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpneula that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Eula Name of the EULA bound to VPN vserver. .PARAMETER PassThru Return details about the created vpnvserver_vpneula_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverVpneulaBinding -name <string> An example how to add vpnvserver_vpneula_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverVpneulaBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpneula_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, [string]$Eula, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverVpneulaBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('eula') ) { $payload.Add('eula', $eula) } if ( $PSCmdlet.ShouldProcess("vpnvserver_vpneula_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_vpneula_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-NSGetVpnvserverVpneulaBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverVpneulaBinding: Finished" } } function Invoke-NSDeleteVpnvserverVpneulaBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpneula that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Eula Name of the EULA bound to VPN vserver. .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverVpneulaBinding -Name <string> An example how to delete vpnvserver_vpneula_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverVpneulaBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpneula_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]$Eula ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverVpneulaBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Eula') ) { $arguments.Add('eula', $Eula) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_vpneula_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-NSDeleteVpnvserverVpneulaBinding: Finished" } } function Invoke-NSGetVpnvserverVpneulaBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the vpneula that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_vpneula_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_vpneula_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-NSGetVpnvserverVpneulaBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpneulaBinding -GetAll Get all vpnvserver_vpneula_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpneulaBinding -Count Get the number of vpnvserver_vpneula_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpneulaBinding -name <string> Get vpnvserver_vpneula_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpneulaBinding -Filter @{ 'name'='<value>' } Get vpnvserver_vpneula_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverVpneulaBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpneula_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-NSGetVpnvserverVpneulaBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_vpneula_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpneula_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 vpnvserver_vpneula_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpneula_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_vpneula_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpneula_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_vpneula_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpneula_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_vpneula_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpneula_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-NSGetVpnvserverVpneulaBinding: Ended" } } function Invoke-NSAddVpnvserverVpnintranetapplicationBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnintranetapplication that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Intranetapplication The intranet VPN application. .PARAMETER PassThru Return details about the created vpnvserver_vpnintranetapplication_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverVpnintranetapplicationBinding -name <string> An example how to add vpnvserver_vpnintranetapplication_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverVpnintranetapplicationBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpnintranetapplication_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, [string]$Intranetapplication, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverVpnintranetapplicationBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('intranetapplication') ) { $payload.Add('intranetapplication', $intranetapplication) } if ( $PSCmdlet.ShouldProcess("vpnvserver_vpnintranetapplication_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_vpnintranetapplication_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-NSGetVpnvserverVpnintranetapplicationBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverVpnintranetapplicationBinding: Finished" } } function Invoke-NSDeleteVpnvserverVpnintranetapplicationBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnintranetapplication that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Intranetapplication The intranet VPN application. .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverVpnintranetapplicationBinding -Name <string> An example how to delete vpnvserver_vpnintranetapplication_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverVpnintranetapplicationBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpnintranetapplication_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]$Intranetapplication ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverVpnintranetapplicationBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Intranetapplication') ) { $arguments.Add('intranetapplication', $Intranetapplication) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_vpnintranetapplication_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-NSDeleteVpnvserverVpnintranetapplicationBinding: Finished" } } function Invoke-NSGetVpnvserverVpnintranetapplicationBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the vpnintranetapplication that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_vpnintranetapplication_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_vpnintranetapplication_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-NSGetVpnvserverVpnintranetapplicationBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnintranetapplicationBinding -GetAll Get all vpnvserver_vpnintranetapplication_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnintranetapplicationBinding -Count Get the number of vpnvserver_vpnintranetapplication_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnintranetapplicationBinding -name <string> Get vpnvserver_vpnintranetapplication_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnintranetapplicationBinding -Filter @{ 'name'='<value>' } Get vpnvserver_vpnintranetapplication_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverVpnintranetapplicationBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpnintranetapplication_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-NSGetVpnvserverVpnintranetapplicationBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_vpnintranetapplication_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnintranetapplication_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 vpnvserver_vpnintranetapplication_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnintranetapplication_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_vpnintranetapplication_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnintranetapplication_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_vpnintranetapplication_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnintranetapplication_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_vpnintranetapplication_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnintranetapplication_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-NSGetVpnvserverVpnintranetapplicationBinding: Ended" } } function Invoke-NSAddVpnvserverVpnnexthopserverBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnnexthopserver that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Nexthopserver The name of the next hop server bound to the VPN virtual server. .PARAMETER PassThru Return details about the created vpnvserver_vpnnexthopserver_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverVpnnexthopserverBinding -name <string> An example how to add vpnvserver_vpnnexthopserver_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverVpnnexthopserverBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpnnexthopserver_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, [string]$Nexthopserver, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverVpnnexthopserverBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('nexthopserver') ) { $payload.Add('nexthopserver', $nexthopserver) } if ( $PSCmdlet.ShouldProcess("vpnvserver_vpnnexthopserver_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_vpnnexthopserver_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-NSGetVpnvserverVpnnexthopserverBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverVpnnexthopserverBinding: Finished" } } function Invoke-NSDeleteVpnvserverVpnnexthopserverBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnnexthopserver that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Nexthopserver The name of the next hop server bound to the VPN virtual server. .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverVpnnexthopserverBinding -Name <string> An example how to delete vpnvserver_vpnnexthopserver_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverVpnnexthopserverBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpnnexthopserver_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]$Nexthopserver ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverVpnnexthopserverBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Nexthopserver') ) { $arguments.Add('nexthopserver', $Nexthopserver) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_vpnnexthopserver_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-NSDeleteVpnvserverVpnnexthopserverBinding: Finished" } } function Invoke-NSGetVpnvserverVpnnexthopserverBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the vpnnexthopserver that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_vpnnexthopserver_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_vpnnexthopserver_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-NSGetVpnvserverVpnnexthopserverBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnnexthopserverBinding -GetAll Get all vpnvserver_vpnnexthopserver_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnnexthopserverBinding -Count Get the number of vpnvserver_vpnnexthopserver_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnnexthopserverBinding -name <string> Get vpnvserver_vpnnexthopserver_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnnexthopserverBinding -Filter @{ 'name'='<value>' } Get vpnvserver_vpnnexthopserver_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverVpnnexthopserverBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpnnexthopserver_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-NSGetVpnvserverVpnnexthopserverBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_vpnnexthopserver_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnnexthopserver_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 vpnvserver_vpnnexthopserver_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnnexthopserver_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_vpnnexthopserver_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnnexthopserver_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_vpnnexthopserver_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnnexthopserver_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_vpnnexthopserver_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnnexthopserver_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-NSGetVpnvserverVpnnexthopserverBinding: Ended" } } function Invoke-NSAddVpnvserverVpnportalthemeBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnportaltheme that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Portaltheme Name of the portal theme bound to VPN vserver. .PARAMETER PassThru Return details about the created vpnvserver_vpnportaltheme_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverVpnportalthemeBinding -name <string> An example how to add vpnvserver_vpnportaltheme_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverVpnportalthemeBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpnportaltheme_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, [string]$Portaltheme, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverVpnportalthemeBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('portaltheme') ) { $payload.Add('portaltheme', $portaltheme) } if ( $PSCmdlet.ShouldProcess("vpnvserver_vpnportaltheme_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_vpnportaltheme_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-NSGetVpnvserverVpnportalthemeBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverVpnportalthemeBinding: Finished" } } function Invoke-NSDeleteVpnvserverVpnportalthemeBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnportaltheme that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Portaltheme Name of the portal theme bound to VPN vserver. .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverVpnportalthemeBinding -Name <string> An example how to delete vpnvserver_vpnportaltheme_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverVpnportalthemeBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpnportaltheme_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]$Portaltheme ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverVpnportalthemeBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Portaltheme') ) { $arguments.Add('portaltheme', $Portaltheme) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_vpnportaltheme_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-NSDeleteVpnvserverVpnportalthemeBinding: Finished" } } function Invoke-NSGetVpnvserverVpnportalthemeBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the vpnportaltheme that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_vpnportaltheme_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_vpnportaltheme_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-NSGetVpnvserverVpnportalthemeBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnportalthemeBinding -GetAll Get all vpnvserver_vpnportaltheme_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnportalthemeBinding -Count Get the number of vpnvserver_vpnportaltheme_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnportalthemeBinding -name <string> Get vpnvserver_vpnportaltheme_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnportalthemeBinding -Filter @{ 'name'='<value>' } Get vpnvserver_vpnportaltheme_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverVpnportalthemeBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpnportaltheme_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-NSGetVpnvserverVpnportalthemeBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_vpnportaltheme_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnportaltheme_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 vpnvserver_vpnportaltheme_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnportaltheme_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_vpnportaltheme_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnportaltheme_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_vpnportaltheme_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnportaltheme_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_vpnportaltheme_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnportaltheme_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-NSGetVpnvserverVpnportalthemeBinding: Ended" } } function Invoke-NSAddVpnvserverVpnsessionpolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnsessionpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Priority Integer specifying the policy's priority. The lower the number, the higher the priority. Policies are evaluated in the order of their priority numbers. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. Expression or other value specifying the next policy to evaluate if the current policy evaluates to TRUE. Specify one of the following values: * NEXT - Evaluate the policy with the next higher priority number. * END - End policy evaluation. * An expression that evaluates to a number. If you specify an expression, the number to which it evaluates determines the next policy to evaluate, as follows: * If the expression evaluates to a higher numbered priority, the policy with that priority is evaluated next. * If the expression evaluates to the priority of the current policy, the policy with the next higher numbered priority is evaluated next. * If the expression evaluates to a number that is larger than the largest numbered priority, policy evaluation ends. An UNDEF event is triggered if: * The expression is invalid. * The expression evaluates to a priority number that is numerically lower than the current policy's priority. * The expression evaluates to a priority number that is between the current policy's priority number (say, 30) and the highest priority number (say, 100), but does not match any configured priority number (for example, the expression evaluates to the number 85). This example assumes that the priority number increments by 10 for every successive policy, and therefore a priority number of 85 does not exist in the policy label. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .PARAMETER PassThru Return details about the created vpnvserver_vpnsessionpolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverVpnsessionpolicyBinding -name <string> An example how to add vpnvserver_vpnsessionpolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverVpnsessionpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpnsessionpolicy_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, [string]$Policy, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')] [string]$Bindpoint, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverVpnsessionpolicyBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) } if ( $PSCmdlet.ShouldProcess("vpnvserver_vpnsessionpolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_vpnsessionpolicy_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-NSGetVpnvserverVpnsessionpolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverVpnsessionpolicyBinding: Finished" } } function Invoke-NSDeleteVpnvserverVpnsessionpolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnsessionpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverVpnsessionpolicyBinding -Name <string> An example how to delete vpnvserver_vpnsessionpolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverVpnsessionpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpnsessionpolicy_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]$Policy, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Bindpoint ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverVpnsessionpolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_vpnsessionpolicy_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-NSDeleteVpnvserverVpnsessionpolicyBinding: Finished" } } function Invoke-NSGetVpnvserverVpnsessionpolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the vpnsessionpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_vpnsessionpolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_vpnsessionpolicy_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-NSGetVpnvserverVpnsessionpolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnsessionpolicyBinding -GetAll Get all vpnvserver_vpnsessionpolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnsessionpolicyBinding -Count Get the number of vpnvserver_vpnsessionpolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnsessionpolicyBinding -name <string> Get vpnvserver_vpnsessionpolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnsessionpolicyBinding -Filter @{ 'name'='<value>' } Get vpnvserver_vpnsessionpolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverVpnsessionpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpnsessionpolicy_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-NSGetVpnvserverVpnsessionpolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_vpnsessionpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnsessionpolicy_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 vpnvserver_vpnsessionpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnsessionpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_vpnsessionpolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnsessionpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_vpnsessionpolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnsessionpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_vpnsessionpolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnsessionpolicy_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-NSGetVpnvserverVpnsessionpolicyBinding: Ended" } } function Invoke-NSAddVpnvserverVpntrafficpolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpntrafficpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Priority Integer specifying the policy's priority. The lower the number, the higher the priority. Policies are evaluated in the order of their priority numbers. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Applicable only to advance vpn session policy. Expression or other value specifying the next policy to evaluate if the current policy evaluates to TRUE. Specify one of the following values: * NEXT - Evaluate the policy with the next higher priority number. * END - End policy evaluation. * An expression that evaluates to a number. If you specify an expression, the number to which it evaluates determines the next policy to evaluate, as follows: * If the expression evaluates to a higher numbered priority, the policy with that priority is evaluated next. * If the expression evaluates to the priority of the current policy, the policy with the next higher numbered priority is evaluated next. * If the expression evaluates to a number that is larger than the largest numbered priority, policy evaluation ends. An UNDEF event is triggered if: * The expression is invalid. * The expression evaluates to a priority number that is numerically lower than the current policy's priority. * The expression evaluates to a priority number that is between the current policy's priority number (say, 30) and the highest priority number (say, 100), but does not match any configured priority number (for example, the expression evaluates to the number 85). This example assumes that the priority number increments by 10 for every successive policy, and therefore a priority number of 85 does not exist in the policy label. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .PARAMETER PassThru Return details about the created vpnvserver_vpntrafficpolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverVpntrafficpolicyBinding -name <string> An example how to add vpnvserver_vpntrafficpolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverVpntrafficpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpntrafficpolicy_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, [string]$Policy, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')] [string]$Bindpoint, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverVpntrafficpolicyBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) } if ( $PSCmdlet.ShouldProcess("vpnvserver_vpntrafficpolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_vpntrafficpolicy_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-NSGetVpnvserverVpntrafficpolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverVpntrafficpolicyBinding: Finished" } } function Invoke-NSDeleteVpnvserverVpntrafficpolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpntrafficpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverVpntrafficpolicyBinding -Name <string> An example how to delete vpnvserver_vpntrafficpolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverVpntrafficpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpntrafficpolicy_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]$Policy, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Bindpoint ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverVpntrafficpolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_vpntrafficpolicy_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-NSDeleteVpnvserverVpntrafficpolicyBinding: Finished" } } function Invoke-NSGetVpnvserverVpntrafficpolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the vpntrafficpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_vpntrafficpolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_vpntrafficpolicy_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-NSGetVpnvserverVpntrafficpolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpntrafficpolicyBinding -GetAll Get all vpnvserver_vpntrafficpolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpntrafficpolicyBinding -Count Get the number of vpnvserver_vpntrafficpolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpntrafficpolicyBinding -name <string> Get vpnvserver_vpntrafficpolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpntrafficpolicyBinding -Filter @{ 'name'='<value>' } Get vpnvserver_vpntrafficpolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverVpntrafficpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpntrafficpolicy_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-NSGetVpnvserverVpntrafficpolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_vpntrafficpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpntrafficpolicy_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 vpnvserver_vpntrafficpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpntrafficpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_vpntrafficpolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpntrafficpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_vpntrafficpolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpntrafficpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_vpntrafficpolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpntrafficpolicy_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-NSGetVpnvserverVpntrafficpolicyBinding: Ended" } } function Invoke-NSAddVpnvserverVpnurlBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnurl that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Urlname The intranet URL. .PARAMETER PassThru Return details about the created vpnvserver_vpnurl_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverVpnurlBinding -name <string> An example how to add vpnvserver_vpnurl_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverVpnurlBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpnurl_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, [string]$Urlname, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverVpnurlBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('urlname') ) { $payload.Add('urlname', $urlname) } if ( $PSCmdlet.ShouldProcess("vpnvserver_vpnurl_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_vpnurl_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-NSGetVpnvserverVpnurlBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverVpnurlBinding: Finished" } } function Invoke-NSDeleteVpnvserverVpnurlBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnurl that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Urlname The intranet URL. .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverVpnurlBinding -Name <string> An example how to delete vpnvserver_vpnurl_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverVpnurlBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpnurl_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]$Urlname ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverVpnurlBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Urlname') ) { $arguments.Add('urlname', $Urlname) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_vpnurl_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-NSDeleteVpnvserverVpnurlBinding: Finished" } } function Invoke-NSGetVpnvserverVpnurlBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the vpnurl that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_vpnurl_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_vpnurl_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-NSGetVpnvserverVpnurlBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnurlBinding -GetAll Get all vpnvserver_vpnurl_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnurlBinding -Count Get the number of vpnvserver_vpnurl_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnurlBinding -name <string> Get vpnvserver_vpnurl_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnurlBinding -Filter @{ 'name'='<value>' } Get vpnvserver_vpnurl_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverVpnurlBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpnurl_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-NSGetVpnvserverVpnurlBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_vpnurl_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnurl_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 vpnvserver_vpnurl_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnurl_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_vpnurl_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnurl_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_vpnurl_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnurl_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_vpnurl_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnurl_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-NSGetVpnvserverVpnurlBinding: Ended" } } function Invoke-NSAddVpnvserverVpnurlpolicyBinding { <# .SYNOPSIS Add Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnurlpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Priority Integer specifying the policy's priority. The lower the number, the higher the priority. Policies are evaluated in the order of their priority numbers. Maximum value for default syntax policies is 2147483647 and for classic policies is 64000. Maximum value = 2147483647 .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Gotopriorityexpression Next priority expression. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .PARAMETER PassThru Return details about the created vpnvserver_vpnurlpolicy_binding item. .EXAMPLE PS C:\>Invoke-NSAddVpnvserverVpnurlpolicyBinding -name <string> An example how to add vpnvserver_vpnurlpolicy_binding config Object(s). .NOTES File Name : Invoke-NSAddVpnvserverVpnurlpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpnurlpolicy_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, [string]$Policy, [double]$Priority, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Gotopriorityexpression, [ValidateSet('REQUEST', 'RESPONSE', 'ICA_REQUEST', 'OTHERTCP_REQUEST', 'AAA_REQUEST', 'AAA_RESPONSE')] [string]$Bindpoint, [Switch]$PassThru ) begin { Write-Verbose "Invoke-NSAddVpnvserverVpnurlpolicyBinding: Starting" } process { try { $payload = @{ name = $name } if ( $PSBoundParameters.ContainsKey('policy') ) { $payload.Add('policy', $policy) } if ( $PSBoundParameters.ContainsKey('priority') ) { $payload.Add('priority', $priority) } if ( $PSBoundParameters.ContainsKey('secondary') ) { $payload.Add('secondary', $secondary) } if ( $PSBoundParameters.ContainsKey('groupextraction') ) { $payload.Add('groupextraction', $groupextraction) } if ( $PSBoundParameters.ContainsKey('gotopriorityexpression') ) { $payload.Add('gotopriorityexpression', $gotopriorityexpression) } if ( $PSBoundParameters.ContainsKey('bindpoint') ) { $payload.Add('bindpoint', $bindpoint) } if ( $PSCmdlet.ShouldProcess("vpnvserver_vpnurlpolicy_binding", "Add Virtual Private Network configuration. config Object") ) { $result = Invoke-NSNitroApi -NSSession $NSSession -Method PUT -NitroPath nitro/v1/config -Type vpnvserver_vpnurlpolicy_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-NSGetVpnvserverVpnurlpolicyBinding -Filter $payload) } else { Write-Output $result } } } catch { Write-Verbose "ERROR: $($_.Exception.Message)" throw $_ } } end { Write-Verbose "Invoke-NSAddVpnvserverVpnurlpolicyBinding: Finished" } } function Invoke-NSDeleteVpnvserverVpnurlpolicyBinding { <# .SYNOPSIS Delete Virtual Private Network configuration. config Object. .DESCRIPTION Binding object showing the vpnurlpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER Policy The name of the policy, if any, bound to the VPN virtual server. .PARAMETER Secondary Binds the authentication policy as the secondary policy to use in a two-factor configuration. A user must then authenticate not only via a primary authentication method but also via a secondary authentication method. User groups are aggregated across both. The user name must be exactly the same for both authentication methods, but they can require different passwords. .PARAMETER Groupextraction Binds the authentication policy to a tertiary chain which will be used only for group extraction. The user will not authenticate against this server, and this will only be called if primary and/or secondary authentication has succeeded. .PARAMETER Bindpoint Bind point to which to bind the policy. Applies only to rewrite and cache policies. If you do not set this parameter, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or a request-time expression. Possible values = REQUEST, RESPONSE, ICA_REQUEST, OTHERTCP_REQUEST, AAA_REQUEST, AAA_RESPONSE .EXAMPLE PS C:\>Invoke-NSDeleteVpnvserverVpnurlpolicyBinding -Name <string> An example how to delete vpnvserver_vpnurlpolicy_binding config Object(s). .NOTES File Name : Invoke-NSDeleteVpnvserverVpnurlpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpnurlpolicy_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]$Policy, [boolean]$Secondary, [boolean]$Groupextraction, [string]$Bindpoint ) begin { Write-Verbose "Invoke-NSDeleteVpnvserverVpnurlpolicyBinding: Starting" } process { try { $arguments = @{ } if ( $PSBoundParameters.ContainsKey('Policy') ) { $arguments.Add('policy', $Policy) } if ( $PSBoundParameters.ContainsKey('Secondary') ) { $arguments.Add('secondary', $Secondary) } if ( $PSBoundParameters.ContainsKey('Groupextraction') ) { $arguments.Add('groupextraction', $Groupextraction) } if ( $PSBoundParameters.ContainsKey('Bindpoint') ) { $arguments.Add('bindpoint', $Bindpoint) } if ( $PSCmdlet.ShouldProcess("$name", "Delete Virtual Private Network configuration. config Object") ) { $response = Invoke-NSNitroApi -NSSession $NSSession -Method DELETE -Type vpnvserver_vpnurlpolicy_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-NSDeleteVpnvserverVpnurlpolicyBinding: Finished" } } function Invoke-NSGetVpnvserverVpnurlpolicyBinding { <# .SYNOPSIS Get Virtual Private Network configuration. config object(s). .DESCRIPTION Binding object showing the vpnurlpolicy that can be bound to vpnvserver. .PARAMETER Name Name of the virtual server. .PARAMETER GetAll Retrieve all vpnvserver_vpnurlpolicy_binding object(s). .PARAMETER Count If specified, the count of the vpnvserver_vpnurlpolicy_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-NSGetVpnvserverVpnurlpolicyBinding Get data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnurlpolicyBinding -GetAll Get all vpnvserver_vpnurlpolicy_binding data. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnurlpolicyBinding -Count Get the number of vpnvserver_vpnurlpolicy_binding objects. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnurlpolicyBinding -name <string> Get vpnvserver_vpnurlpolicy_binding object by specifying for example the name. .EXAMPLE PS C:\>Invoke-NSGetVpnvserverVpnurlpolicyBinding -Filter @{ 'name'='<value>' } Get vpnvserver_vpnurlpolicy_binding data with a filter. .NOTES File Name : Invoke-NSGetVpnvserverVpnurlpolicyBinding Version : v2311.2021 Author : John Billekens Reference : https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpnvserver_vpnurlpolicy_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-NSGetVpnvserverVpnurlpolicyBinding: Beginning" } process { try { if ( $PsCmdlet.ParameterSetName -eq 'GetAll' ) { $query = @{ bulkbindings = 'yes' } Write-Verbose "Retrieving all vpnvserver_vpnurlpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnurlpolicy_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 vpnvserver_vpnurlpolicy_binding objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnurlpolicy_binding -NitroPath nitro/v1/config -Query $query -Summary:$ViewSummary -Filter $Filter -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByArgument' ) { Write-Verbose "Retrieving vpnvserver_vpnurlpolicy_binding objects by arguments" $arguments = @{ } $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnurlpolicy_binding -NitroPath nitro/v1/config -Arguments $arguments -GetWarning } elseif ( $PsCmdlet.ParameterSetName -eq 'GetByResource' ) { Write-Verbose "Retrieving vpnvserver_vpnurlpolicy_binding configuration for property 'name'" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnurlpolicy_binding -NitroPath nitro/v1/config -Resource $name -Summary:$ViewSummary -Filter $Filter -GetWarning } else { Write-Verbose "Retrieving vpnvserver_vpnurlpolicy_binding configuration objects" $response = Invoke-NSNitroApi -NSSession $NSSession -Method GET -Type vpnvserver_vpnurlpolicy_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-NSGetVpnvserverVpnurlpolicyBinding: Ended" } } # SIG # Begin signature block # MIIkmgYJKoZIhvcNAQcCoIIkizCCJIcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDT9cLnKSS9NsVI # noxhS30uW5i8Lcc5dePeXq6NSvqYMqCCHl4wggTzMIID26ADAgECAhAsJ03zZBC0 # 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 # hkiG9w0BCQQxIgQgpMZfxMoruwJEFSfmVL5qedKFO7KenBkGlqUkC48fMt4wDQYJ # KoZIhvcNAQEBBQAEggEAZqjlKht/xOK3kyLfk2ZbjC1B8pZzFKrmFGsGI90mzn7J # vuk2mKRx4HBIWCfVLVqqACKks0lYGzBicocb4ny+Hcssu474vG44Fevh0mgItXZg # ekNWcwj9Cv+GVn0jM4RvSJVBsiPb7sF2YWnIM7ToWyGOxqCjtwkNcaAQkKQW0FNj # DCyioGZYmbLBkJ4cYSUHi+ZthjlyJdNGzmoy2xGnMXi0/hcZI/MponnLkhfnosjS # LQedpOWTqQTLSQdMmJL/ZEi66nzKzGe0DKTxppefkwOrZ5QnWxJXPxpLWbf+uU6u # vHCijnL7jY46EidJNe0zy2Un15RWwBROkE/JAmLyHKGCA0swggNHBgkqhkiG9w0B # CQYxggM4MIIDNAIBATCBkTB9MQswCQYDVQQGEwJHQjEbMBkGA1UECBMSR3JlYXRl # ciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRgwFgYDVQQKEw9TZWN0aWdv # IExpbWl0ZWQxJTAjBgNVBAMTHFNlY3RpZ28gUlNBIFRpbWUgU3RhbXBpbmcgQ0EC # EDlMJeF8oG0nqGXiO9kdItQwDQYJYIZIAWUDBAICBQCgeTAYBgkqhkiG9w0BCQMx # CwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0yMzExMjAyMDQ0MTZaMD8GCSqG # SIb3DQEJBDEyBDDlS6JX8vop0ngUhviSvGijScueWsZG0NVZ0OEIsUiOI3N0z/mL # nifb5DBgcbRhHhYwDQYJKoZIhvcNAQEBBQAEggIAcrVKkHM+yyVn+5ZAZzc+9qit # h3HZVuFeQX74X2YQNDhsV1PteAoPqP2QDAHy4iWeto9zxjlcIanyiQ49FoaykWGY # vphiaXZvm9A1U1fRMkb5qfv+o6E1/7hgezQB7ZRkh7QHYcMivLoEWsJCXVmsVk+c # EaRLLnXoPwgFPYKAb0BykBv36VLf+DihPR9kyIzy/W55+uoB3bzLm5Jt66VbtiIX # xhh/Vgxo2lrvvU1i4/8AYroA17NVK3MnnCfFnjShc3E4d1VIYhfZzhol6vcm1U2h # fGCA7HzEs2++s+uJz/fBPw2hjcGw4RY9DPa6Ihm0X+WxGla+ZEGuLBanJL0jIV+h # sxiUO7dUT8ClVcl/dW6e31KwRx1vUblmrNIE72sYqL/dW9/OFUSeg9KCaJg4DDp8 # OSJuXJdWaLbqm8zNiS3aFFUOHGcfES1ZbjDeRuE2+qqsDkNnT0d2heWPuV4J0K0y # LLjff03Qw7Pdx6EVVTX/rHym5rT/WsuCYrOVeWjZ+VNAWJwW+6uwvgf25RdgWwTp # 4zu79bjtR/wr50AUtBuw0m3CiAgTipWlXqOCgpyK5hhZgu3274DNlvc39quj18Eh # 8CQQHL2qlbwRQsJ9ZRY6RI+giOSAcUBQOh31VreltbUMp0jCbB4AAmf05qztzt9C # PdjbdsPUtO1Wmo8D2Aw= # SIG # End signature block |