Category Archives: Scripting

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)