Analysis Services PowerShell Reference

Applies to: SQL Server Analysis Services Azure Analysis Services Power BI Premium

Analysis Services PowerShell cmdlets are included in the SqlServer module.


Azure Analysis Services database operations use the same SqlServer module as SQL Server Analysis Services. However, not all cmdlets are supported for Azure Analysis Services. To learn more, see Manage Azure Analysis Services with PowerShell.

Analysis Services Cmdlets

Analysis Services provides cmdlets correspond to methods in the Microsoft.AnalysisServices namespace. The following table describes each cmdlet and provides a link to the corresponding AMO method.

If you want to use PowerShell to perform a task that is not represented in the following list (for example to create or synchronize a database), you can write TMSL or XMLA script for that action, and then execute it using the Invoke-ASCmd cmdlet.

Cmdlet Description Equivalent AMO Methods
Add-RoleMember cmdlet Add a member to a database role. <xref:Microsoft.AnalysisServices.RoleMemberCollection.Add%2A>
Backup-ASDatabase cmdlet Backup an Analysis Services database. Database.Backup
Invoke-ASCmd cmdlet Execute a query or script in XMLA or TSML (JSON) format. <xref:Microsoft.AnalysisServices.Core.Server.Execute%2A>
Invoke-ProcessASDatabase Process a database. <xref:Microsoft.AnalysisServices.IProcessable.Process%2A>
Invoke-ProcessCube cmdlet Process a cube. <xref:Microsoft.AnalysisServices.IProcessable.Process%2A>
Invoke-ProcessDimension cmdlet Process a dimension. <xref:Microsoft.AnalysisServices.IProcessable.Process%2A>
Invoke-ProcessPartition cmdlet Process a partition. <xref:Microsoft.AnalysisServices.IProcessable.Process%2A>
Invoke-ProcessTable cmdlet Process a table in a Tabular model, compatibility model 1200 or higher. <xref:Microsoft.AnalysisServices.IProcessable.Process%2A>
Merge-Partition cmdlet Merge a partition. <xref:Microsoft.AnalysisServices.Partition.Merge%2A>
New-RestoreFolder cmdlet Create a folder to contain a database backup. <xref:Microsoft.AnalysisServices.RestoreFolder>
New-RestoreLocation cmdlet Specify one or more remote servers on which to restore the database. <xref:Microsoft.AnalysisServices.RestoreLocation>
Remove-RoleMember cmdlet Remove a member from a database role. <xref:Microsoft.AnalysisServices.RoleMemberCollection.Remove%2A>
Restore-ASDatabase cmdlet Restore a database on a server instance. <xref:Microsoft.AnalysisServices.Core.Server.Restore%2A>