Renaming Windows Logins in SQL Server after Server or Domain name change

To rename Windows Logins in SQL Server after Server or Domain name change, use this code:

ALTER LOGIN "Old_Server_or_Domain_Name\Windows_Login"
WITH NAME="New_Server_or_Domain_Name\Windows_Login"

Domain logins must be enclosed in brackets.

If you can't login to SQL Server using Windows authentication after Server or Domain name change, and you don't have any logins with sysadmin role that can connect using SQL Server authentication read related blog post:
Access to SQL Server when all administrator accounts are deleted