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 are the three main components of the windows azure platform?

1 Answers  


Is it possible to create multiple VM's (more than 15) per day. How can you handle it

1 Answers  


What is windows azure traffic manager? What are its benefits?

1 Answers  


Explain what is federation in sql azure?

1 Answers  


What is the difference between Service Bus Queues and Storage Queues?

1 Answers  


What are unconnected lookups?

1 Answers  


What is azure hd insight?

1 Answers  


what are the roles available in windows azure?

1 Answers   Microsoft,


How can you demonstrate between azure mobile service and web api?

1 Answers  


What is azure app service?

1 Answers  


what is csrun?

1 Answers   Microsoft,


Which azure certification is best?

1 Answers  


Categories