Skip to content

Recent Posts

  • Reset passwords for Active Directory Users
  • Finding Exchange Database hidden mailboxes. ​
  • Setting up ADConnect and PTA (Password auth through) servers agents behind proxy
  • Get Report of Active Directory Locked Accounts and Machine they logged in from
  • Checking and Providing Full and SendAs delegate access on O365 Exchange Online

Most Used Categories

  • Microsoft (82)
    • Microsoft Exchange (39)
      • Exchange 2016 (14)
      • Exchange 2019 (14)
    • Active Directory (25)
  • Office 365 (34)
    • Exchange Online (15)
  • Security (15)
  • Microsoft Azure (15)
  • Powershell (19)
Skip to content

Welcome to Mohammed Hamada's Site

The Troubleshooting Guy

Subscribe
  • Consultation
  • Microsoft
    • DFS
    • KMS
    • Office 365
      • Microsoft ADFS
      • Exchange Online
      • Microsoft Teams
      • Skype for Business
    • Microsoft Azure
      • Microsoft Azure Active Directory Sync
      • Licensing
      • ATP
      • WVD
    • ADMT
  • Virtualization
  • VoIP
    • Lync
    • Asterisk
  • PowerShell Corner
  • Security
    • Auditing
    • Pfsense
  • Contact me
  • Certification and Awards
  • Home
  • Microsoft Azure
  • Add multiple endpoints or port range to an Azure Virtual Machine

Add multiple endpoints or port range to an Azure Virtual Machine

moh10lyNovember 21, 2019

If you ever needed to add multiple ports or range of ports endpoints to a particular Virtual machine on Azure. you might have a difficulty doing this since it’s not allowed by design and that will require time to do this manually for range of ports. that’s where this article comes handy.

To achieve this first you will need to connect to your Azure subscription on Azure powershell. Azure PowerShell.

Run Azure powershell as an administrator and type the following cmdlet to get your subscription info

Get-AzurePublishSettingsFile

clip_image001

This will open a page and ask you to sign in to your Azure user account and download a file called Visual Studio Premium with MSDN-DATE-credentials.publishsettings

clip_image002

In the powershell you will have to navigate to where the file is located. And import the settings that have just been downloaded in that file

Import-azurepublishSettingsFile `.\Visual Studio FileLocation`

clip_image003

You can check for your account and Subscription, using Get-azureaccount script

clip_image004

Now I have setup a ubuntu Machine on Azure that hosts Openfire Chat server which requires 10000-10005 port range for the media service. On Azure Web interface the port range option is not yet supported. The only available option is through powershell which will open the required port range for us.

To do so I’ll use the following cmdlet highlighting the required information to enter

To create endpoints for ports 10000-10005:

$vm = Get-AzureVM -ServiceName moh10ly -Name ubunut-mohammed ; 10000..10005 | ForEach { $VM | Add-AzureEndpoint -Name TestEndpoint$_ -Protocol TCP -LocalPort $_ -PublicPort $_} ; $vm | Update-AzureVM

To Acquire your service name, you can simply login to Azure portal and check out All Items and see the cloud service name .. Just like the below screenshot

clip_image005

To Check your VMname simply navigate to Virtual machines tab and on the right side you can see the name.. I have copied it as well in the command.

clip_image006

Once you edited the cmdlet with your information you can enter it in the Powershell and enter

It should return something like this.

clip_image007

Once finished you can check Azure end point portal for the new ports configuration

clip_image008

Here we go .. Ports are created in Azure

clip_image009

To remove the endpoints for ports 10000-10005:

$vm = Get-AzureVM -ServiceName moh10ly -Name ubunut-mohammed ; 10000..10005 | ForEach { $VM | Remove-AzureEndpoint -Name TestEndpoint$_} ; $vm | Update-AzureVM

Post navigation

Previous: Upgrade Microsoft Domain Controller 2008 R2 to DC 2012 R2 with Exchange 2010 in the current environment.
Next: AZURE ACTIVE DIRECTORY SYNC EVENT ID 906 FAILED WHILE PURGING RUN HISTORY INVALID NAMESPACE

Related Posts

Onboarding Linux Client (DEEPIN) to Microsoft Azure Threat protection ATP using ubuntu repository

May 18, 2020 moh10ly

Azure RDWEB page is blank when accessing it with authorized users

April 27, 2020 moh10ly

VM fails to join Domain during Azure Windows Virtual desktop deployment

April 26, 2020 moh10ly

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search for something

Recent Posts

  • Reset passwords for Active Directory Users
  • Finding Exchange Database hidden mailboxes. ​
  • Setting up ADConnect and PTA (Password auth through) servers agents behind proxy
  • Get Report of Active Directory Locked Accounts and Machine they logged in from
  • Checking and Providing Full and SendAs delegate access on O365 Exchange Online
  • Retrieving attachments from Exchange mailbox using python
  • 550 relay not permitted distribution group contact
  • Script to delete all DPM 2019 recovery points

Recent Comments

  • B on SoftEther – Fixing connecting to localhost 5555
  • Denise Diaz on Reset passwords for Active Directory Users
  • Les Gray on Replication after tombstone life expired
  • jimmyj on Search and Delete certain Items/Folders from a Mailbox
  • moh10ly on How to Sync Cloud User to On-premises AD ?

Archives

  • December 2022
  • November 2022
  • January 2022
  • December 2021
  • May 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019

Archives

  • December 2022
  • November 2022
  • January 2022
  • December 2021
  • May 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019

Categories

  • Active Directory
  • ADFS
  • ADMT
  • Asterisk
  • ATP
  • Auditing
  • AZURE
  • Cloud
  • Communication
  • CRM Dynamics
  • CrossForest Migration
  • DFS
  • DNS
  • DPM
  • Exchange 2010
  • Exchange 2013
  • Exchange 2016
  • Exchange 2019
  • Exchange Online
  • Google Chat
  • Infrastructure
  • KMS
  • Licensing
  • Linux
  • Lync
  • Mail
  • Microsoft
  • Microsoft AD Group Policy
  • Microsoft ADFS
  • Microsoft Azure
  • Microsoft Azure Active Directory Sync
  • Microsoft Exchange
  • Microsoft Teams
  • Monitoring
  • Networking
  • Office 365
  • Pentest
  • Pfsense
  • PKI
  • Plesk
  • Powershell
  • Python
  • RDS
  • Scripting
  • Security
  • Skype for Business
  • Skype4Business
  • Ubuntu
  • Uncategorized
  • Virtualization
  • VoIP
  • VPN
  • Windows 10
  • Windows Server
  • Windows Server 2019
  • Windows Virtual Desktop
  • WordPress
  • WVD

Meta

  • Register
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Copyright All Rights Reserved | Theme: BlockWP by Candid Themes.