Reading Time: < 1 minute

Bellow a script which helps you to create || delete massive endpoints on Azure. {Applies on ASM}

#Enter Azure Account
Add-AzureAccount

#Choose Subscription
Select-AzureSubscription -SubscriptionName "MySubscripiton"
#Massive  EndPoint creation from  Port 6100 to  6120
$vm = Get-AzureVM -ServiceName "MyService" -Name "VMName"
for ($i=6100; $i -le 6120; $i++)
{
$EndpointName = "FtpEndpoint_"
$EndpointName += $i
Remove-AzureEndpoint -Name $EndpointName -Protocol "tcp" -PublicPort $i -LocalPort $i -VM $vm
}
$vm | Update-AzureVM

#Massive Endpoint deletion from Port 6100 to Port 6120
$vm = Get-AzureVM -ServiceName "MyService" -Name "VMName"
for ($i=6100; $i -le 6120; $i++)
{

$EndpointName = "FtpEndpoint_"
$EndpointName += $i
Remove-AzureEndpoint -Name $EndpointName -VM $vm | Update-AzureVM

}

 

Share This