Grant-SCMACAddress

Allocates the next available physical address (MAC address) from a MAC address pool, and assigns it to a virtual network adapter. 

Description

The Grant-SCMACAddress cmdlet allocates the next available physical address (MAC address) from a MAC address pool and assigns it to a virtual network adapter. To allocate a specific MAC address, use the MACAddress parameter.

For information about creating MAC address pools, type: "New-SCMACAddressPool -detailed".

For more information about Grant-SCMACAddress, type: "Grant-SCMACAddress -online".

Parameters

MACAddressPool

Required? true
Accept Pipeline Input? false
Position? named
Specifies a MAC address pool.

VirtualNetworkAdapter

Required? true
Accept Pipeline Input? false
Position? named
Specifies a virtual network adapter object for a virtual machine. 

TYPE OF HOST	NUMBER OF VIRTUAL NETWORK ADAPTERS
------------	----------------------------------
Hyper-V		 Up to 4 emulated adapters per virtual machine.
Up to 8 synthetic adapters per virtual machine.
(Exception: no driver available for an emulated 
network adapter on a Windows Server 2003 x64 guest.)
VMware ESX		Up to 4 emulated adapters per virtual machine.
Citrix XenServer  Up to 7 emulated adapters per virtual machine.

Confirm

Required? false
Accept Pipeline Input? false
Position? named
Prompts for confirmation before running the command.

Description

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

JobVariable

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

MACAddress

Required? false
Accept Pipeline Input? false
Position? named
Specifies the Media Access Control (MAC) address, or a set of MAC addresses, for a physical or virtual network adapter on a computer. Valid values are: one or more MAC addresses.

Example format for a single MAC address:
  -MACAddress “00-15-5D-B4-DC-00”

Example format for a set of MAC addresses:
  -MACAddress “00-15-5D-B4-DC-00”, “00-1A-A0-E3-75-29”

Example format for a set of MAC addresses:
  $Macs = “00-15-5D-B4-DC-00”, “00-1A-A0-E3-75-29”
  Set-SCPXEServer –MACAddress $Macs

NOTE: When used with New-SCPXEServer or Set-SCPXEServer, the MACAddress parameter updates the PXE interfaces from which the SCDM PXE Server listens for and responds to PXE requests

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.
Requires a VMM MACAddressPool object, which can be retrieved using the Get-SCMACAddressPool cmdlet, and a VMM virtual network adapter object, which can be retrieved using the Get-SCVirtualNetworkAdapter cmdlet.

Examples

1: Allocate a MAC address from a MAC address Pool and assign it to a virtual network adapter.
PS C:\> $VM = Get-SCVirtualMachine -VMHost "VMHost01.Contoso.com" -Name "VM01"
PS C:\> $VNIC = Get-SCVirtualNetworkAdapter -VM $VM
PS C:\> $HostGroup = Get-SCVMHostGroup | where { $_.Path -eq "All Hosts\HostGroup02\Production" }
PS C:\> $MACAddressPool = Get-SCMACAddressPool -VMHostGroup $HostGroup -Name "MAC Address Pool 01"
PS C:\> Grant-SCMACAddress -MACAddressPool $MACAddressPool -VirtualNetworkAdapter $VNIC
The first command gets the virtual machine object named VM01 on host VMHost01 and stores the object in the $VM variable.

The second command gets the virtual network adapter object for the virtual machine stored in $VM and stores the object in the $VNIC variable.

The third command gets the host group object at the path All Hosts\HostGroup02\Production and stores the object in the $HostGroup variable.

The fourth command gets the MAC address pool associated with the host group stored in $HostGroup and named MAC Address Pool 01.

The last command assigns a MAC address to the virtual network adapter stored in $VNIC.

See Also