< Back
Set-LBRealServerState
Post
NAME Set-LBRealServerState
SYNOPSIS
Connects to a loadbalancer.org REST API to drain, halt or online a real server
SYNTAX
Set-LBRealServerState [-APIKey] <String> [-ConnectionURI] <String> [-VirtualService] <String> [-RealServer]
<String> [-Action] <String> [[-Credential] <PSCredential>] [<CommonParameters>]
DESCRIPTION
Connects to a loadbalancer.org REST API to drain, halt or online a real server
PARAMETERS
-APIKey <String>
API Key
Required? true
Position? 1
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-ConnectionURI <String>
Connection URI e.g. https://10.0.0.10:9443/api/
Required? true
Position? 2
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-VirtualService <String>
Virtual Service Name
Required? true
Position? 3
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-RealServer <String>
Real Server Name
Required? true
Position? 4
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-Action <String>
Action: drain, halt or online
Required? true
Position? 5
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-Credential <PSCredential>
PSCredential object containing the API username and password, prompts if omitted
Required? false
Position? 6
Default value (Get-Credential)
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
System.Int32
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Set-LBRealServerState -APIKey 'abc123' -ConnectionURI 'https://lbmaster.domain.local:9443/api/' -Credential
(get-credential loadbalancer) -VirtualService https1 -RealServer web01 -Action halt
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>$ApiKey = 'abc123'
$uri = 'https://lbmaster.domain.local:9443/api/'
$cred = New-Object System.Management.Automation.PSCredential -ArgumentList 'loadbalancer', (ConvertTo-SecureString
-AsPlainText 'loadbalancer' -Force)
Set-LBRealServerState -APIKey $ApiKey -ConnectionURI $uri -Credential $cred -VirtualService https1 -RealServer
web01 -Action halt
-------------------------- EXAMPLE 3 --------------------------
PS C:\\>Set-LBRealServerState -APIKey 'abc123' -ConnectionURI 'https://lbmaster.domain.local:9443/api/' -Credential
(get-credential loadbalancer) -VirtualService https1 -RealServer web01 -Action online
RELATED LINKS
SYNOPSIS
Connects to a loadbalancer.org REST API to drain, halt or online a real server
SYNTAX
Set-LBRealServerState [-APIKey] <String> [-ConnectionURI] <String> [-VirtualService] <String> [-RealServer]
<String> [-Action] <String> [[-Credential] <PSCredential>] [<CommonParameters>]
DESCRIPTION
Connects to a loadbalancer.org REST API to drain, halt or online a real server
PARAMETERS
-APIKey <String>
API Key
Required? true
Position? 1
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-ConnectionURI <String>
Connection URI e.g. https://10.0.0.10:9443/api/
Required? true
Position? 2
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-VirtualService <String>
Virtual Service Name
Required? true
Position? 3
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-RealServer <String>
Real Server Name
Required? true
Position? 4
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-Action <String>
Action: drain, halt or online
Required? true
Position? 5
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-Credential <PSCredential>
PSCredential object containing the API username and password, prompts if omitted
Required? false
Position? 6
Default value (Get-Credential)
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
System.Int32
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Set-LBRealServerState -APIKey 'abc123' -ConnectionURI 'https://lbmaster.domain.local:9443/api/' -Credential
(get-credential loadbalancer) -VirtualService https1 -RealServer web01 -Action halt
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>$ApiKey = 'abc123'
$uri = 'https://lbmaster.domain.local:9443/api/'
$cred = New-Object System.Management.Automation.PSCredential -ArgumentList 'loadbalancer', (ConvertTo-SecureString
-AsPlainText 'loadbalancer' -Force)
Set-LBRealServerState -APIKey $ApiKey -ConnectionURI $uri -Credential $cred -VirtualService https1 -RealServer
web01 -Action halt
-------------------------- EXAMPLE 3 --------------------------
PS C:\\>Set-LBRealServerState -APIKey 'abc123' -ConnectionURI 'https://lbmaster.domain.local:9443/api/' -Credential
(get-credential loadbalancer) -VirtualService https1 -RealServer web01 -Action online
RELATED LINKS