< Back

New-VDPortgroup

Sun Jan 19, 2020 7:23 pm

NAME New-VDPortgroup



SYNOPSIS

This cmdlet creates distributed port groups.





SYNTAX

New-VDPortgroup [-VDSwitch] <VDSwitch> -BackupPath <String> [-KeepIdentifiers] [-Name <String>] [-RunAsync]

[-Server <VIServer[]>] [-Confirm] [-WhatIf] [<CommonParameters>]



New-VDPortgroup [-VDSwitch] <VDSwitch> -Name <String> [-Notes <String>] [-NumPorts <Int32>] [-PortBinding

<DistributedPortGroupPortBinding>] [-RunAsync] [-Server <VIServer[]>] [-VlanId <Int32>] [-VlanTrunkRange

<VlanRangeList>] [-Confirm] [-WhatIf] [<CommonParameters>]



New-VDPortgroup [-VDSwitch] <VDSwitch> [-Name <String>] -ReferencePortgroup <VDPortgroup> [-RunAsync] [-Server

<VIServer[]>] [-Confirm] [-WhatIf] [<CommonParameters>]





DESCRIPTION

This cmdlet creates distributed port groups. You can create a new distributed port group with custom properties,

specify a reference port group to clone its properties, or provide a backup profile to import the port group

configuration.





PARAMETERS

-BackupPath <String>

Specifies the full file path to the .zip file containing the backup configuration that you want to import.

Only .zip files created with the Export-VDPortgroup cmdlet are supported.



Note: This parameter is supported only on vSphere 5.1 and later.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-KeepIdentifiers [<SwitchParameter>]

Indicates that the original vSphere distributed port group identifiers will be preserved.



Note: This parameter is supported only on vSphere 5.1 and later.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

Specifies the name of the new distributed port group that you want to create.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Notes <String>

Specifies a description for the new distributed port group that you want to create.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-NumPorts <Int32>

Specifies the number of ports that the distributed port group will have. If you do not set this parameter, the

number of ports for the new distributed port group is set to 128 ports.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-PortBinding <DistributedPortGroupPortBinding>

Specifies the port binding setting for the distributed port group that you want to create. This parameter

accepts Static, Dynamic, and Ephemeral values. Note: Dynamic port binding is deprecated. For better

performance, static port binding is recommended.



Required? false

Position? named

Default value Static

Accept pipeline input? False

Accept wildcard characters? false



-ReferencePortgroup <VDPortgroup>

Specifies a reference distributed port group. The properties of the new distributed port group will be cloned

from the reference distributed port group.



Note: This parameter is supported only on vSphere 5.1 and later.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? true



-RunAsync [<SwitchParameter>]

Indicates that the command returns immediately without waiting for the task to complete. In this mode, the

output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help

About_RunAsync" in the VMware PowerCLI console.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Server <VIServer[]>

Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is given to this

parameter, the command runs on the default servers. For more information about default servers, see the

description of Connect-VIServer.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? true



-VDSwitch <VDSwitch>

Specifies the vSphere distributed switch on which you want to create the new distributed port group.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? true



-VlanId <Int32>

Specifies the VLAN ID of the distributed port group that you want to create. Valid values are integers in the

range of 1 to 4094.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-VlanTrunkRange <VlanRangeList>

Specifies the VLAN trunk range for the distributed port group that you want to create. Valid values are

strings representing ranges of IDs. For example, "1-4, 6, 8-9".



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false,

the cmdlet runs without asking for user confirmation.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are

modified.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

The newly created VDPortgroup object







NOTES









-------------------------- Example 1 --------------------------



Get-VDSwitch -Name "MyVDSwitch" | New-VDPortgroup -Name "MyVDPortGroup" -NumPorts 8 -VLanId 4



Creates a new distributed port group on the specified vSphere distributed switch with the specified number of

ports and VLAN ID.

-------------------------- Example 2 --------------------------



$myReferncePortroup = Get-VDPortgroup -Name "MyReferencePortGroup"

Get-VDSwitch -Name "MyVDSwitch" | New-VDPortgroup -Name "MyVDPortGroup" -ReferencePortgroup $myReferncePortroup



Creates a new distributed port group on the specified vSphere distributed switch by cloning the configuration of

the distributed port group named "MyReferencePortGroup".

-------------------------- Example 3 --------------------------



Get-VDSwitch -Name "MyVDSwitch" | New-VDPortgroup -Name "MyVDPortGroup" -RunAsync



Creates asynchronously a new distributed port group on the specified vSphere distributed switch.

-------------------------- Example 4 --------------------------



$myBackupFilePath = 'c:\\Backup.zip'

Get-VDSwitch -Name "MyVDSwitch" | New-VDPortgroup -Name "MyVDPortgroup" -BakupPath $myBackupFilePath



Creates a new distributed port group on the specified vSphere distributed switch by importing the specified backup

profile.

-------------------------- Example 5 --------------------------



Get-VDSwitch -Name "MyVDSwitch" | New-VDPortgroup -Name "MyVDPortGroup" -VlanTrunkRange "1-5, 10-20"



Creates a new distributed port group on the specified vSphere distributed switch with the specified name and VLAN

trunk range settings.



RELATED LINKS

Online Version: https://code.vmware.com/doc/preview?id= ... group.html

Get-VDPortgroup

Set-VDPortgroup

Remove-VDPortgroup

Export-VDPortgroup