I have circumstances that a server can host many databases and a lot of them get offline and transfered elsewhere from time to time. This causes lots of server logins to be created and stay there after the transfer. I need a script to find all the server logins that are mapped to offline or non existing databases so I can clean them.
Thank you!