dbatools icon indicating copy to clipboard operation
dbatools copied to clipboard

Create contained availability group

Open thewaiting28 opened this issue 2 years ago • 5 comments

Summarize Functionality

Would love to be able to create new contained availability group, either with New-DbaAvailabilityGroup or a new command? Also query whether or not an AG is contained. Thank you!

Is there a command that is similiar or close to what you are looking for?

Yes

Technical Details

Something like "New-DbaAvailabilityGroup -Primary sql01\inst01 -Secondary sql02\inst02 -Name "ag01" -Database "Database01" -Contained $true

Or, -Contained just as a switch

thewaiting28 avatar Jan 05 '23 01:01 thewaiting28

Contained Availability Group is a SQL Server 2022 only feature. At a minimum this cannot be implemented until we are using SMO version that supports full SQL Server 2022 compatibility in the dbatools.library.

Not a priority right now but if anyone would like to submit a PR post 2.0 release, we are happy to review and accept.

wsmelton avatar Jan 07 '23 18:01 wsmelton

Quick check in SMO the preview release does not show support of this as of yet. I'm not sure if sqlserver module is supporting this already.

At this time, we can't support it but will leave the issue open until we find SMO can support it.

wsmelton avatar Jan 07 '23 18:01 wsmelton

Thank you!

thewaiting28 avatar Jan 10 '23 18:01 thewaiting28

Hi, what is the status on this? It seems that the SMO does support contained AGs. It's just not documented as of yet. https://github.com/microsoft/sqlmanagementobjects/issues/154 Would really love to see this feature implemented.

DorBreger avatar May 04 '24 19:05 DorBreger

I have a solution for this I developed and tested for my own environment. I'll get that posted shortly.

serenefiresiren avatar May 10 '24 23:05 serenefiresiren

@thewaiting28 looks like you can stop waiting

DorBreger avatar May 16 '24 20:05 DorBreger