Tag: PowerShell

  • 整合PowerCLI与PowerShell

    早先我有写一篇文章关于如何手工整合PowerCLI和PowerShell。最近重装了系统,不得不再做一次。以前我习惯用PowerGUI写脚本,但不知道怎么搞的PowerGUI总是丢失菜单界面,这困扰了我很久一直没办法完全解决,所以这次我在想能不能把PowerCLI和PowerShell整合了一劳永逸,毕竟内置的好用一些啊。

  • 如何使用PowerCLI获取物理RDM LUN的路径选择策略

    获取RDM磁盘信息是一件很磨人的事儿,如果你很仔细你就需要把每台都检查一遍以确保信息是一致的。研究出来两行命令,可以批量获取RDM磁盘信息。

  • How to Automate Snapshot on Virtual Machine

    I always treat virtual machine snapshots like a big risk. It caused several outages in our infrastructure. Please check out Best practices for virtual machine snapshots in the VMware to understand how it impacts production. 虚拟机快照对我来说绝对是个大威胁,已经在我的生产环境里发生过好几次由此引发的故障了。如果你要了解快照对生产环境的影响可以看看:Best practices for virtual machine snapshots in the VMware

  • How to integrate PowerCLI with PowerShell and PowerShell ISE

    I wrote a post about how to integrate PowerCLI with PowerShell manually. I rebuilt my computer few days ago, need to integrate PowerCLI again. I used to scripting by PowerGUI, but something always lead to PowerGUI lost menu, it frustrated me a long time. I cannot figured out what’s the root cause. So I wondered…

  • How to get HP ProLiant blade server and enclosure information

    An enterprise infrastructure administrator needs to run plenty of reports for firmware, software version, or any kind of infrastructure data in their day-to-day operation. Some vendors provide powerful tools to pull out data from their solution, but what if you don’t have such tools? It is pain to get data manually especially for large number…

  • 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…

  • 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…