Invoke-IISSwapBindings
SYNOPSIS
Swap IIS bindings between two application pools.
SYNTAX
iisFarm
Invoke-IISSwapBindings -iisAppNameBlue <String> -iisAppNameGreen <String> [-iisFarm <String[]>]
-binding <String> -task <UInt64> [-test] [-timespent <Int32>] [<CommonParameters>]
iisServer
Invoke-IISSwapBindings -iisAppNameBlue <String> -iisAppNameGreen <String> [-iisServer <String>]
-binding <String> -task <UInt64> [-test] [-timespent <Int32>] [<CommonParameters>]
DESCRIPTION
This function swaps IIS bindings between two application pools (Blue and Green) on specified IIS servers or farms. It updates the bindings, ensures proper SSL certificate configuration, and logs the process in a HEAT task.
EXAMPLES
EXAMPLE 1
Invoke-IISSwapBindings -iisAppNameBlue "MyAppBlue" -iisAppNameGreen "MyAppGreen" -iisFarm "QA4" -binding "myapp.qa.example.com" -task 12345
Swaps the bindings between the Blue and Green application pools for the QA4 farm and logs the process in HEAT task 12345.
EXAMPLE 2
Invoke-IISSwapBindings -iisAppNameBlue "MyAppBlue" -iisAppNameGreen "MyAppGreen" -iisServer "SRVIISQA02" -binding "myapp.qa.example.com" -task 67890 -test
Performs a test run of swapping bindings between the Blue and Green application pools on the server SRVIISQA02 and logs the process in HEAT task 67890.
PARAMETERS
-iisAppNameBlue
The name of the Blue application pool.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
-iisAppNameGreen
The name of the Green application pool.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
-iisFarm
The IIS farm where the bindings will be swapped (e.g., DV4, QA4, ST4, PR4).
Type: String[]
Parameter Sets: iisFarm
Aliases:
Required: False
Position: Named
Default value: @("DV4", "QA4", "ST4", "PR4")
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
-iisServer
The standalone IIS server where the bindings will be swapped.
Type: String
Parameter Sets: iisServer
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
-binding
The binding (e.g., hostname) to be swapped between the application pools.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-task
The HEAT task number where the transcript of the operation will be logged.
Type: UInt64
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
-test
A switch to indicate whether the operation is a test run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-timespent
The time spent on the operation, in minutes.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.