Categories
PowerShell Scripts Virtualisation VMware vSphere

Copy ResourcePools from 1 Cluster to another …

This is a small scriptlet to copy the ResourcePools (just the ResourcePools no settings or VM’s) of Cluster1 to Cluster2 Connect-VIServer -server VCENTER-IP -User USERNAME -Password PASSWORD $respools = Get-ResourcePool -Location CLUSTER1 foreach ( $respool in $respools ) { Write-Host $respool New-ResourcePool -Location CLUSTER2 -Name $respool -Confirm:$false } Disconnect-VIServer -Confirm:$false -Force:$true -Server VCENTER-IP

Categories
PowerShell Scripts theVESI Virtualisation VMware vSphere

Get VM information as Script node for the Virtualization EcoShell

This script node will open a small window with a drop down menu with all your VM’s listed. Select one and click on OK. The script will collect some information and then display them. Script node: if ($global:defaultviservers) { #Generated Form Function function GenerateForm { ######################################################################## # Code Generated By: SAPIEN Technologies PrimalForms (Community Edition) […]

Categories
PowerShell Scripts

Count VMs ToolsOK | ToolsOld | ToolsNotInstalled

Connect-VIServer -server VCSERVER -User USER -Password PASSWORD $vms = Get-VM | Sort Name $on = 0 $toolsOk = 0 $toolsOld = 0 $toolsNotInstalled = 0 foreach ($vm in $vms){ if ($vm.PowerState -like “PoweredOn”){ $vmview = $vm | Get-View $toolsstatus = $vmview.Guest.ToolsStatus $toolsrunningstatus = $vmview.Guest.ToolsRunningStatus $toolsversionstatus = $vmview.Guest.ToolsVersionStatus $on = $on+1 if ($toolsstatus -like “toolsOk”){ $toolsOk […]

Categories
ESXi PowerShell Scripts Virtualisation VMware vSphere

Find VMs with Video Card Memory higher than 30MB

Connect-VIServer -server VCENTER -User USER -Password PASSWORD $vms = Get-VM foreach ($vm in $vms) { $vmview = $vm | Get-View foreach ($device in $vmview.config.hardware.device) { if ($device.Key -eq 500){ $test = $device.DeviceInfo.Summary $result = $device.videoRamSizeInKB if ($result -cgt 30000){ $mb = $result/1024 Write-Host $vm $result $mb } } } } Write-Host “Done”

Categories
PowerShell Tools

New Version of vEcoShell released

There is a new release of the powerful vEcoshell available. vEcoShell

Categories
ESXi PowerShell Scripts VMware vSphere

Some helpfull PowerShell functions (working with 60 days trail license)

Variables: $ServerIP = “YourESXiServerIP” $SysLog = “YourSyslogServerIP” Configure Syslog server using Powershell function syslog { $VMHost = Get-VMHost -Name $ServerIP Set-VMHostSysLogServer -VMHost $VMHost -SysLogServer $SysLog -SysLogServerPort 514 } Configure NTP server and restart NTP service function set-ntp{ $vmHost = Get-VMHost -Name $ServerIP Add-VMHostNtpServer -VMHost $VMHost -NtpServer YourNTPserver1 Add-VMHostNtpServer -VMHost $VMHost -NtpServer YourNTPserver1 Get-VmHostService -VMHost $VMHost […]

Categories
ESXi HP PowerShell Scripts VMware vSphere

we got our first HP DL380G6

Today we got our first HP DL380G6 server with 2x 2,8GHz Intel Nehalem, 72GB RAM and 2x 146GB Disks. I have successfully installed VMware ESXi 4 on this box. After this I have started the configuration. In the next days I’m going to run some test on this box and hopefully get the 2nd HP […]

Categories
ESXi Ideas PowerShell Scripts VMware

Setup a Windows XP appliance …

Currently I setup a Windows XP appliance which I would like to use for a new way to manage a VMware ESXi plattform. A colleague had this idea to create an interface to manage ESXi free server’s from any kind of CMS. Some details: OS: Windows XP Software: Apache, PHP, Powershell, VMware PowerCLI, JSON for […]

Categories
PowerShell

Count VM’s on ESX host

This one-liner will count all VM’s on a ESX host Get-VMHost -Server xxx.xxx.xxx.xxx | Select Name,@{N=”NumVM”;E={($_ |Get-VM -Server xxx.xxx.xxx.xxx | where {$_.PowerState -eq “PoweredOn”}).Count}} Coding for usage with the VESI: $noConnection = $true if ($global:vmwareManagedHosts) { foreach ($key in @($global:vmwareManagedHosts.Keys)) { if (($managedHost = $global:vmwareManagedHosts[$key]) -and ($managedHost.Connected)) { $noConnection = $false Get-VMHost -Server $managedHost.connection | […]