WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / Automation / NSX-T PowerCLI community module

NSX-T PowerCLI community module

10.30.2017 by William Lam // Leave a Comment

During the development of my automated NSX-T 2.0 lab deployment script, I had created several PowerCLI functions using the new NSX-T cmdlets and NSX-T APIs to help me test and troubleshoot. I finally got a chance to clean up the code as well as package them all up into an NSXT.psm1 module which hopefully can benefit others. For those of you who are looking for a primer on how to get started with the new NSX-T PowerCLI cmdlets and the NSX-T APIs, check out this awesome post from Romain Decker.

The NSXT module contains the following 8 functions:

  • Get-NSXTComputeManager
  • Get-NSXTController
  • Get-NSXTFabricNode
  • Get-NSXTFirewallRule
  • Get-NSXTIPPool
  • Get-NSXTLogicalSwitch
  • Get-NSXTManager
  • Get-NSXTTransportZone

Below are examples of using each of the functions and before you can make use of the functions, be sure to login to your NSX-T instance by using the Connect-NsxtServer cmdlet.

The Get-NSXTManager returns some basic information about the NSX-T Manager which you are connected to including its ID and SHA256 Thumbprint which is useful for the initial configuration of the management and control cluster setup.

The Get-NSXTController returns all NSX-T Controllers that has joined the NSX-T Manager. This is a quick way to retrieve their cluster status without having to jump over to the NSX-T Manager UI. You also have the option to filter on a specific controller by simply providing the -Id parameter as shown in the screenshot below.

The Get-NSXTFabricNode can return multiple types of nodes such as an ESXi, NSX-T Edge or even KVM host and hence the generic name as it is referred to in the NSX-T APIs. By default, it will return all node types but you have the option of filtering out either ESXi hosts by specifying the -ESXi parameter or Edge hosts by specifying the -Edge parameter as shown in the second screenshot. Depending on the node types, you will get different pieces of information such as the underlying OS and Version. This function is handy to see if the NSX-T VIBs have been installed and its respective management and controller status.

The Get-NSXTComputeManager returns vCenter Servers that have registered with the NSX-T deployment. You will find useful information such as the server version and its current connection status.

The Get-NSXTIPPool returns list of IP Pools that have been created. You will find configuration details about the IP Pool including usage data which can be helpful to see how many available IP Addresses are left for a given pool.

The Get-NSXTTransportZone returns all Transport Zones which can either be of type VLAN or Overlay.

The Get-NSXTLogicalSwitch returns all Logical Switches that have been created along with other useful details such as the admin status and number of ports

The Get-NSXTFirewallRule returns the list of all firewall rule sections that have been configured which provides high level details such as the type, whether it is stateful or stateless and number of individual firewall rules. If you wish to inspect the individual firewall rules, you can then pass in the -Id of a specific firewall rule section in which the individual firewall rules will be displayed as shown in the screenshot below.

More from my site

  • How to debug NSX-T API Automation with PowerCLI?
  • Managing Distributed Firewall Rules in VMC using PowerShell & NSX-T Policy API
  • Quick Tip - How do I tell if NSX-V or NSX-T is installed?
  • Automated Pivotal Container Service (PKS) Lab Deployment 
  • How to troubleshoot NSX-T API errors when using PowerCLI?

Categories // Automation, NSX, PowerCLI Tags // NSX-T, PowerCLI

Thanks for the comment!Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • VCF 9.0 Hardware Considerations 05/30/2025
  • VMware Flings is now available in Free Downloads of Broadcom Support Portal (BSP) 05/19/2025
  • VMUG Connect 2025 - Minimal VMware Cloud Foundation (VCF) 5.x in a Box  05/15/2025
  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025

 

Loading Comments...