how to get the first level of a tree when running get-folder
Dear All, Here is my Vcenter folder tree When I run Get-Folder -Type Datacenter, I am getting the following result : Is there anyway to get the first level (Asia and Europe) only? Thks in advance JJC
View ArticleHardware Version Upgrade
I am looking for a script to schedule hardware version upgrades and will upgrade regardless if I reboot the VM from the vSphere console or the guest OS reboots on its own. Any suggestions?
View ArticleHow to import offline bundle (zip format) into patch repository under vCenter...
Hi all Deployed vCenter Server v6.5 with Update manager. I have another windows machine where VMware PowerCli v5.8 is deployed ,Now i want to import some 3rd party offline bundle which is in zip...
View ArticleScript for attaching multiple existing disk to VM with specific scsi bus...
Hello,I was trying to attach multiple vmdk with specific scsi bus number and device number using import-csv method and onyx tools generated code, Looks like it keep failed and don't able add scsi bus...
View ArticleModifying PowerCLI script to list VM disk usage status that is lessthan 15%...
Hi All, I wonder if anyone here can assist me in modifying the script below to also send which VMs is currently only using less than 15% of the allocated VM Disk space size?So the Output will be:...
View ArticleChange Agent VM Settings using powercli
For a deployment using NSX we are using the Agent VM settings on our ESXi host. I tried to find how to set these values via powercli, but I can't find them anywhere. Could someone show me where I can...
View Articleneed help script not working
Hello, i found this script on the web and want to use it in my environemnt which is vSphere 6.0 without DRS.Scripting a DRS Replacement Using PowerCLI | Scott Warren Unfortunatly it is not working for...
View ArticleDatastore Orphaned Files
This one is for Luc, you made me a script to locate orphaned files and report them to me, but is there a way to ignore the following types: .hlog .vmx~ -ctr.vmdk .vmx.lck function...
View ArticleCombining VM inventory data
I have a report the needs to import VM inventory data from multiple csv's then combine it into a single csv. All of the csv's are in one folder and nothing else is in that folder If you look at the...
View ArticleLimiting the number of Clones while provisioning 20 VMs from CSV file
Hi All, $MaxClones = 3$CSV = "C:\users\$env:username\desktop\file1.csv"$nvm = Import-CSV $CSV -Useculture$idTab = @()$nvm | %{$idTab += New-VM -Name $_.Name` -vm $(Get-Cluster $_.cluster |...
View ArticleAdding multiple Annotations to a VM
Hi I have several Annotations I want to add to a VM using Powercli, and a csv In the csv I have CustomeAttribute,ValueCustomisation,Win10IP,192.168.0.1 In the script $attributes = Import-Csv...
View ArticleGetting physical HDD information (size, number of disks) installed on ESXi...
Hi, I need to retrieve on a ESXi 6.0 host the HDD information (size in GB , numbers of disks installed...). How can I achieve that with POWERCLI Thks JJC
View ArticleBug in Get-VMView - equals filter is using match comparison
So I was working on a PowerCLI script to pull out the SCSI information for vmdk drives, so I can do the matching into the Windows OS to drive letters. Upon doing so, I came across a very odd bug that...
View Articlebulk add vmkernel to esxi
Hello I need to bulk add vmkernel ports to esxi csv file esxi mgmt ip /esxi-vmkernel-name/vmkernelIP can someone help Thanks
View ArticleHow to create a VMDirectPath IO (Paththrough) device by using PowerCLI
Hi all, I would like to create a VMDirectPath IO (Paththrough) device by using CLI.Could you please provide me the command to achieve this through PowerCLI? Thank youMaaTaa
View ArticleShutdown-VMGuest return code
I need to get a return code or something like to test the result of the Shutdown-VMGuest command.I made a test by writing:$shutdown_rc = Shutdown-VMGuest -VM $myvm -Confirm:$false # >...
View ArticlePowerCLI returning incorrect data via SRM API
Hi, The following script is being used to provide a daily report on the state of SRM Protection Groups and, the VM's they protect. Connect-viserver xxxxxxxxxxx$srm = Connect-SrmServer #|out-null$srmApi...
View ArticleNew-TagCategory : 5/2/2017 2:44:44 PM New-TagCategory The underlying...
Has anyone seen errors related to creating tags in the new powercli 6.5.1 New-TagCategory : 5/2/2017 2:44:44 PM New-TagCategory The underlying connection was closed: An unexpected error...
View ArticlePowercli - Losing all VM Tags after a few months
Hi, I'm using a script to automatically tag new VMs so they get backed up if the user which provisioned the VM forgot about it. It works for a few months and then, I lose all my VM tags. It's already...
View ArticleSDRS VM settings always set to fullyautomated with New-VM cmdlet
Hi, Recently I have tried to deploy VM based on Template using PowerCLI and realized that if DataStore Cluster is used, VM is placed there in an Fully automated SDRS mode and with enabled intra-VM...
View Article