Hello!

Here’s a simple Powershell script here to get the top level info of the cubes on an instance. This is a good script to understand how to use the AMO namespace to get info on the cubes via Powershell. You can add many other properties to this list to expand the info that you want. I’ve often mused about moving a lot of the logic that I constantly put in these scripts into higher tier functions in Powershell, or even create a ssas library, but time is always a premium…

Once you have saved this to a .ps1 file you open up a PowerShell console and drag and drop the file there (or copy as path, whichever way you like) and press enter, or run through Powershell ISE. It’ll ask you for the ssasInstance, and then hit enter and off it goes. The thing I like about checking cube status this way is that it is so much quicker than going through the UI.


[CmdletBinding()]
param(
[Parameter(Position=0,mandatory=$true)]
[string] $ssasInstance)
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.AnalysisServices")
$server = New-Object Microsoft.AnalysisServices.Server
$server.connect($ssasInstance)
$database=$server.databases
foreach ($db in $server.databases)
{
$Cubes=New-object Microsoft.AnalysisServices.Cube
$Cubes=$db.cubes
foreach ($cub in $cubes)
{
$cubewriteout = $Cub|select name,state,lastprocessed,parent
write-output $cubewriteout | format-list
}
}

Here’s a screenshot:

2014-10-16-16_27_40-windows-powershell-ise1_png