Copy-DbaLogin - Copy the permissions of a login on logins, server roles, endpoints and availability groups

Đang mở
#10,834 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
databases, powershell
Lĩnh vực
database

Hướng nghiên cứu

Read Copy-DbaLogin, Sync-DbaLoginPermission, and Export-DbaLogin, focusing on how they use Server.EnumServerPermissions and Server.EnumObjectPermissions. The proposal leaves open whether endpoint and availability-group permissions should be copied behind a switch, so first clarify the intended scope. Done means the agreed permissions are copied or scripted correctly, including the behavior for missing securables and renamed logins.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Copy-DbaLogin, Sync-DbaLoginPermission and Export-DbaLogin handle the permissions of a login on the server itself (Server.EnumServerPermissions, class 100 in sys.server_permissions), its server roles, its database users and their permissions. They never copy the permissions of the login on other server securables (Server.EnumObjectPermissions):

  • logins and server roles (class 101): IMPERSONATE ON LOGIN::x, CONTROL/ALTER/VIEW DEFINITION ON LOGIN::x or ON SERVER ROLE::x
  • endpoints (class 105): CONNECT ON ENDPOINT::x
  • availability groups (class 108): ALTER/CONTROL/VIEW DEFINITION ON AVAILABILITY GROUP::x

A login copied to a new instance therefore loses, for example, the IMPERSONATE an application login needs for EXECUTE AS LOGIN. Since #10801, an existing login that -UpdateExisting or Sync-DbaLoginPermission syncs loses the class 101 permissions that the source login does not have, but it gets none that the source login has.

Proposal:

  1. Copy the class 101 permissions of the source login whose securable exists on the destination (with a rename, the securable is matched by name, the grantee is the new login). A missing securable gives a verbose message, not a failure.
  2. Leave endpoints and availability groups out by default. They belong to the replica: a secondary grants CONNECT on its endpoint to the service account of the primary, and endpoint names may differ per replica. A switch could copy them where the names match.
  3. Script the same permissions in Export-DbaLogin.

Is this wanted, and should 2 be a switch or left out entirely?


This text was created by Claude and reviewed by Andreas Jordan.

Ngôn ngữ chính
PowerShell
Star
2.9k
Fork
869
Merge trung bình
2 ngày 4 giờ
Pull request đã merge (30 ngày)
38

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của dataplat/dbatools

Tất cả issue của dataplat/dbatools

Issue tương tự

Thêm issue về Databases

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.