Vlad Drumea rebuilds a machine:
Export-DbaLogin does a great job of exporting all logins, but it doesn’t offer a way to migrate the sa password to another instance.
In this case, I didn’t have the sa password and was required to ensure that the rebuilt instance is a 1:1 copy of the original one (edition excluded).This also meant that the existing password used for sa had to be transferred to the rebuilt instance.
Read on to see how you can accomplish this.