I am wondering how to retreive what database is in use in ODBC connections
I know the ODBC connection name
I need to use this name to retreive the database name from ODBC in a powershell script.
I have found that i can retreive ODBC connections with the get-childitem.
But i need to use this to only retreive the database name the ODBC connection uses, and output it in a file or something similar. This is so i can detach these databases using a script afterwards.
Get-childItem -path "hklm:\software\odbc\odbc.ini\"