VMware Cloud Community
xooops
Contributor
Contributor
Jump to solution

get-virtualportgroup

Hello

I'm looking for a script witch reports me unused portgroups. So I can delete this portgroups.

I was playing with get-virtualportgroup.

I got the Name, Key, VirtualSwitch, VlanID

How can I display all available columns?

many thanks, Sven

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

I was intrigued by your question to find unused portgroups.

Have a look at the solution I came up with in my Find unused portgroups in a cluster post.

____________

Blog: LucD notes

Twitter: lucd22


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
5 Replies
RvdNieuwendijk
Leadership
Leadership
Jump to solution

Sven,

if you append "| Format-List *" or "| Format-Table *" to your command, you will get all available fields. In this case you will get the following fields:

Name

VirtualSwitchId

Key

Port

VLanId

VirtualSwitchName

VMHostId

You can also append "| Get-Member" to your command to see all available methods and properties.

Robert

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
xooops
Contributor
Contributor
Jump to solution

thanks, Robert.

Now I can try to get the values.

regards, Sven

0 Kudos
LucD
Leadership
Leadership
Jump to solution

I was intrigued by your question to find unused portgroups.

Have a look at the solution I came up with in my Find unused portgroups in a cluster post.

____________

Blog: LucD notes

Twitter: lucd22


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
xooops
Contributor
Contributor
Jump to solution

Hi LucD

great! many thanks Smiley Happy

regards, Sven

0 Kudos
david615
Enthusiast
Enthusiast
Jump to solution

Hi LucD,

I am wondering if you can filter port group results by types.  I looked everywhere and could not find answer.

For example, when I issue get-virtualporgrop command I get virtual port groups from vmotion, service console, ft, vmkernel, and virtual machine network ports.

I want to find a way query virtual machine network ports only.  Is there a way to do this?

Thanks,

David

http://powerclinic.blogspot.com/
0 Kudos