Get Cube Status From PowerShell
Here is a neat little script; it gets all the status info of an Analysis Service database instance and the cubes within that database. You should see that status ought to be “Processed” and if not, you know that something has gone wrong in your database. This script can be quite easily expanded into including dimensions, measure groups, partitions, but I personally split that out into different scripts otherwise the screen looks too full of info and you cannot see the forest for the trees.
[CmdletBinding()]
param(
[Parameter(Position=0,mandatory=$true)]
[string] $ssasInstance)
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.AnalysisServices")
$server = New-Object Microsoft.AnalysisServices.Server
$server.connect($ssasInstance)
$database=$server.databases
foreach ($db in $server.databases)
{
$dbwriteout = $db|select name,state
Write-host $dbwriteout -foregroundcolor darkgreen -backgroundcolor white
$Cubes=New-object Microsoft.AnalysisServices.Cube
$Cubes=$db.cubes
foreach ($cub in $cubes)
{
$cubewriteout = $Cub|select name,state,lastprocessed
write-host $db "$($cubewriteout)" -foregroundcolor darkgreen -backgroundcolor white
}
}
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. 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.