Using PowerCLI to Add vRealize Operations License Key

I have been working on doing a vCenter Consolidation Project. This included migrating our systems to a new vRealize Operations Server. This particular one included 73 different vSOM keys, and as you may know there is currently no way to enter in multiple keys at a time. I reached out to Kyle Ruddy and he informed me there is an API to do this, and that started my adventure to get this working.

Using PowerCLI to Set vCenter Permissions on Datacenter

I have been working on doing a vCenter Consolidation Project. This has meant recreating multiple permissions groups. I couldnt find an easy way to apply permissions at a datacenter so I updated this script to be used. Pre-Requsites VMware PowerCLI Link to Script Set-vCenterPermissions.ps1 permissions.csv Preparing to Execute the Script The script is pretty straight forward, just need to update columns in the CSV such as Datacenter, Group and Role.

Using PowerCLI to Get and Set DVS Traffic Shaping Settings

I have been in process in configuring traffic shaping for multiple port groups. It seems with PowerCLI 6.3 R1 there are no native Powershell Cmdlets. Luckily I stumbled across @Lucd and his PowerCLI functions to manage these settings, i have put these into a script to mass get and set the settings for all port groups of a DVS’s. Pre-Requsites VMware PowerCLI Link to Script Get-VMwareTrafficShapingSettings.ps1 Set-VMwareTrafficShapingSettings.

Using PowerCLI to Install Host VIBs

So currently Cisco has an issue with installing their ENIC and FNIC VIBs through Update Manager for ESXi 6.x. Until that is resolved I need to manually push out patches to these hosts. Obviously I do not want to do this manually, so I will be utilizing PowerCLI to accomplish this task. Pre-Requsites VMware PowerCLI Link to Script Install-HostVIB.ps1 Preparing to Execute the Script The script is pretty straight forward, just need to define a few variables seen below and then you execute the script.

Using PowerCLI to Install Software in a Guest VM

I have been constantly trying to figure out the best way to deploy updated agents to some of our virtual desktops. It isnt a large environment so I have no need for SCCM or other deployment tools, but its big enough having to RDP to each VM was a pain. I finally decided to bang out a script, and surprised how well it works. Pre-Requsites VMware PowerCLI Link to Script InstallVMSoftware.

Using PowerCLI to Replicate Templates to Multiple Clusters

We have multiple clusters within our vCenters that are defined as a rack. Each rack has its own storage, so storage is not shared between clusters. I needed to develop a way to easily replicate templates between clusters, so a local copy existed on each cluster to take advantage of VAAI. I really wanted to utilize the vSphere Content Libary for these, but there is currently no publicly available documentation on how to deploy a VM from a Content Library via a Script.

Installing Host VIB's Using PowerCLI

Normally when i need to install and update a host VIB I use Update Manager. However there is currently a bug with Cisco’s latest enic/fnic drivers that wont let you install them via UM. I had to run these updates on over 50 hosts and I really didn’t want to have to ssh and install it manually. Lucky I remember Brian Graf’s Host Client Install Fling and borrowed some of the code to come up with the below script.

Using PowerCLI to Build Out vCenter

I wanted to share this handy script i created when you have a need to build out a new vCenter. This script can be extremely handy as it will take care of creating the datacenter, cluster, adding hosts, creating datastores and then applying the appropriate host profile. It is all done via CSV files so it is extremely customizable. Files to modify to customize your configuration createdatacenter.csv - Contains the name of the datacenter to create.

Using PowerCLI to Extend VMDK and Windows OS Disk

I wanted to share this handy script i created when you have a need to extend a disk. This script can be extremely handy as it will take care of extending the VMDK and then going to the OS and then performing the expansion there as well. This has been helpful when needing to extend a large batch of servers (60+). Syntax: .\ExtendVMDKandGuest VMNAME You will then be prompted to enter in the Hard Disk #, the size you want to be extended, and then which drive letter that volume belongs to.

Using PowerCLI to Detach Luns

I thought I would share this script, its been circulating a bit but I feel it is a nice one to have in your toolkit. Have you ever had to remove a LUN from a cluster and thought “Do I really need to detach all the LUN’s, before un-mapping from my SAN?” Unmount Datastore Detach LUN Un-map from SAN Rescan Cluster Well here is a handy script with output.