Get VMware Session Information

Posted Posted in Information Technology, Virtualization

Luc Dekens has a new post that includes a VMware auditing script that shows how to find out who is logged into the VMware/vSphere Virtual Center and how long they have been online. There was an interesting thread in the PowerCLI Community today. It raised the question how one could report on the current vCenter sessions, including the IP address or hostname from where the session was started. Unfortunately the SessionManager doesn’t hold any information from where the session was started. But there are other ways of finding that information. The UserLoginSessionEvent object has a property, called ipAddress, that has the information we’re after. Btw if you are only interested in looking for […]

PowerCLI to Check Patch Version

Posted Posted in Information Technology, Virtualization

The following question was posted on the VMware community forum – Power Cli Script to retrieve patch level information Hi, I need to retrieve patch level information of esx hosts in vcentre server and i am looking for a power cli script which will retrieve the patch information. Then exports the output to csv/html file. Thanks Gladiator The answer referenced a useful post by Robert van den Nieuwendijk from November that I must have missed. It is a best practise to keep all the hosts of a VMware vSphere cluster at the same patch level. That means that all the […]

VMware vShield PowerShell Module

Posted Posted in Information Technology, Virtualization

Alan recently posted about a new PowerShell module by VMware.  If you are using VMware’s vShield, this is worth a look. A while back I was asked if we could automate some areas of vShield, VMware Security suite of products.  I was asked to do this for a demo which was to be used at VMworld, having never touched vShield before I was thrown into the world of security at the deep end.  The first thing I found on my quest was the vShield API, there is a great document by VMware which explains the vShield proprietary Web-RPC API (Based […]

PowerCLI v5 Gotcha

Posted Posted in Information Technology, Virtualization

vExperienced.co.uk found a Gotcha with PowerCLI v5 – The guest OS configuration makes use of the ‘VMGuest’ family  of cmdlets; Invoke-VMScript Copy-VMGuestFile Get-VMGuest, Restart-VMGuest etc Unfortunately since upgrading to vSphere5 and PowerCLI v5 we’ve discovered that the guest OS cmdlets are NOT backwards compatible! This means if you upgrade to PowerCLI v5 but your hosts aren’t running ESXiv5 and more importantly the VMTools aren’t the most up to date version any calls using the v5 cmdlets (such as Invoke-VMGuest) will no longer work. (read more)

User Sessions and Idle times with PowerCLI

Posted Posted in Information Technology, Virtualization

Shogan.tech has a new post that includes a PowerShell/PowerCLI script that displays users who are logged in and how long they have been idle. Today I was looking into a small “nice to have” notification system for users that had left their vSphere clients open and logged into vCenter. I found this great bit of script to list currently logged in users over at blog.vmpros.nl and thought I would expand on this in my own way to generate a handy list of logged in users and their current idle time – similar to the way the “Sessions” tab in the vSphere client displays […]

PowerShell/PowerCLI to Find ESX Hosts Needing a Reboot

Posted Posted in Information Technology, Virtualization

From Rob van den Nieuwendijk – How to find VMware ESX(i) servers that need a reboot using PowerCLI.  Rob provides a PowerShell/PowerCLI one-liner If you install patches to your ESX(i) servers you will probably have to reboot them. But if you don’t reboot them right after installing the patches, how can you find the servers that are patched and waiting for a reboot? VMWare ESX(i) servers that are waiting for a reboot have the “Reboot Required” message in the Summary tab in the VMware vSphere Client. But if you have hundreds of ESX(i) servers, you don’t want to click through […]

Invoke-VMScript: Running PowerShell on a Remote VM

Posted Posted in Information Technology, Virtualization

PowerCLI guru Luk Dekens has a new post that discusses when you can use Invoke-VMScript to run a PowerShell script on a VMware virtual machine. The Invoke-VMScript cmdlet can be a very useful cmdlet, but sometimes it will fail against one or more of your VMs. And it is not always immediately clear why the Invoke-VMScript cmdlet will not work against that specific VM. The cmdlet help contains a number of prerequisites, but how do you verify if all the prerequisites are fulfilled? I decided to create a function that would verify the prerequisites, and that would, if requested, which […]