Quick Tip: Bulk removal of Azure Endpoints

Posted on September 09, 2015 by Richard Brynteson in Azure

Today we take a step outside the Skype for Business toy box and look at some PowerShell with Azure.  The goal is easy, to bulk remove all associated EndPoints with a particular VM hosted in Azure.  The most difficult part of this is simply waiting out all of the changes.  What I discovered in trying to script this is you have to invoke the Update-AzureVM after each add/removal of an EndPoint.  So if you are trying to remove or add a great number of EndPoints you should expect to wait – a long time.

$vm = Get-AzureVM -ServiceName “server01” -Name “server01”
$endpoints = Get-AzureEndpoint -VM $vm
foreach ($ep in $endpoints)
Remove-AzureEndpoint -VM $vm -Name ($ep.Name)
$vm | Update-AzureVM


These are just some random thoughts and ideas from a Microsoft MVP. We might cover everything from Development, to Teams, to Skype and might even through in a random bit of Azure and AWS


Built using Gatsby and Material-UI

Copyright © TheArgyleMVP 2020.