Copy-SqlLogin - can -Force copy login if login exists and connected
Please fix issue with killing login connection on destination instance when Copy-SqlLogin used with -Force switch.
Talked to him directly and he'd like a check to see if the user is logged in, and if they are, he'd like a notification before their connection is killed basically saying they're logged in and their connection will be killed.
he'd like a notification before their connection is killed basically saying they're logged in and their connection will be killed.
So if they are logged in, output "User is logged in, the connection will be killed." and then kill the connection anyways? Or just a warning that says "User is logged in, this would kill the connection."
I think if user specified -Force flag, it is better to just kill process and procede forward with all remaining things.
So what your'e saying @Zhunya is that you want the login to be skipped if its logged in? Logins are skipped if Force isn't specified. Not using Force would be a better solution.
Not using Force for production system better solution, I agree. But if Force specified just kill all login connections add recreate login, thats it, is it clear now? Some times it's very hard for me to explain things in English, sorry.
Ahh yes, very clear now, thank you. That was the original intent of -Force but the kill connection was not immediately before the drop, so the login had time to log back in. We fixed that yesterday in PR #285. Does that cover all of your concerns?
Yes, thank you!
Excellent, will close this issue. Thanks for following up, @SirCaptainMitch!