Grant-SCIPAddress

Allocates a static or virtual IP address from a specified address pool.

Description

The Grant-SCIPAddress cmdlet allocates static IP and virtual IP addresses from a specified address pool.

To grant a specific IP address, use the IPAddress parameter. Otherwise, VMM will choose the IP address from the address pool.

For more information about Grant-SCIPAddress, type: "Get-Help Grant-SCIPAddress -online".

Parameters

GrantToObjectType

Required? true
Accept Pipeline Input? false
Position? named
Specifies a value for AllocatedToObjectType to which an allocated IP address or virtual IP address will be assigned. Valid values are: VirtualNetworkAdapter, VIP, HostNetworkAdapter, LoadBalancerConfiguration, VirtualMachine, HostCluster

StaticIPAddressPool

Required? true
Accept Pipeline Input? false
Position? named
Specifies an IP address pool from which you can assign static IP addresses.

Description

Required? false
Accept Pipeline Input? false
Position? named
States a description for the specified object.

GrantToObjectID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the ID of an object to which an allocated IP address or MAC address will be assigned.

IPAddress

Required? false
Accept Pipeline Input? false
Position? named
Specifies an IPv4 or IPv6 address.  

JobVariable

Required? false
Accept Pipeline Input? false
Position? named
Specifies that job progress is tracked and stored in the variable named by this parameter. 

PROTipID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

RunAsynchronously

Required? false
Accept Pipeline Input? false
Position? named
Indicates that the job runs asynchronously so that control returns to the command shell immediately. 

VMMServer

Required? false
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a VMM server object.
This cmdlet requires a VMM static IP address pool object, which can be retrieved using the Get-SCStaticIPAddressPool cmdlet.

Examples

1: Allocate an IP address.
PS C:\> $VM = Get-SCVirtualMachine -Name "VM01"
PS C:\> $vNICs = $VM.VirtualNetworkAdapters
PS C:\> $IPPool = Get-SCStaticIPAddressPool -Name "Production IP Address Pool"
PS C:\> Grant-SCIPAddress -StaticIPAddressPool $IPPool -GrantToObjectType VirtualNetworkAdapter -GrantToObjectID $vNICs[0].ID -Description $VM.Name
The first command gets the virtual machine object named VM01 and stores the object in the $VM variable.

The second command gets the virtual network adapter objects for virtual machine VM01 and stores the objects in the $vNICs variable.

The third command gets the static IP address pool object named Production IP Address Pool and stores the object in the $IPPool variable.

The last command allocates an IP address from the static IP address pool stored in $IPPool to the first virtual network adapter stored in $vNICs, and supplies VM01 as the description for the allocated IP address.

See Also