Tag: PowerCLI

  • Extremely slow when run PowerShell script by scheduled taks

    I like automition/programming as much as I like Windows, my first offical training in University was VB, then I learned PHP and HTML after graduated. I can’t believe my first PHP program was welcomed in internel. But I stopped develop the skill. I got lot of special request for virtual environment. Some people want to monitor…

  • $array.count does not show anything in PowerCLI

    I developed a script to take snapshot on VM and delete older snapshot regularly. I  used  variable $snapshots to receive data from Get-Snapshot command, then determine how many existing snapshots according to return of $snapshots.count. Somehow the script always ran incorrect behavior. When I deep looked into $snapshots, I found a interesting things. Computer A, $snapshots.count return nothing if no, or…

  • How to get HBA WWPN of ESXi hosts

    It’s busy month, I haven’t update my blog since I back from Phuket with my wife. I’m running into multiple projects, a little overload. Just a quick share, my storage team ask me provide WWPN of all hosts to do a health check. it’s nightmare to pull out the data from vSphere client or web…

  • Nodes in the ESXi cluster may report corruption after reboot host or attach device

    VCE just released a new KB vce2563 to description the issue. If your ESXi 5.x hosts is connected on VMAX running Enginuity 5876.159.102 and later, you may see this particular issue after reboot ESXi host or attach storage if you enabled block delete feature of VAAI. To check the option status you can run following command on…

  • How to Add VMware PowerCLI to Standard PowerShell Enviroenment

    1. create a file with name “Profile.ps1” under %windir%system32WindowsPowerShellv1.0profile.ps1 2. Add following content to the file. # Adds the base cmdlets Add-PSSnapin VMware.VimAutomation.Core # Add the following if you want to do things with Update Manager #Add-PSSnapin VMware.VumAutomation # This script adds some helper functions and sets the appearance. You can pick and choose parts…

  • Get specific advanced configuration of ESXi host

    Storage team said the best practics of QFullSampleSize is 32, they want to check how it’s going in our environment. It’s easy to check individual host, but pretty time consuming if you want to check 300+ hosts. Here is a one line PowerShell script to export QFullSampleSize and QFullThreshold to a csv file. Get-VMHost |…

  • How to retrieve RDM information by PowerCLI

    I worked on move RDM LUNs of Microsoft Cluster virtual machine from one iGroup to another. To make sure the moving safe, we should record RDM LUN information before migration. We had two VMs with almost 20 RDM LUNs, it’s pretty time consume to get the information manually, I used following script to retrieve information: $RMDinfo =…

  • How to remove multiple snapshot by PowerCLI

    My SMVI backup job was crashed few days ago, the stupid application generated a lot of snapshots for virtual machine!!! It’s  hundred! I really don’t like to remove one by one! That’s what I used to clean up the snapshot. Get-VM | Get-Snapshot -Name smvi* | Remove-Snapshot I used wildcard smiv*, it means all snapshot that…

  • Move multiple datastores to a folder

    We are moving virtual machine from old storage to new datastore today, there are a lot of old datastores need to be removed after migration, for saftey consideration, I move all old datastore to a folder and then do decommission process. There are more than 60 datastores, and vSphere client not allow move in one time. Here…