Doing Backup-DbaDatabase with user that does not have read or backup rights, log vs diff #10056
Replies: 1 comment 3 replies
-
|
This is actually a bug, thank you for bringing it to our attention. I've created an issue and a PR and will have a fix in in the next release. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a script that loops over a list of databases and performs a log backup hourly and diff backup daily. For some reason the sql user the script operates as had lost the right to read and backup a specific database. This had the consequence that log backups performed after that happened where just skipped. and so where all subsequent log backups in the loop as well, the script just skipped to the
finallypart. Also, in the SQL server logs nothing is caught for this database (all the previous log backups are logged).However, once the script was trigged to run with
$backupTypeset todiffit gave a clear error backMicrosoft.Data.SqlClient.SqlError: The server principal \"usernama\" is not able to access the database \"dbname\" under the current security context. Also, this backup operation is (of course) logged in the SQL server logs.The actual snippet that performs the backup is
I was hoping/expecting that I would get a similar error back when doing log backup instead of silently failing and skipping to the end.
Am I doing something wrong or misunderstanding something?
Beta Was this translation helpful? Give feedback.
All reactions