Analysis Services PowerShell Reference

Analysis Services includes a PowerShell provider (SQLAS) and cmdlets (SQLASCMDLETS) so that you can use Windows PowerShell to navigate, administer, and query Analysis Services objects. For more information about loading and using the provider and cmdlets, see PowerShell scripting in Analysis Services. For an example of how to use AMO types in PowerShell to create a Tabular database, see AMO PowerShell Example.

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. Add
Backup-ASDatabase cmdlet Backup an Analysis Services database. Microsoft.AnalysisServices.Database.Backup
Invoke-ASCmd cmdlet Execute a query or script in XMLA or TSML (JSON) format. Execute
Invoke-ProcessASDatabase Process a database. Process
Invoke-ProcessCube cmdlet Process a cube. Process
Invoke-ProcessDimension cmdlet Process a dimension. Process
Invoke-ProcessPartition cmdlet Process a partition. Process
Invoke-ProcessTable cmdlet Process a table in a Tabular model, compatibility model 1200 or higher. Process
Merge-Partition cmdlet Merge a partition. Merge
New-RestoreFolder cmdlet Create a folder to contain a database backup. RestoreFolder
New-RestoreLocation cmdlet Specify one or more remote servers on which to restore the database. RestoreLocation
Remove-RoleMember cmdlet Remove a member from a database role. Remove
Restore-ASDatabase cmdlet Restore a database on a server instance. Restore

See Also

Tabular Model Scripting Language (TMSL) Reference
Compatibility Level for Tabular models in Analysis Services
Analysis Services Scripting Language (ASSL for XMLA)
PowerShell scripting in Analysis Services