VMware script remove CD media

Often I forget to go back and unmount ISO files in VMware. This isn't normally a problem unless you want to do something like delete a storage target, but it is a pain to try and location which VM has the ISO mounted by hand in the vSphere client. This script will remove the ISO media from all VMs. You will need the VMware Power CLI installed to use this script.


$server = "server IP"
$user = "domain\user"
$pwd = "user's password"
Connect-VIServer $server -User $user -Password $pwd
$vms = Get-VM
write "`nVM's with CD-ROM device type set to 'Datastore ISO file' :"
foreach ($vm in $vms | where { $_ | Get-CDDrive | where { $_.ISOPath -like "*.ISO*"} | Set-CDDrive -Nomedia -confirm:$false })  {
                write $vm.name

Deploying software with scripts

Not everyone has fancy(read: expensive) enterprise software to automatically deploy software to desktops.  Installing software by hand is time consuming, boring, and unnecessary with a little help from the pstools suite.

This is pretty basic, but it gets the job done. All we need is 2 batch files, 1 txt file with a list of the desktops we want to install on, and the psexec.exe file from the pstools suite.

Make a batch file for software installation like:


Net use z: \\software\location
cd sub\folder\if\needed
mkdir c:\software
copy *.* c:\software /y
cd c:\software
msiexec /i something.msi /qn (install software with msi)
msiexec /update something.msp /qn (for updating software, like adobe reader)
setup.exe /veryquiet (or something similiar depends on the .exe)
rmdir c:\software
net use z: /delete /y






psexec @workstations.txt -s -c install.bat >> install.log

Copy psexec.exe into the same folder, then just run process.bat from dos and watch the installs.  I normally keep a second window open and 'type install.log' to see the results.

FreeNAS 8 Troubleshooting / Dell PERC5

By default FreeNAS 8 does not have the driver enabled for PERC5 and PERC6 RAID controllers commonly found in 1850/1950/2850/2950 Power Edge servers.  If you want to correct this, boot off the installation CD, and go into the shell.  From the shell you need to mount your already installed FreeNAS parition.

mount /dev/usf/FreeNASs1a /mnt

If your booting FreeNAS of a device not connected via the PERC you can modify the /boot/loader.conf with:


If booting from a USB device change kern.cam.boot_delay=1000 to kern.cam.boot_delay=2000

You may also want to change /etc/fstab to make the file system writable by changing:

/dev/ufs/FreeNASs1a / ufs ro 1 1


/dev/ufs/FreeNASs1a / ufs rw 1 1

1 2 3 4 5 6 7 8 9 10 11 12 »