SSAS Cube or Database backup with Powershell command "Backup-AsDatabase"

 #Date Converion with minutes and seconds
 $date = (get-date).ToString("MM_dd_yyyy_hh_mm_ss")
 $Server = New-Object Microsoft.AnalysisServices.Server
 $Server.Connect("MAPS\TEST")
 $dbservers = $Server.Databases|Select-Object Name,ParentServer
 $dbservers|ForEach-Object{
 $inddb = $_
 #The "Backup-AsDatabase" is especially for SSAS cube backup and downloaded from "SQLServer" powershell module
 Backup-ASDatabase -BackupFile "E:\MAPS_TEST\SSAS_BACKUP\NEW\$($inddb.Name)_$($date).abf" -Name $inddb.Name -Verbose -Server $inddb.ParentServer
 Write-Host "SSAS cube backup [$($inddb.Name)] completed successfully on server [$($inddb.ParentServer)]"
 Write-Output "SSAS cube backup [$($inddb.Name)] completed successfully on server [$($inddb.ParentServer)]"
 }

Comments

Popular posts from this blog

System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out

Pre login Handshake or Connection Timeout Period

Transparent Data Encryption(TDE) with Master Key and Certificate in SQL Server