Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Copy-DbaLogin -Force" removes [BUILTIN\Administrators] on SQL Server on Linux #9539

Open
kekcjkee opened this issue Nov 5, 2024 · 0 comments
Labels
bugs life triage required New issue that has not been reviewed by maintainers

Comments

@kekcjkee
Copy link

kekcjkee commented Nov 5, 2024

Verified issue does not already exist?

I have searched and found no existing issue

What error did you receive?

No explicit error message was received, but the use of Copy-DbaLogin -Force results in the removal of the BUILTIN\Administrators login on SQL Server running on Linux. This leads to operational issues because BUILTIN\Administrators is required for certain administrative tasks.

Steps to Reproduce

# Run the following command on SQL Server on Linux
Copy-DbaLogin -Source <SourceInstance> -Destination <DestinationInstance> -Force
  • The command removes the BUILTIN\Administrators login, which is required for some administrative tasks on SQL Server.
  • In SQL Server on Linux, restoring this account requires a rebuild of system databases, which is a complex process.

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

2.1.26

Other details or mentions

This behavior is documented in Microsoft’s documentation, SQL Server on Linux FAQ, under point 11. However, it is inconvenient for users. A potential solution could be to add a check when running Copy-DbaLogin on SQL Server on Linux, either warning the user or requiring confirmation before removing BUILTIN\Administrators.

Yes, I am aware that using -ExcludeLogin BUILTIN\Administrators can prevent this issue - I do use this option, but memory isn’t perfect, and it’s easy to forget to include it each time.

I understand that this may be considered a user-specific issue, and I am open to the possibility that this may not warrant any changes in the module itself. However, I wanted to bring this to your attention in case there is interest in adding this safeguard for other users who might encounter the same issue.

What PowerShell host was used when producing this error

PowerShell Core (pwsh.exe), Windows PowerShell (powershell.exe), Windows PowerShell ISE (powershell_ise.exe)

PowerShell Host Version

PSVersion 5.1.19041.4291
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.4291
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 2022 (RTM-CU15-GDR) (KB5046059) - 16.0.4150.1 (X64) Sep 25 2024 17:34:41 Copyright (C) 2022 Microsoft Corporation Developer Edition (64-bit) on Linux (Ubuntu 22.04.5 LTS)

.NET Framework Version

.NET Framework 4.8.4712.0

@kekcjkee kekcjkee added bugs life triage required New issue that has not been reviewed by maintainers labels Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugs life triage required New issue that has not been reviewed by maintainers
Projects
None yet
Development

No branches or pull requests

1 participant