search
top

Script: Automated Deployment of Test VMs

If you have ever had the need to fire up a number of VMs for load testing or anything like that you know it can be a pain to do it the manual way. Here is a script that will allow you to use a Custom Specification to deploy any number of VMs from a Template $VMName = "vmt0-" $VMHost = "esxihost.mydomain.local" $Template = "vmTemp-" $Datastore = "LUN05" $CustomSpec = "WinSpec05" $numberofvms = 10 $NArray =... read more

Script: Set VM Security Settings per VM Hardening Guideline

If you want to set the security setting for one VM you could do something like this # Script for one VM: Get-VM -Name "VMNAME" | Get-View | foreach { $ConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec $OValue = New-Object VMware.Vim.optionvalue $OValue.Key = "isolation.tools.diskShrink.disable" $OValue.Value = "true" $ConfigSpec.extraconfig += $OValue $task =... read more

Script: Set a timeout for Tech Support Mode

A timeout can be configured for Tech Support Mode (both local and remote), so that after being enabled, it will automatically be disabled after the configured time. A value of ten minutes is recommended, although the exact value depends upon the needs of your particular environment. If Tech Support Mode is left enabled by accident, it increases the potential for someone to gain privileged access to the... read more

Script: Create Local ESXi Datastore and change Advance Settings

If you are wanting to follow the ESXi Security Guidelines and setup a local datastore and change your Advance settings for each host to point to the new local datastore and have many hosts like I do your gonna want to automate this. With the help of VMware Labs Onyx I came up with the following script that will do just that. Connect-VIServer VC01 $datacenters = Get-Datacenter foreach($dc in... read more

Script: Enable Change Block Tracking on all VMs

If you are in need of changing the Change Block Tracking on many VMs at once you can run this script and it will fix them all, as long as they are running Hardware Version 7, it will also complete the stun‐unstun cycle I want to give credit to the article I read to create this script here Connect-VIServer VC01 Function EnableChangeBlockTracking { param($vm) $vmView = Get-VM $vm |... read more
Page 1 of 512345
top