Thor Logo dbatools

AG

Get-DbaAvailabilityGroup

Shawn Melton (@wsmelton) | Chrissy LeMaire (@cl)

Get-DbaAvailabilityGroup View Source Shawn Melton (@wsmelton) , Chrissy LeMaire (@cl) Windows, Linux, macOS Synopsis Retrieves Availability Group configuration and status information from SQL Server instances. Description Retrieves detailed Availability Group information including replica roles, cluster configuration, database membership, and listener details from SQL Server 2012+ instances. This command helps DBAs monitor AG health, identify primary replicas for failover planning, and generate inventory reports for compliance or troubleshooting. The default view shows essential properties like replica roles, primary replica location, and cluster type, while the full object contains comprehensive AG configuration details.

Read more

Grant-DbaAgPermission

Chrissy LeMaire (@cl), netnerds.net

Grant-DbaAgPermission View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Grants specific permissions to logins for availability groups and database mirroring endpoints. Description Grants permissions to SQL Server logins for availability groups (Alter, Control, TakeOwnership, ViewDefinition) and database mirroring endpoints (Connect, Alter, Control, and others). Essential for setting up high availability and disaster recovery scenarios where service accounts or users need access to manage or connect to availability group resources.

Read more

Invoke-DbaAgFailover

Chrissy LeMaire (@cl), netnerds.net

Invoke-DbaAgFailover View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Performs manual failover of an availability group to make the target instance the new primary replica. Description Performs manual failover of an availability group to make the specified SQL Server instance the new primary replica. The function connects to the target instance (which must be a secondary replica) and promotes it to primary, while the current primary becomes secondary.

Read more

Join-DbaAvailabilityGroup

Chrissy LeMaire (@cl), netnerds.net

Join-DbaAvailabilityGroup View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Adds a SQL Server instance as a secondary replica to an existing availability group. Description Adds a SQL Server instance as a secondary replica to an existing availability group that has already been created on the primary replica. This command is typically used after creating the availability group on the primary server and before adding databases to the group.

Read more

New-DbaAvailabilityGroup

Chrissy LeMaire (@cl), netnerds.net

New-DbaAvailabilityGroup View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Creates SQL Server availability groups with automated replica setup, database seeding, and listener configuration. Description Creates availability groups with full automation, eliminating the manual multi-step process typically required through T-SQL or SSMS. This command handles the entire workflow from initial validation through final configuration, so you don’t have to manually coordinate across multiple servers and troubleshoot common setup issues.

Read more

Remove-DbaAgDatabase

Chrissy LeMaire (@cl), netnerds.net

Remove-DbaAgDatabase View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Removes databases from availability groups on SQL Server instances. Description Removes databases from availability groups, effectively stopping replication and high availability protection for those databases. This is commonly needed when decommissioning databases, reconfiguring availability group membership during maintenance windows, or troubleshooting replication issues. The function safely removes the database from all replicas in the availability group while preserving the actual database files on each replica.

Read more

Remove-DbaAgListener

Chrissy LeMaire (@cl), netnerds.net

Remove-DbaAgListener View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Removes availability group listeners from SQL Server instances. Description Removes availability group listeners from SQL Server instances, permanently deleting the virtual network name and IP address configuration that clients use to connect to availability group databases. This operation is typically performed during decommissioning, reconfiguration, or when consolidating listeners. Once removed, applications will need to connect directly to individual replicas or use a different listener.

Read more

Remove-DbaAgReplica

Chrissy LeMaire (@cl), netnerds.net

Remove-DbaAgReplica View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Removes secondary replicas from SQL Server Availability Groups Description Removes secondary replicas from Availability Groups by calling the Drop() method on the replica object. This is commonly used when decommissioning servers, scaling down your availability group topology, or removing failed replicas that cannot be recovered. The function accepts either direct SQL instance parameters or piped input from Get-DbaAgReplica for batch operations.

Read more

Remove-DbaAvailabilityGroup

Chrissy LeMaire (@cl), netnerds.net

Remove-DbaAvailabilityGroup View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Removes availability groups from SQL Server instances using DROP AVAILABILITY GROUP. Description Removes availability groups from SQL Server instances by executing the DROP AVAILABILITY GROUP T-SQL command. This is typically used when decommissioning high availability setups, migrating to different solutions, or cleaning up test environments. The function handles the complex considerations around properly removing availability groups to avoid leaving databases in problematic states.

Read more

Resume-DbaAgDbDataMovement

Chrissy LeMaire (@cl), netnerds.net

Resume-DbaAgDbDataMovement View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Resumes suspended data synchronization for availability group databases. Description Resumes data movement for availability group databases that have been suspended due to errors, maintenance, or storage issues. When data movement is suspended, secondary replicas stop receiving transaction log records from the primary, causing synchronization lag. This function reconnects the synchronization process so secondary replicas can catch up to the primary replica.

Read more
Page 2 of 3