Commit c26c4aa
Uwe Janke
v1.8.19.0: CRITICAL FIX - Sync-Job.ps1 was losing logins via -Force in unattended runs
The SQL Agent job called Sync-sqmLoginsToAlwaysOn -Force. -Force causes DROP+CREATE
(not ALTER) for already-existing logins on the secondary. If CREATE fails afterwards
for any reason (policy, transient error, AD latency), the login is gone entirely
instead of just not updated. Uwe confirmed real login loss in unattended Agent runs;
manual runs without -Force were fine.
Fix: Agent job now calls -Force:$false - only missing logins are added on
secondaries, existing ones are left untouched (no more DROP possible). Removed
-BackupLogins (only active together with -Force anyway).
Deliberate trade-off: password/attribute drift on existing logins is no longer
propagated by the automated sync job. Sync-sqmLoginsToAlwaysOn -Force -BackupLogins
remains available for deliberate manual updates; the function default for -Force
is unchanged ($true) - only the Agent job invocation was changed.1 parent a910566 commit c26c4aa
3 files changed
Lines changed: 23 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
3 | 24 | | |
4 | 25 | | |
5 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
0 commit comments