Access Azure Windows VM through Powershell

Access Azure Windows VM through Powershell

Access Azure Windows VM through Powershell

In this blog, we will show you the steps to access azure windows VM through PowerShell on Windows 2016

 

REQUIREMENTS

  • Microsoft Azure Subscription
  • Virtual Machine

 

ADDING FIREWALL RULES FOR POWERSHELL REMOTING

  • Log in to the Windows Azure portal using your subscription credentials.

image

 

  • Click on the existing network security group. In this demo, it’s az-networksecuritygroup from the dashboard.

image

 

  • In another way, you can also find the network security group from the Azure service list.

image

 

image

 

  • Click on the Inbound security rules option.

image

 

  • Click on Add button.

image

 

  • Now click on Basic.

image

 

  • WINRM will run on either ports 5985 and 5986. The port 5985 is for HTTP and 5986 is for HTTPS. To add the HTTPS WIRM Select the service type as WinRM which will select the port 5986 automatically. Make sure that you have set the priority and name for this rule. Click on OK.

image

 

  • Repeat the same above steps and add the port 5985 in the NSG group.

image

 

  • The new rule will be displayed in the Inbound rules list.

image

 

 

FINDING AZURE VM PUBLIC ADDRESS

  • From the Azure portal, Click on the Virtual Machines service link.

image

 

  • Click on the VM to access through PowerShell remoting and select the public IP address.

image

 

image

 

 

CONFIGURE WINRM ON AZURE VM

  • Log in to the windows azure VM and execute the below command from the command prompt and execute the below command.

winrm quickconfig

image

 

  • It prompted us to configure the WinRM for remote management. Type Y and press Enter.

image

 

  • Run the winrm quickconfig command to verify the settings.

image

 

ADDING AZURE VM IP INTO TRUSTED HOSTS

  • Open the PowerShell window from a VM.

Note: In this demo, we are using windows 2016 VM

 

  • Execute the below command to add the Azure VM into the trusted host.

Syntax: Set-Item WSMan:\localhost\Client\TrustedHosts –Value <IP address>

Example: Set-Item WSMan:\localhost\Client\TrustedHosts -Value 52.172.27.157

image

 

  • It prompts us for the confirmation. Accept the change by entering Y.

image

 

ACCESSING VM THROUGH POWERSHELL REMOTING

  • From the PowerShell window, execute the below command to start a PowerShell session on remote VM.

Syntax: Enter-PSSession –ComputerName <IP Address> -Credential Get-Credential

Example: Enter-PSSession -ComputerName 52.172.27.157 -Credential Get-Credential

image

 

  • Provide the Azure VM login credentials and click OK.

image

 

  • Once the credentials are authenticated successfully, you will get the PowerShell prompt as shown below.

image

 

  • Type the command hostname to find verify the Azure VM name.

image

 

VIDEO

 

Thanks for reading this blog. We hope it was useful for you to learn about accessing azure VM through PowerShell commands.

Share on facebook
Facebook
Share on twitter
Twitter
Share on pinterest
Pinterest
Share on linkedin
LinkedIn
More Interested Related Posts
zfs pool usage

ZFS Pool and Dataset Usage

ZFS Pool and Dataset Usage   I am back with another blog to provide the useful script to the Freebsd users to determine the zpool

Assistanz Networks

Installing Zabbix Agent in FreeBSD 12.0

Zabbix Agent Installation and Configuration Guide on FreeBSD 12.0   Zabbix is an open-source monitoring software tool for diverse IT components, including networks, servers, virtual

DirectAdmin Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk
$ 99 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • NDA & SLA
  • SLA Review Meetings
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation
  •  

Platinum Support

24/7 Proactive Support
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Support

$ 30 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response Time
  • 4 Hours Resolution time for the Possible Issues
  • Security and Performance Optimization
  • React to Customers queries
  • Simple SignUp Process
  • Instant Account Activation
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support