New Virtualisation Website Launched!

Hi All, I have just launched my new website http://www.elasticsky.co.uk
Lots of info on the VCP, practice exam questions, video demos, and more to be added.
Please check it out!

Useful Networking Commands In Vmware ESX CLI

1 April 2010
by Paul McSharry
The VI Client is excellent, however when you cannot connect to the ESX host,  its time to go to the CLI.
A few useful commands shown below;
Network Card information: ifconfig
Display the network cards availible in ESX: esxcfg-nics -l
Display the network card linked to service console: esxcfg-vswitch -l
Unlink Vmnic from vswitch esxcfg-vswitch -U vmnic0 vSwitch0  
link a vmnic to vSwitch0 esxcfg-vswitch -L vmnic1 vSwitch0
Change the Vlan ID of the console port in ESX: esxcfg-vswitch vSwitch0 -v 15 -p “Service Console” (where 15 is the Vlan ID)

PowerShell – Clean Up Script – Files older than X number of days

4 March 2010
by Paul McSharry

I have been working with development teams for many years.  One of the most common requests, especially with development and test servers is to automate the deleting of  old log or temp file folders.  Most of the time these files contain debug information, and do not need archiving, but tend to fill the drives to capacity if not maintained.  

To Solve this issue,  the following clean up powershell script is useful;

#powershell clean up script based on file write time

gci “e:\temp\*.*”|? {$_.lastwritetime -lt (get-date).adddays(-1)} |

remove-item

To run this script,   set the powershell  execution policy to RemoteSigned (run the command set-ExecutionPolicy RemoteSigned ) and save the powershell  script  in a .ps1 file.

To configure the script, change the directory path (e:\temp\*.* in this example)  and the number of days required (-1).

To test the script add –whatif  after the “remote-item” cmdlet.  This will show the files that would be deleted and no data will be lost if errors exist.

Once tested, to schedule it  create a batch file with the following   (change the powershell file location).

powershell -command “& ‘c:\delete.ps1′ “

You can now schedule the script with the Windows task scheduler (point to the batchfile).

Check Exchange 2007 Server Edition Level

5 February 2010
by Paul McSharry

To confirm the Exchange 2007 server edition (ie standard or enterprise),  run the following powershell one-liner  from the Exchange Management shell

Get-ExchangeServer | fl name,edition,admindisplayversion

As the example output shows below,  each exchange server in the organisation will be listed with name, edition, and build/patch level.

Name                : Mail1
Edition             : Enterprise
AdminDisplayVersion : Version 6.5 (Build 7638.2: Service Pack 2)
Name                : Mail2
Edition             : Enterprise
AdminDisplayVersion : Version 8.1 (Build 240.6)
Name                : Mail3
Edition             : Enterprise
AdminDisplayVersion : Version 8.1 (Build 240.6)
Name                : Mail4
Edition             : Enterprise
AdminDisplayVersion : Version 8.1 (Build 240.6)