Notitie
Voor toegang tot deze pagina is autorisatie vereist. U kunt proberen u aan te melden of de directory te wijzigen.
Voor toegang tot deze pagina is autorisatie vereist. U kunt proberen de mappen te wijzigen.
This sample script changes the RDP port range values on the cluster node VMs after the cluster has been deployed. Azure PowerShell is used so that the underlying VMs do not cycle. The script gets the Microsoft.Network/loadBalancers resource in the cluster's resource group and updates the inboundNatPools.frontendPortRangeStart and inboundNatPools.frontendPortRangeEnd values. Pas de parameters indien nodig aan.
Opmerking
U wordt aangeraden de Azure Az PowerShell-module te gebruiken om te communiceren met Azure. Zie Azure PowerShell installeren om aan de slag te gaan. Raadpleeg Azure PowerShell migreren van AzureRM naar Az om te leren hoe u naar de Azure PowerShell-module migreert.
If needed, install the Azure PowerShell using the instruction found in the Azure PowerShell guide.
Voorbeeldscript
Login-AzAccount
Get-AzSubscription
Set-AzContext -SubscriptionId 'yourSubscriptionId'
$groupname = "mysfclustergroup"
$start=3400
$end=4400
# Get the load balancer resource
$resource = Get-AzResource | Where {$_.ResourceGroupName –eq $groupname -and $_.ResourceType -eq "Microsoft.Network/loadBalancers"}
$lb = Get-AzResource -ResourceGroupName $groupname -ResourceType Microsoft.Network/loadBalancers -ResourceName $resource.Name
# Update the front end port range
$lb.Properties.inboundNatPools.properties.frontendPortRangeStart = $start
$lb.Properties.inboundNatPools.properties.frontendPortRangeEnd = $end
# Write the inbound NAT pools properties
Write-Host ($lb.Properties.inboundNatPools | Format-List | Out-String)
# Update the load balancer
Set-AzResource -PropertyObject $lb.Properties -ResourceGroupName $groupname -ResourceType Microsoft.Network/loadBalancers -ResourceName $lb.name -Force
Uitleg van script
In dit script worden de volgende opdrachten gebruikt. Elke opdracht in de tabel bevat koppelingen naar opdrachtspecifieke documentatie.
| Opdracht | Opmerkingen |
|---|---|
| Get-AzResource | Gets the Microsoft.Network/loadBalancers resource. |
| Set-AzResource | Updates the Microsoft.Network/loadBalancers resource. |
Volgende stappen
Zie voor meer informatie over de Azure PowerShell-module de documentatie van Azure PowerShell.
Meer Voorbeelden van Azure PowerShell voor Azure Service Fabric vindt u in de Azure PowerShell-voorbeelden.