Robert Martin's Blog

A site about VMware, Powershell and Exchange topics

1. First you need to log in to a machine that has the VMware vSphere CLI installed.

2. Download the following upgrade ZIP bundles from the VMware Web site to a location that is accessible to the vSphere CLI machine.

The esxupdate bulletin, pre-upgrade-from-ESX4.0-to-4.1.0-0.0.build#-release.zip
The upgrade bulletin, upgrade-from-ESX4.0-to-4.1.0-0.0.build#-release.zip

3. Power off any virtual machines that are running on the host and place the host into maintenance mode.

4. Install the esxupdate bulletin by running the following command on the vSphere CLI machine.

vihostupdate.pl -i –server <host name or IP address> –username <username> –password <password> -b <location of the ESX update ZIP bundle>

5. Install the upgrade bulletin by running the following command on the vSphere CLI machine.

vihostupdate.pl -i –server <host name or IP address> –username <username> –password <password> -b <location of the ESX upgrade ZIP bundle>

6. Verify that the bulletins are installed on the ESXi host by running the following command.

vihostupdate.pl -i –server <host name or IP address> –username <username> –password <password> –query

7. Reboot the host.

Ever try to install VMware Tools and after hours and hours the install won’t seem to complete and from the GUI Going to End VMware Tools Install doesn’t work. Well here is how you kill the install from the Console of the ESX Server your VM is running on.

First thing we need to do is get the ID of the VM.

[root@ESXSERVNAME ~]# /usr/bin/vmware-cmd /vmfs/volumes/data-storename/vm-folder/vmname.vmx getid
getid() = idnumber
[root@ESXSERVNAME ~]# /usr/bin/vmware-vim-cmd vmsvc/tools.cancelinstall idnumber

That’s it! You should now be able to manually install the tools on the VM.

The script below was written to add about 1000 user that fit a certain criteria into a group. You could use any field of Get-Mailbox to sort, and this script filters out disabled accounts. To run this script you need to load PSSnapin Exchange and Quest

$users = Get-Mailbox -ResultSize Unlimited | ?{$_.CustomAttribute1 -eq “Phoenix” -and $_.UserAccountControl -notlike “*AccountDisabled*”} | Select GUID
Foreach($user in $users)
{
    Add-qadgroupmember –Identity “CN=WirelessUsers,OU=Groups,DC=mydomain,DC=internal” –Member $user.GUID.ToString()
}