SharePoint 2016, Sharepoint 2013, Sharepoint 2010, Windows Server 2012, Sql Server 2012,2014,IIS, Active Directory,User Profile Service, Managed MetaData Service, Search Service, Topology, Web Application, IIS, Site collection, List, Library, PowerShell, office web app, Windows Authentication, NTLM, Kerberos, Saml, ADFS, Active Directory Import, MIM, SharePoint 2016 PowerShell cmdlets for Managing Database – SharePoint

SharePoint 2016 PowerShell cmdlets for Managing Database

Introduction

I will walk through the cmdlets which are available in SharePoint 2016 RTM for managing Databases. With the release of SharePoint 2016, Microsoft introduced 3 new cmdlets for managing the AlwaysOnGroup. Now with the help of new cmdlets, SharePoint administrator can manage the Availability group on AlwaysOn database.

Here are the list of commands:

  • Get-AvailabilityGroupStatus
  • Add-DatabaseToAvailabilityGroup
  • Remove-DatabaseFromAvailabilityGroup
  • Dismount-SPContentDatabase
  • Mount-SPContentDatabase
  • Test-SPContentDatabase

Get-AvailabilityGroupStatus

This command will return all available availability groups which are known to SharePoint farm. I.E

Get-AvailabilityGroupStatus -Identity krossfarmGroup

This example returns an availability group named KrossFarmGroup

Add-DatabaseToAvailabilityGroup

This command will use to add database(S) from a SharePoint farm into an availability group on the SQL Server. i.e

Add-DatabaseToAvailabilityGroup -AGName KrossFarmgroup -DatabaseName KF-ContentDB -FileShare \\backup\share\

This example adds an availability group named KrossFarmgroup to the KF-ContentDB content database

  • AGName (Required) The name of the availability group from which the databases are being added.
  • DatabaseName (Required) The name of the database to be added to the availability group.
  • FileShare ( Optional) When a database is being added to the availability group, backup / restores are done from this location to propagate the database to all replicas.

Remove-DatabaseFromAvailabilityGroup

This command will removes one or more SharePoint databases from an availability group in SQL Server.I.e

Remove-DatabaseFromAvailabilityGroup -AGName KrossFarmgroup -DatabaseName KF_ContentDB

This example removes the KrossfarmGroup availability group from the KF_contentDB content database.

  • AGName (Required) The name of the availability group from which the databases are being added.
  • DatabaseName (Required) The name of the database to be added to the availability group.
  • Force(Optional) System.Management.Automation.SwitchParameter Forces a remove from the group.
  • KeepSecondaryData(Optional) SwitchParameter Specifies that copies of the databases on the replicas in the availability group will not be deleted. Otherwise, those database copies will be dropped.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *