< Back

Set-AzureStaticVNetIP

Wed Jan 30, 2019 5:54 pm

NAME Set-AzureStaticVNetIP



SYNOPSIS

Sets the static VNet IP address information for a virtual machine object.





SYNTAX

Set-AzureStaticVNetIP [-IPAddress] <String> -VM <IPersistentVM> [-Profile <AzureSMProfile>] [-InformationAction <ActionPreference>]

[-InformationVariable <String>] [<CommonParameters>]





DESCRIPTION

The Set-AzureStaticVNetIP cmdlet sets the static virtual network (VNet) IP address information for a virtual machine object.





PARAMETERS

-IPAddress <String>

Specifies the static VNet IP address



Required? true

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-VM <IPersistentVM>

Specifies a persistent virtual machine object for which to set the static VNet IP address.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue, ByPropertyName)

Accept wildcard characters? false



-Profile <AzureSMProfile>

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationAction <ActionPreference>





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationVariable <String>





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES









-------------------------- Example 1: Set the virtual network IP address associated with a virtual machine --------------------------



PS C:\\># Prerequisite: VNet has been set up with SubNet

# Set-AzureVNetConfig -ConfigurationPath $vnetConfigPath;



$vm = New-AzureVMConfig -Name $vmname -ImageName $img -InstanceSize $sz | Add-AzureProvisioningConfig -Windows -Password $pwd -AdminUsername

$usr;

$vm = Set-AzureSubNet -VM $vm -SubNetNames $sn;

Set-AzureStaticVNetIP -IPAddress $ip -VM $vm;

New-AzureVM -ServiceName $svc -VMs $vm -VNetName $vnetName -Location $loc;



The first command sets the configuration path for a virtual network.



The fourth command sets the IP address for the virtual machine.



RELATED LINKS

Get-AzureStaticVNetIP

Test-AzureStaticVNetIP