Am able to get the script for getting package names but am not able to get database info, connection string and users details.
When you say users details, do you mean the users of the package? If so, you are out of luck - this is not stored in the package.
Whether you can easily get the connection info depends on how the connections have been set up. Are they coded directly in the package, or are they inherited from a project?
Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this
If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.
Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.