UPDATE 11 Feb 2008: The offical tool is now out. See http://www.sadev.co.za/node/167. The download for the beta one has been removed.
If you go through the documentation for MSCRM 4.0 there is a tool which can do the configuration of for you. However this tool does not exist yet and to get it you need to speak to Microsoft Product Support Services as it is still beta. However from looking at the news groups it seems thats hit and miss (guessing that some of the support guys know about it and some don't as it is beta). So until it is available I am putting it up here.
NOTE: This is a BETA tool and neither Microsoft nor myself will give you any help on this. This tool could completely damage your system so if you don't trust it, then do the steps described in the documentation.