Category Archives: PowerShell

Powershell – List all vCenter client sessions & disconnect if inactive

By | March 10, 2010

Today I needed to create a list of all users connected to a vCenter sever through the Client. And during so I created a few variants 🙂 This creates a list of all usernames connected to the vCenter server through a vCenter Client. $svcRef = new-object VMware.Vim.ManagedObjectReference $svcRef.Type = “ServiceInstance” $svcRef.Value = “ServiceInstance” $serviceInstance =… Read More »

Playing with PowerCLI

By | June 13, 2010

Last week I attended a Magirus course on administrating you VMware environment using PowerCLI, and below is some of the small scripts I created. These code sniplets will help you manage your VMware environment and give you some ideas of how powerful the VMware PowerCLI really is. I’m sure VMware will add even more CMDLETS… Read More »

Project Onyx Alpha Release

By | December 10, 2009

Finally everyone outside the closed beta is now able to get hands on with the cool application Project Onyx. Thanks to Carter Shanklin Project overview – Got it from http://www.ntpro.nl/blog/archives/1330-Project-Onyx-Alpha-Release.html Onyx is a standalone application that serves as a proxy between the vSphere Client and the vCenter Server. It monitors the network communication between them… Read More »

Powershell – Add host to Cluster and license it.

By | June 13, 2010

This PowerShell script adds a host to a Cluster and licenses it. Add-PSSnapin VMware.VimAutomation.Core Connect-VIServer “VC_server_name” -User “Administrator” -Password “password” add-vmhost “esxhost” -location (get-datacenter -name ‘Datacenter’ | get-folder -name ‘Folder’ | get-cluster -name ‘Cluster’) -user “root” -password “password” -force: $true $targethostMoRef = (get-VMHost $strHost  | get-view).MoRef $si = Get-View ServiceInstance $LicManRef=$si.Content.LicenseManager $LicManView=Get-View $LicManRef $licassman =… Read More »

A must have for anyone using PowerShell to control VMware

By | September 17, 2009

VMware have released a demo on YouTube that shows a “must have” for PowerShell users who automate and manage vSphere and vCenter through PowerShell. The project is named “Onyx” and works like a middelware between the vCenter Client and the vCenter Server. Onyx is unfortunately still in a private beta and therefore not acceble to… Read More »

Scripts to document your vSphere enviroment

By | September 17, 2009

http://communities.vmware.com/message/1286580#1286580 http://www.ivobeerens.nl/?p=256 http://www.configuresoft.com/esx-compliance-checker.aspx http://www.vmware.com/support/developer/vima/ http://www.run-virtual.com/?p=233 (VMware CPU Host Info) http://teckinfo.blogspot.com/2009/01/vdiagram-document-your-vi-with-one.html (vDiagram)

Powershell : List VMs with CD-ROM, Floppy, Seriel Ports and Parallel Ports

By | April 8, 2009

Today I had to create a script that creates lists of VMs, for each of the below statements: CD-ROM is ‘Connected’ CD-ROM set to ‘Connect at power on’ CD-ROM device type set to ‘Client Device’ CD-ROM device type set to ‘Datastore ISO file’ Floppy is ‘Connected’ Floppy set to ‘Connect at power on’ Floppy device… Read More »

Graph history on your ESX enviroments development

By | January 5, 2009

2 years ago a VMUG user in Denmark created a Ubuntu VM that could graficily could show the develeoment of the amount of VM’s in a Cluster. Unfurtionally someone stole my labtop and the VM :-). So I had to create a new. And of cause it’s based on PowerShell ;-). The webpages shows the… Read More »