Advertisement
Workspace-Guru

get-azureprivateip

May 23rd, 2018
3,598
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #### Get Azure VM Private IP
  2. $ResourceGroup = "myRG"          ### Resource group name
  3. $VMName = "myVM"                 ### VM Name, example VDI-Master
  4.  
  5. $nic = Get-AzureRmNetworkInterface -name $VMname -ResourceGroupName $ResourceGroup
  6. $AzureIP = $nic.IpConfigurations.privateIpAddress
  7.  
  8. Write-host "The VM $VMname has IP Address $AzureIP"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement