If you need to fix orphan users you can use my script. Now if you want to run against all databases you can have one more loop and get that passed to get it fix.
Verify Login SID and Machine SID
This script is to verify which login accounts have SID values that don’t match the correct SID values defined on the machine or in the domain.
2019-05-03 (first published: 2014-12-24)
1,618 reads