Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional functionality, various resources #85

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 53 additions & 2 deletions NetScaler/NetScaler.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'NetScaler.psm1'

# Version number of this module.
ModuleVersion = '1.5.0'
ModuleVersion = '1.6.1'

# ID used to uniquely identify this module
GUID = 'bd4390dc-a8ad-4bce-8d69-f53ccf8e4163'
Expand Down Expand Up @@ -72,8 +72,13 @@ FunctionsToExport = @(
'Add-NSDnsNameServer',
'Add-NSDnsSuffix',
'Add-NSIPResource',
'Add-NSLBServiceGroupMemberBinding',
'Add-NSLBServiceGroupMonitorBinding',
'Add-NSLBServiceMonitorBinding',
'Add-NSLBSSLProfileToVserverBinding',
'Add-NSLBSSLVirtualServerCertificateBinding',
'Add-NSLBSSLVirtualServerCipherGroupBinding',
'Add-NSLBSSLVirtualServerCipherSuiteBinding',
'Add-NSLBVirtualServerBinding',
'Add-NSCSVirtualServerPolicyBinding',
'Add-NSLBVirtualServerResponderPolicyBinding',
Expand All @@ -83,6 +88,8 @@ FunctionsToExport = @(
'Add-NSServerCertificate',
'Add-NSSSLCertificateLink',
'Add-NSSystemFile',
'Add-NSVLAN',
'Add-NSVLANInterfaceBinding',
'Add-NSVPNVirtualServerBinding',
'Clear-NSAAASession',
'Clear-NSConfig',
Expand All @@ -105,6 +112,7 @@ FunctionsToExport = @(
'Get-NSAAAVirtualServer',
'Get-NSAvailableTimeZone',
'Get-NSBackup',
'Get-NSCertKeyPair',
'Get-NSConfig',
'Get-NSCSAction',
'Get-NSCSPolicy',
Expand All @@ -120,10 +128,14 @@ FunctionsToExport = @(
'Get-NSKCDAccount',
'Get-NSLBMonitor',
'Get-NSLBServer',
'Get-NSLBService',
'Get-NSLBServiceGroup',
'Get-NSLBServiceGroupMemberBinding',
'Get-NSLBServiceGroupMonitorBinding',
'Get-NSLBServiceMonitorBinding',
'Get-NSLBSSLVirtualServer',
'Get-NSLBSSLVirtualServerCipherGroupBinding',
'Get-NSLBSSLVirtualServerCipherSuiteBinding',
'Get-NSLBSSLVirtualServerCertificateBinding',
'Get-NSLBSSLVirtualServerProfile',
'Get-NSLBStat',
Expand All @@ -136,6 +148,7 @@ FunctionsToExport = @(
'Get-NSLDAPAuthenticationPolicy',
'Get-NSLDAPAuthenticationServer',
'Get-NSResponderAction',
'Get-NSResponderHTMLPage',
'Get-NSResponderPolicy',
'Get-NSRewriteAction',
'Get-NSRewritePolicy',
Expand All @@ -147,15 +160,20 @@ FunctionsToExport = @(
'Get-NSSSLCertificate',
'Get-NSSSLCertificateLink',
'Get-NSSSLProfile',
'Get-NSTCPProfile',
'Get-NSLBSSLProfileToVserverBinding',
'Get-NSSystemFile',
'Get-NSTimeZone',
'Get-NSVersion',
'Get-NSVLAN',
'Get-NSVLANBindings',
'Get-NSVPNServer',
'Get-NSVPNSessionPolicy',
'Get-NSVPNSessionProfile',
'Get-NSVPNVirtualServer',
'Get-NSVPNVirtualServerBinding',
'Get-NSVPNVirtualServerTheme',
'Import-NSCertFile',
'Install-NSLicense',
'Invoke-Nitro',
'New-NSBackup',
Expand All @@ -164,49 +182,82 @@ FunctionsToExport = @(
'New-NSKCDAccount',
'New-NSLBMonitor',
'New-NSLBServer',
'New-NSLBService',
'New-NSLBServiceGroup',
'New-NSLBServiceGroupMember',
'New-NSLBServiceGroupMonitor',
'New-NSLBVirtualServer',
'New-NSLDAPAuthenticationPolicy',
'New-NSLDAPAuthenticationServer',
'New-NSNTPServer',
'New-NSResponderAction',
'New-NSResponderHTMLPage',
'New-NSResponderPolicy',
'New-NSRewriteAction',
'New-NSRewritePolicy',
'New-NSNTPServer',
'New-NSSSLProfile',
'New-NSTCPProfile',
'New-NSVPNSessionPolicy',
'New-NSVPNSessionProfile',
'New-NSVPNVirtualServer',
'Remove-NSBackup',
'Remove-NSCertFile',
'Remove-NSCertKeyPair',
'Remove-NSDnsNameServer',
'Remove-NSDnsSuffix',
'Remove-NSIPResource',
'Remove-NSLBMonitor',
'Remove-NSLBServer',
'Remove-NSLBService',
'Remove-NSLBServiceGroup',
'Remove-NSLBServiceGroupMemberBinding',
'Remove-NSLBServiceGroupMonitorBinding',
'Remove-NSLBServiceMonitorBinding',
'Remove-NSLBVirtualServer',
'Remove-NSLBVirtualServerBinding',
'Remove-NSLBSSLVirtualServerCertificateBinding',
'Remove-NSLBSSLVirtualServerCipherGroupBinding',
'Remove-NSLBSSLVirtualServerCipherSuiteBinding',
'Remove-NSLBSSLVirtualServerProfile',
'Remove-NSLBVirtualServerResponderPolicyBinding',
'Remove-NSLDAPAuthenticationPolicy',
'Remove-NSLDAPAuthenticationServer',
'Remove-NSNTPServer',
'Remove-NSResponderAction',
'Remove-NSResponderHTMLPage',
'Remove-NSResponderPolicy',
'Remove-NSRewritePolicy',
'Remove-NSRewriteAction',
'Remove-NSSSLCertificateLink',
'Remove-NSSSLProfile',
'Remove-NSTCPProfile',
'Remove-NSLBSSLProfileToVserverBinding',
'Remove-NSSystemFile',
'Remove-NSVLAN',
'Remove-NSVLANInterfaceBinding',
'Remove-NSVPNSessionPolicy',
'Remove-NSVPNSessionProfile',
'Restart-NetScaler',
'Set-NSCertKeyPair',
'Save-NSConfig',
'Set-NSHostname',
'Set-NSIPResource',
'Set-NSLBMonitor',
'Set-NSLBServer',
'Set-NSLBService',
'Set-NSLBServiceGroup',
'Set-NSLBSSLVirtualServer',
'Set-NSLBSSLVirtualServerProfile',
'Set-NSLBVirtualServer',
'Set-NSMode',
'Set-NSNTPServer',
'Set-NSResponderAction',
'Set-NSResponderPolicy',
'Set-NSRewriteAction',
'Set-NSRewritePolicy',
'Set-NSSSLProfile',
'Set-NSTCPProfile',
'Set-NSVLAN',
'Set-NSTimeZone',
'Set-NSVPNVirtualServerTheme'
)
Expand Down
4 changes: 2 additions & 2 deletions NetScaler/Public/Add-NSCertKeyPair.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ function Add-NSCertKeyPair {
param(
$Session = $script:session,

[Parameter()]
[Parameter(Mandatory)]
[string]$CertKeyName,

[Parameter()]
[Parameter(Mandatory)]
[string]$CertPath,

[Parameter()]
Expand Down
53 changes: 51 additions & 2 deletions NetScaler/Public/Add-NSIPResource.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ function Add-NSIPResource {

Add IP address 10.10.10.10 to NetScaler.

.EXAMPLE
Add-NSIPResource -IPAddress 192.168.30.31 -SubnetMask 255.255.255.0 -Type SNIP -VServer -Telnet -FTP -SNMP -SSH -GUI

Add IP address 192.168.30.31 to NetScaler and disabled VServer,SSH, GUI and SNMP but enable but enable Telnet and FTP to Netscaler

.PARAMETER Session
The NetScaler session object.

Expand Down Expand Up @@ -66,6 +71,36 @@ function Add-NSIPResource {
Default value: ENABLED
Possible values = ENABLED, DISABLED

.PARAMETER Telnet
Use this option to set (enable or disable) the virtual server attribute for this IP address.

Default value: DISABLED
Possible values = ENABLED, DISABLED

.PARAMETER FTP
Use this option to set (enable or disable) the virtual server attribute for this IP address.

Default value: DISABLED
Possible values = ENABLED, DISABLED

.PARAMETER GUI
Use this option to set (enable or disable) the virtual server attribute for this IP address.

Default value: ENABLED
Possible values = ENABLED, DISABLED

.PARAMETER SSH
Use this option to set (enable or disable) the virtual server attribute for this IP address.

Default value: ENABLED
Possible values = ENABLED, DISABLED

.PARAMETER SNMP
Use this option to set (enable or disable) the virtual server attribute for this IP address.

Default value: ENABLED
Possible values = ENABLED, DISABLED

.PARAMETER MgmtAccess
Allow access to management applications on this IP address.

Expand All @@ -74,7 +109,6 @@ function Add-NSIPResource {
#>
[cmdletbinding(SupportsShouldProcess = $true, ConfirmImpact='Low')]
param(
[parameter(Mandatory)]
$Session = $script:session,

[parameter(Mandatory)]
Expand All @@ -89,6 +123,16 @@ function Add-NSIPResource {
[string]$Type = 'SNIP',

[switch]$VServer,

[switch]$Telnet,

[switch]$FTP,

[switch]$GUI,

[switch]$SSH,

[switch]$SNMP,

[switch]$MgmtAccess
)
Expand All @@ -106,7 +150,12 @@ function Add-NSIPResource {
netmask = $SubnetMask
type = $Type
vserver = if ($PSBoundParameters.ContainsKey('VServer')) { 'ENABLED' } else { 'DISABLED' }
mgmtaccess = if ($PSBoundParameters.ContainsKey('MgmtAccess')) { 'ENABLED' } else { 'DISABLED' }
telnet = if ($PSBoundParameters.ContainsKey('Telnet')) { 'DISABLED' } else { 'DISABLED' }
ftp = if ($PSBoundParameters.ContainsKey('FTP')) { 'DISABLED' } else { 'DISABLED' }
gui = if ($PSBoundParameters.ContainsKey('GUI')) { 'DISABLED' } else { 'ENABLED' }
ssh = if ($PSBoundParameters.ContainsKey('SSH')) { 'DISABLED' } else { 'ENABLED' }
snmp = if ($PSBoundParameters.ContainsKey('SNMP')) { 'DISABLED' } else { 'ENABLED' }
mgmtaccess = if ($PSBoundParameters.ContainsKey('MgmtAccess')) { 'DISABLED' } else { 'ENABLED' }
}
$response = _InvokeNSRestApi -Session $Session -Method POST -Type nsip -Payload $params -Action add
} catch {
Expand Down
72 changes: 72 additions & 0 deletions NetScaler/Public/Add-NSLBSSLProfileToVserverBinding.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<#
Copyright 2017 Juan C. Herrera

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#>

function Add-NSLBSSLProfileToVserverBinding {
<#
.SYNOPSIS
Bind a ssl profile bound to a vserver

.DESCRIPTION
Bind a ssl profile bound to a vserver

.EXAMPLE
Add-NSLBSSLProfileToVserverBinding -VirtualServerName 'somevserver' -SSLProfile 'somesslprofile'

Binds the ssl profile 'somesslprofile' to vserver 'somevserver'

.PARAMETER Session
The NetScaler session object.

.PARAMETER VirtualServerName
Name of the SSL virtual server for which to set advanced configuration.

.PARAMETER SSLProfile
SSL profile associated to vserver.
Minimum length = 1
Maximum length = 127
#>
[cmdletbinding(SupportsShouldProcess = $true, ConfirmImpact='Low')]
param(
$Session = $script:session,

[Parameter(Mandatory)]
[string]$VirtualServerName,

[Parameter(Mandatory)]
[ValidateLength(1,127)]
[string]$SSLProfile
)

begin {
_AssertSessionActive
}

process {
if ($PSCmdlet.ShouldProcess($VirtualServerName, "Bind ssl profile $SSLProfile to virtualserver $VirtualServerName")) {
try {
$params = @{
sslprofile = $SSLProfile
vservername = $VirtualServerName
}
$response = _InvokeNSRestApi -Session $Session -Method PUT -Type sslvserver -Payload $params -Action add
$response
}
catch {
throw $_
}
}
}
}
Loading