Just to inform you all that may be using this script. The software section has a small little problem in that the software i.e. WMI32_Product only returns software that was installed using windows installer! Thus it is not 100% accurate. I suggest on the software section to pull the data from the registry! maybe sombody has a neat script to do this already and it can be incorporated into this existing script.

Also, to write the data to SQL database just change the connection string and wambam thank you mam!

$CNstring = "DRIVER={SQL Server};SERVER=MTCDEV1;UID=assetsdb;PWD=assetsdb;DATABASE=Assets"