This script allows to do a snapshot of a SharePoint Content Database. The script defines a function that allows to do a snapshot for a specific Content Database that is selected by using the Site parameter in the Get-SPCotentDatabase cmdlet. In order to do a Content Database snapshot is required to have SQL Server Enterprise Edition in the both (Note: The script is ready for SQL Server 2008 R2, SQL Server 2012 and SQL Server 2014)

PowerShell
Editar script|Remove
############################################################################################################################################ 
# Script that allows to do an snapshot of SharePoint Content Database 
# Required Parameters:  
#    ->$sSiteUrl: Site Url to get the Content DB 
############################################################################################################################################ 
 
If ((Get-PSSnapIn -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null )  
{ Add-PSSnapIn -Name Microsoft.SharePoint.PowerShell } 
 
$host.Runspace.ThreadOptions = "ReuseThread" 
 
#Definition of the function that performs the Content Database Snapshot 
function DoContentDBSnapShot 
{ 
    param ($sSiteUrl) 
    try 
    { 
        Write-Host "Doing the Snapshot for $sWebApplication !!" -ForegroundColor Blue 
        $sContentDB=Get-SPContentDatabase -Site $sSiteUrl 
        $sContentDB.Snapshots.CreateSnapshot() 
        Write-Host "Snapshot for $sWebApplication successfully completed!!" -ForegroundColor Blue 
        
    } 
    catch [System.Exception] 
    { 
        write-host -f red $_.Exception.ToString() 
    } 
} 
 
Start-SPAssignment –Global 
#Calling the function 
DoContentDBSnapshot -sSiteUrl "http://<Site_Url>" 
 
Stop-SPAssignment –Global 
 
Remove-PSSnapin Microsoft.SharePoint.PowerShell