How can one create a Virtual Machine in Powershell?



How can one create a Virtual Machine in Powershell?..

Answer / wipro123

VM creation using Powershell:

1) create resource:
New-AzResourceGroup -Name myResourceGroup -Location EastUS

2) create to VM:
New-AzVm `
-ResourceGroupName "myResourceGroup" `
-Name "myVM" `
-Location "East US" `
-VirtualNetworkName "myVnet" `
-SubnetName "mySubnet" `
-SecurityGroupName "myNetworkSecurityGroup" `
-PublicIpAddressName "myPublicIpAddress" `
-OpenPorts 80,3389
3) connect to VM:
Get-AzPublicIpAddress -ResourceGroupName "myResourceGroup" | Select "IpAddress"

4)find out the Public IP:
mstsc /v:publicIpAddress

5) Install IIS:
Install-WindowsFeature -name Web-Server -IncludeManagementTools

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Microsoft Azure Interview Questions

What happens when you exhaust the maximum failed attempts by authenticating yourself using azure ad?

0 Answers  


Define the DevOps Function in Azure Cloud Service?

0 Answers  


Is azure free for developers?

0 Answers  


Give some examples of hybrid applications using windows azure?

0 Answers  


How to create a virtual machine in azure?

0 Answers  






What is the role of azure developer?

0 Answers  


What do you mean by a service fabric in azure?

0 Answers  


What is the method for creating a queue in storage account?

0 Answers  


Your organization mandates that the custom domain name used in azure ad and on-premises should be the same, what will you configure on the on-premises domain controller to facilitate the same?

0 Answers  


what are the options to manage session state in windows azure?

0 Answers   Microsoft,


What is a web role in windows azure?

0 Answers  


What is hdinsight in microsoft azure?

0 Answers  


Categories