Misc changes to checkdbs and new script

debug changes to attachdbs. Added logic to clean up checkdbs so the
loops inside SQL work smoother. New script, findmisingdbs is copy of
checkdbs for now.
Write-Output

refactored Write-Host to Write-Output