The following powershell scripts enable you to install Exchange 2007 into a new organisation with your optional server roles (Hub Transport, Client Access Server or Mailbox, etc). It also will call another script which creates a new storage group with mailbox database and mounts it. Customise the script to your own environment or however you configure your storage groups/mailbox stores.
Save install-serverroles.txt to Install-ServerRoles.ps1
Save createsgmbxstore.txt to CreateSGMBXStore.ps1