Juan Manuel Rey bio photo

Juan Manuel Rey

Unix Geek. Sysadmin by heart turned cloud architect. Working for Microsoft.

Twitter Google+ LinkedIn Github Stackoverflow

In a previous post I described how to get the network connections of an ESXi server using esxcli from Tech Support Mode and vSphere CLI. Following I’ll show you how to get the same information from an ESXi 4.1 and 5.0 using PowerCLI.

The key to perform this tasks the Get-EsxCli cmdlet. This command was introduced with PowerCLI 4.1.1 and its purpose is to expose esxcli framework.

The first task to do with Get-EsxCli is to create a wrapper using a variable that will expose esxcli functionality.

As it can be seen in the screenshot, all the namespace of my whitebox are exposed just like with esxcli command. Now we are going to get the network connections of the host.

Finally following is the syntax to get the network connections of an ESXi 5 server.

In both cases I used the Format-Table cmdlet to get the output in a easily readable and useful format.

Juanma.