vSAN report on storage policy and DRS site affinity membership
Hi all, I run a large vSAN stretched cluster. I constantly run into problems with admins creating VMs in a site, and then assigning the wrong storage policy, e.g. VM is in site B but has storage policy...
View ArticleRe: Change Passwords On All ESXi Hosts
LucD (or anyone) # Clear displayClear-Host # Import required modulesImport-Module VMware.PowerCLI # Define static variables (edit as needed)$vCenter = 'vc1'$Cluster = 'cluster'$NewPwd = 'VMware1!' #...
View ArticleGenerate ESXi Host EOL report
<# =========================================== Created By: Jason Pierce Created on: 31/Jan/2020 Version: 3.0 (Final) NOTE: The $vCenters and...
View Articletry catch not catching specific error
Hello, I'm refining my script and trying to handle errors and write nice error messages. But somehow the catch of an specifiy error will not work.Here's my code:try { Connect-VIServer -Server...
View ArticlePowerCLI 11.5 Get-ContentLibraryItem not compatible with vSphere 6.0
Hi, Just wanted peoples thoughts on this. Recently upgraded PowerCLI from an old version and scripts stop working for Horizon.Specifically Get-ContentLibraryItem says it's not compatible with vSphere...
View ArticleChange Password on All ESXi Hosts sorted by vCenter, then by Cluster
Hi, I'm trying to change all the root passwords by cluster name. I can't get it to work, I don't know what I'm doing wrong. Can someone please help? Here is what I've been trying, but it's not working:...
View ArticleList all VMs without a tag
I'm struggling to figure out how to list the VMs that don't have a tag named "LINUX" or "WINDOWS" in "OS" category. For now, i can find all VMs without a tag, like that : Get-VM |...
View Articleftp_powershell
Hi Luc , this is in continuation of the last thread we discussed about vsphere best practices . i need to put backup directory under ftp server using powershelli want to put that piece of code in the...
View ArticleFind VMs without NSX Security Tags
Is there a way to make a report that shows any vms without a security tag attached, print it to html, and add a total at the bottom. Is this doable or is something needed to pull this data from NSX?
View ArticleGet VMX path of a VM?
Hi, Just wondering how you can find the VMX file of a VM so you can add it to another vCenter? The aim of what I am doing is to Unregister a powered off VM from one VC and Re-Register it in another VC...
View Articlecontent_libray commands _powercli
Hi Luc, i am observing some issues uisnf content lib commands . i am doing following to make commands available (and they are available)Update-Module vmware.powercliImport-Module...
View Articlevc_HA_powercli
HI Luc, i am thinking to add vcenter high availability in folowing way but i did not find direct command to do that .can you please suggest some siple code to do this . #vcenter HA configuration...
View ArticleAdd local user in esxi host using powercli
Hi guys I am looking for powercli to add local user in esxI and add user in read-only default role. incase anyone has please share.
View ArticlePowercli command to enable host encryption
Per vmware docs, you can explicitly enable host encryption.Enable Host Encryption Mode Explicitly I can't seem to find a way to do that via powercli.Any hints? Thanks!
View ArticleVMname, Power status and Guest OS
How would I add Power status on this, and specify I only want powered on VM's in the report? Get-VM | Sort | Get-View -Property @("Name", "Config.GuestFullName", "Guest.GuestFullName") | Select...
View ArticleUnable to resize VM disk after VMWare tools update
I have a PowerCLI script to resize a VM drive and expand it in the Windows OS. After updating guests from tools version 10305 (old) to version 10346. The script fails with this error: Set-HardDisk :...
View ArticleHelp optimizing script - get VM info
I've got a bunch of vCenter servers to manage, and I've been getting a lot of requests to find a particular VM based on its name. I wrote a quick little function to do this, but it's taking longer...
View ArticleGet-VIevent Command Target
I wonder where the event came from.vsphere client -> eventconsole-> table colunm name targetex) vcenter or VM or esxi
View ArticleEsxcli script for powercli
Hi, I want to run this command on all the hosts in a cluster for enabling the Multipathing for a storage LUN created. esxcli storage core device set -d <device> -O 256; esxcli storage nmp device...
View ArticleCommand to tell what vCenter you are connected to
Is there a PowerCLI command to display which vCenter(s) you are connected to?
View Article