Hi Tony,
Looks like there's an error in this line of what I posted:
$pnics = Get-SCVMHostNetworkAdapter | ft -property Name,ConnectionName,VMHost,UplinkPortProfileSet
That line will assign the output of ft to the $pnics variable, when we really want the output from get-scvmhostnetworkadapter in $pnics.
Below is a corrected example. In this example I look at the table to find the adapter and find the index that I pass into the remove set-scvmhostnetworkadapter. In this case if want to clear the 5th item I enter a "4" for the
index.(counting starts at 0)...
PS C:\Users\vmmadmin> $pnics = get-scvmhostnetworkadapter
PS C:\Users\vmmadmin> $pnics | ft Name,ConnectionName,VMHost,UplinkPortProfileSet
Name ConnectionName VMHost UplinkPortProfileSet
---- -------------- ------ --------------------
Broadcom NetXtreme 57xx Gi... Ethernet 5 hv-02.contoso.com Rack 01 - Static Teaming_f...
Intel(R) PRO/1000 GT Deskt... Ethernet 4 hv-01.contoso.com
Microsoft Network Adapter ... Datacenter Switch hv-01.contoso.com
Broadcom NetXtreme 57xx Gi... Ethernet hv-01.contoso.com
Intel(R) Gigabit CT Deskto... Ethernet 4 hv-02.contoso.com Rack 01 - Static Teaming_f...
Intel(R) PRO/1000 PT Dual ... Ethernet 3 hv-01.contoso.com
Intel(R) PRO/1000 PT Dual ... Ethernet 2 hv-01.contoso.com
PS C:\Users\vmmadmin> $pnics[4] | Set-SCVMHostNetworkAdapter -RemoveUplinkPortProfileSet
Name : Intel(R) Gigabit CT Desktop Adapter
IPAddresses : {}
DHCPEnabled : True
IPSubnets : {}
DefaultIPGateways : {}
MacAddress : 00:19:B9:0C:F9:CE
PhysicalAddress : 00:19:B9:0C:F9:CE
NetworkLocation :
VirtualNetwork :
NetworkSwitchPort :
UplinkPortProfileSet :
VLanTags : {}
UsableVLanTags : {}
VLanMode :
TrunkDesiredVLanMode :
TrunkVLanEnabled :
TrueConnectionState :
MediaDisconnectedConnectionName : Ethernet 4
Description :
PrimaryDNSSuffix :
MaxBandwidth : 0
VMHost : hv-02.contoso.com
LogicalNetworkMap : {}
UsableVlanMode : Trunk
ModelAccessibleSubnetVLans : {}
LogicalNetworks : {}
SubnetVLans : {}
UnassignedVLans : {}
AvailableForPlacement : True
IsAvailableForHA : True
UsedForManagement : False
LogicalNetworkCompliance : NonCompliant
LogicalNetworkComplianceErrors : {HostNetworkAdapterNoLogicalNetwork (13706)}
BDFLocationInformation : PCI bus 11, device 0, function 0
NetworkVirtualizationEnabled : True
ServerConnection : Microsoft.SystemCenter.VirtualMachineManager.Remoting.Server
ConnectionID : 5282343f-df98-4f6d-a1d9-65588469c3e4
IsViewOnly : False
ObjectType : VMHostNetworkAdapter
MarkedForDeletion : False
IsFullyCached : True
Sorry about the confusion. I hope this helps!
Greg