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

Aperta
#10,834 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
databases, powershell
Ambito
database

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
PowerShell
Stelle
2.9k
Fork
869
Merge medio
2g 4h
PR unite (30g)
38

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di dataplat/dbatools

Tutte le issue di dataplat/dbatools

Issue simili

Altre issue su Databases

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.