Grant-SCIPAddress
Applies To: System Center 2012 - Virtual Machine Manager
Allocates a static or virtual IP address from a specified address pool.
Parameter Set: Default
Grant-SCIPAddress -GrantToObjectType <AllocatedToObjectType> -StaticIPAddressPool <StaticIPAddressPool> [-Description <String> ] [-GrantToObjectID <Guid> ] [-IPAddress <String> ] [-JobVariable <String> ] [-PROTipID <Guid> ] [-RunAsynchronously] [-VMMServer <ServerConnection> ] [ <CommonParameters>]
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".
States a description for the specified object.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
Specifies the ID of an object to which an allocated IP address or MAC address will be assigned.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
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
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
Specifies an IPv4 or IPv6 address.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
Specifies that job progress is tracked and stored in the variable named by this parameter.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
Indicates that the job runs asynchronously so that control returns to the command shell immediately.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
Specifies an IP address pool from which you can assign static IP addresses.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
Specifies a VMM server object.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true (ByValue) |
Accept Wildcard Characters? |
false |
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.
The input type is the type of the objects that you can pipe to the cmdlet.
The output type is the type of the objects that the cmdlet emits.
- AllocatedIPAddress
- This cmdlet requires a VMM static IP address pool object, which can be retrieved using the Get-SCStaticIPAddressPool cmdlet.
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.
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