Share via


Grant-SCIPAddress

Grant-SCIPAddress

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

Syntax

Parameter Set: Default
Grant-SCIPAddress -GrantToObjectType <AllocatedToObjectType> {VirtualNetworkAdapter | VIP | HostNetworkAdapter | LoadBalancerConfiguration | VirtualMachine | HostCluster | VMSubnet | NetworkService | NATConnection | NetworkGateway | StorageArray | VMNetworkGateway} -StaticIPAddressPool <StaticIPAddressPool> [-Description <String> ] [-ExplicitRevokeRequired <Nullable [System.Boolean]> ] [-GrantToObjectID <Guid]> ] [-IPAddress <String> ] [-JobVariable <String> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

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

Parameters

-Description<String>

States a description for the specified object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ExplicitRevokeRequired<Nullable [System.Boolean]>

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-GrantToObjectID<Guid]>

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

-GrantToObjectType<AllocatedToObjectType>

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

-IPAddress<String>

Specifies an IPv4 or IPv6 address.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-JobVariable<String>

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

-OnBehalfOfUser<System.String>

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-OnBehalfOfUserRole<Microsoft.SystemCenter.VirtualMachineManager.UserRole>

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PROTipID<Guid]>

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

-RunAsynchronously

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

-StaticIPAddressPool<StaticIPAddressPool>

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

-VMMServer<ServerConnection>

Specifies a VMM server object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • CloudDRPairingInfoData

Notes

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

Examples

Example 1: Allocate an IP address

The first command gets the virtual machine object named VM01, and then stores the object in the $VM variable.

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

The third command gets the static IP address pool object named Production IP Address Pool, and then 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 then 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

Get-SCIPAddress

Get-SCStaticIPAddressPool

Revoke-SCIPAddress

Set-SCIPAddress

Get-SCVirtualMachine