• Home
  • VMware QuickDocs
    • Getting Started with VMware Cloud Foundation
    • VMware General
    • vSphere
    • vSAN
    • Horizon
    • NSX
    • vRealize Suite (renamed to Aria Suite)
    • Aria Suite
      • Aria Automation
      • Aria Operations
      • Aria Operations for Logs
      • Aria Automation Orchestrator
    • Podcasts
  • Home Lab
  • VMware Stickers
  • mac OS Tips
  • About Me
    • Privacy Policy
    • Cookie policy
Cybersylum

Cybersylum

  • Home
  • VMware QuickDocs
    • Getting Started with VMware Cloud Foundation
    • VMware General
    • vSphere
    • vSAN
    • Horizon
    • NSX
    • vRealize Suite (renamed to Aria Suite)
    • Aria Suite
      • Aria Automation
      • Aria Operations
      • Aria Operations for Logs
      • Aria Automation Orchestrator
    • Podcasts
  • Home Lab
  • VMware Stickers
  • mac OS Tips
  • About Me
    • Privacy Policy
    • Cookie policy

ESX Host Prep with PowerCLI

byArron King 02.02.2023 PowerCLI Scripting vSphere

I often discuss ESX configuration with customers, and during a recent conversation the topic turned to Powershell  and automation.  This reminded of a script I wrote back in the vSphere 4.x days.    I was able to locate the file, and with just 2 minor changes found it still works with vSphere 7.  It is simple; but can save quite a bit of time.  Since that is one of the fundamentals of automation – I thought it worthy of sharing.

vSphere does offer a feature called Host Profiles that can help ensure hosts have the same configuration.  This feature does require Enterprise Plus licensing and can take some time to setup.  For those that use vSphere Standard or the older Enterprise licensing – Host Profiles are not an option.   That is where PowerCLI can be really useful!

I have 2 of the 3 Virtues of a Programmer.   I initially wrote this script while building out hosts for a new cluster.  The environment had a large number of VLANs that I had to manually create – over and over.  it took forever!  Hint – my virtues defined!   The script saved me a ton of time, reduced mistakes and helped me see the value of automation.

The script:

  • Adds portgroups to an existing VSS
  • Configures and enables NTP
  • Configures Syslog forwarding

I have posted the script on Github as an example for anyone new to Powershell/PowerCLI or to someone who just wants to save a few minutes.  It is simple; but could easily be extended to meet the needs of nearly any environment.

a basic powershell script using PowerCLI to set some basic configurations for ESXi hosts
https://github.com/cybersylum/ESX-Host-Prep
0 forks.
2 stars.
0 open issues.

Recent commits:
  • Update README.md, GitHub
  • Update README.md, GitHub
  • Update README.md, GitHub
  • Add files via uploadInitial version, GitHub
  • Initial commit, GitHub

Share this:

  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on LinkedIn (Opens in new window) LinkedIn

vToolbelt – January 2023

vToolbelt - February 2023

Leave a Reply Cancel reply

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

Search

Disclaimer

The content and opinions on this site belong to me - not my employer.

You are welcome to use any ideas or code from this site. You have the responsiblity to test these before using in a production environment.

Upcoming Events

  • Wed
    22
    Oct
    2025

    Cincinnati VMware VMUG UserCON

    Save The Date!

    The VMware VMUG UserCON returns to Cincinnati in October 2025

Categories

Aria Automation Aria Operations for Logs Before I Forget Certificates Education Home Lab Horizon View Importing vSphere Networks into Aria Automation Linux MacOS Networking PowerCLI Professional Development Scripting Swift TechBITS Tech Learning Update Manager VCSA VMUG VMware VMware Cloud on AWS VMware Portal VMware Tools VMworld vSphere vToolBelt Windows 10

Archives

Category

Aria Automation Aria Operations for Logs Before I Forget Certificates Education Home Lab Horizon View Importing vSphere Networks into Aria Automation Linux MacOS Networking PowerCLI Professional Development Scripting Swift TechBITS Tech Learning Update Manager VCSA VMUG VMware VMware Cloud on AWS VMware Portal VMware Tools VMworld vSphere vToolBelt Windows 10
Proudly powered by WordPress | Theme: Showme by NEThemes.