Use the SQLDMO reference...

http://vbforums.com/showpost.php?p=1797454&postcount=6