Skip to content

Instantly share code, notes, and snippets.

@astaykov
Created August 14, 2014 07:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astaykov/22fd38e3593bbf273329 to your computer and use it in GitHub Desktop.
Save astaykov/22fd38e3593bbf273329 to your computer and use it in GitHub Desktop.
Azure IaaS PowerShell bulk add endpoints
Add-AzureAccount
Select-AzureSubscription -SubscriptionName "Your_Subscription_Name"
$vm = Get-AzureVM -ServiceName "CloudServiceName" -Name "VM_Name"
for ($i=6100; $i -le 6120; $i++)
{
$EndpointName = "FtpEndpoint_"
$EndpointName += $i
Add-AzureEndpoint -Name $EndpointName -Protocol "tcp" -PublicPort $i -LocalPort $i -VM $vm
}
$vm | Update-AzureVM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment