Grant-SCIPAddress

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

Syntax

Grant-SCIPAddress
     [-VMMServer <ServerConnection>]
     -StaticIPAddressPool <StaticIPAddressPool>
     -GrantToObjectType <AllocatedToObjectType>
     [-IPAddress <String>]
     [-GrantToObjectID <Guid>]
     [-Description <String>]
     [-ExplicitRevokeRequired <Boolean>]
     [-DisableReconcile <Boolean>]
     [-RunAsynchronously]
     [-PROTipID <Guid>]
     [-JobVariable <String>]
     [-OnBehalfOfUser <String>]
     [-OnBehalfOfUserRole <UserRole>]
     [<CommonParameters>]
Grant-SCIPAddress
     [-NetworkController <VirtualSwitchExtensionManager>]
     [-UserRole <UserRole>]
     [-VMMServer <ServerConnection>]
     -IPAddress <String>
     [-Description <String>]
     [-PublicIPAddress]
     [-Owner <String>]
     [-ExplicitRevokeRequired <Boolean>]
     [-DisableReconcile <Boolean>]
     [-RunAsynchronously]
     [-PROTipID <Guid>]
     [-JobVariable <String>]
     [-OnBehalfOfUser <String>]
     [-OnBehalfOfUserRole <UserRole>]
     [<CommonParameters>]

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, Virtual Machine Manager (VMM) chooses the IP address from the address pool.

Examples

Example 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.

Parameters

-Description

Specifies a description for the object.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DisableReconcile

Type:Boolean
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ExplicitRevokeRequired

Type:Boolean
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-GrantToObjectID

Specifies the ID of an object to which an allocated IP address or MAC address is assigned.

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-GrantToObjectType

Specifies a value for AllocatedToObjectType to which an allocated IP address or virtual IP address is assigned. The acceptable values for this parameter are:

  • VirtualNetworkAdapter
  • VIP
  • HostNetworkAdapter
  • LoadBalancerConfiguration
  • VirtualMachine
  • HostCluster
Type:AllocatedToObjectType
Accepted values:VirtualNetworkAdapter, VIP, HostNetworkAdapter, LoadBalancerConfiguration, VirtualMachine, HostCluster, VMSubnet, NetworkService, NATConnection, NetworkGateway, StorageArray, VMNetworkGateway, None
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-IPAddress

Specifies an IPv4 or IPv6 address.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-JobVariable

Specifies that job progress is tracked and stored in the variable named by this parameter.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NetworkController

Specifies a network controller.

Type:VirtualSwitchExtensionManager
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-OnBehalfOfUser

Specifies a user name. This cmdlet operates on behalf of the user that this parameter specifies.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-OnBehalfOfUserRole

Specifies a user role. To obtain a user role, use the Get-SCUserRole cmdlet. This cmdlet operates on behalf of the user role that this parameter specifies.

Type:UserRole
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Owner

Specifies the owner of a VMM object in the form of a valid domain user account.

  • Example format: -Owner "Contoso\PattiFuller"
  • Example format: -Owner "PattiFuller@Contoso"
Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PublicIPAddress

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-StaticIPAddressPool

Specifies an IP address pool from which you can assign static IP addresses.

Type:StaticIPAddressPool
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-UserRole

Type:UserRole
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-VMMServer

Specifies a VMM server object.

Type:ServerConnection
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

Outputs

CloudDRPairingInfoData

This cmdlet returns a CloudDRPairingInfoData object.

Notes

  • This cmdlet requires a VMM static IP address pool object, which can be retrieved using the Get-SCStaticIPAddressPool cmdlet.