dataplat / dbatools

šŸš€ SQL Server automation and instance migrations have never been safer, faster or freer
https://dbatools.io
MIT License
2.39k stars 787 forks source link

Copy-DbaLogin does not update the password if it was changed #9408

Closed LaerteJunior closed 1 week ago

LaerteJunior commented 1 week ago

Verified issue does not already exist?

I have searched and found no existing issue

What error did you receive?

when you change the password of the login, Copy-DbaLogin does not update the password on the source server. No error message is displayed, the login is just skipped because already exists. Already tried with -force and not worked

Steps to Reproduce

# provide your command(s) executed pertaining to dbatools
# please include variable values (redacted or fake if needed) for reference

copy-DbaLogin -Source server01 -Destination server02

Please confirm that you are running the most recent version of dbatools

2.1.16

Other details or mentions

No response

What PowerShell host was used when producing this error

Windows PowerShell (powershell.exe)

PowerShell Host Version

Name Value


PSVersion 5.1.17763.5830
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.5830
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

SQL Server Edition and Build number

Microsoft SQL Server 2019 (RTM-CU26) (KB5035123) - 15.0.4365.2 (X64) Mar 29 2024 23:02:47 Copyright (C) 2019 Microsoft Corporation Enterprise Edition: Core-based Licensing (64-bit) on Windows Server 2019 Standard 10.0 (Build 17763: ) (Hypervisor)

.NET Framework Version

PSChildName Version


v2.0.50727 2.0.50727.4927 v3.0 3.0.30729.4926 Windows Communication Foundation 3.0.4506.4926 Windows Presentation Foundation 3.0.6920.4902 v3.5 3.5.30729.4926 Client 4.8.03761 Full 4.8.03761 Client 4.0.0.0

LaerteJunior commented 1 week ago

Using force it worked

LaerteJunior commented 1 week ago

Using -force sometimes works , sometimes not works

niphlod commented 1 week ago

please paste the verbose log in case "it doesn't work" . did you try adding -KillActiveConnection ?

LaerteJunior commented 1 week ago

It seem that with -KillActiveConnection works, but on which server the active connections will be killed ?

niphlod commented 1 week ago

reading the docs, and the code, on the destination

A login cannot be dropped when it has active connections on the instance. If this switch is enabled, all active connections and sessions on Destination will be killed.

LaerteJunior commented 1 week ago

ThatĀ“s ok . Thanks I will close it

LaerteJunior commented 1 week ago

fixed