Ignore a database in an Availability group when using @AvailabilityGroups = instead of @Databases with ola-hallengren backup solution I’m using the @AvailabilityGroups= parameter to backup availability groups, is it possible to NOT backup (exclude) a database in the Availability group?

If using the @Databases parameter I could use - but I am using the @AvailabilityGroups parameter instead.

Thanks
You can't use both the @Databases and @AvailabilityGroups parameter. If you try, you'll get this error:


  Msg 50000, Level 16, State 1, Procedure DatabaseBackup, Line 633
  [Batch Start Line 0] You can only specify one of the parameters
  @Databases and @AvailabilityGroups.


For your condition, you'd want to only use @Databases with something like

@Databases = 'DB1, DB2'
@Databases = 'AVAILABILITY_GROUP_DATABASES, -DB1'