How can one create a Virtual Machine in Powershell?
Answer Posted / 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 View All Answers
State the difference between a library and a list?
What do you mean by a domain?
What are the special azure regions?
What is documentdb?
what is windows azure platform?
Explain Break-fix issue?
How to migrate the file servers to azure?
What is Redis cache in Azure?
Is it possible to create a Virtual Machine using Azure Resource Manager in a Virtual Network that was created using classic deployment?
What is storage account?
What is azure uptime?
What are the different roles in Azure?
Explain diagnostics in windows azure?
What are the benefits of the traffic manager in windows azure?
Do scale sets work with Azure availability sets?