I regularly move logins between servers. Mostly this is between production and our DR site. I’ve used the code in KB246133 many, many times but it’s pretty limited. I started with that and wrote the script below. There is a user-defined function that’s created in master. You can create it in any database you want but you’ll need to update the script. The function converts varbinary hashed passwords to a string representation. It keeps the password intact for SQL Server logins. It scripts both Windows logins and SQL Server logins. ...