This is a script from Microsoft that I have used many times to copy SQL Server logins (with their passwords) from one instance to another. When you run the stored procedure it creates, it generates a TSQL script for you that you can then use to copy over your users with their permissions.