tags:

views:

84

answers:

1

I have a user asking me to list the dimensions and dimension attributes of our SSAS cube.

I susspect I could generate this via AMO, but I'm wondering if there's an MDX query or SSMS option to show the same info.

Any ideas?

+1  A: 

Here's a script via AMO

[Reflection.Assembly]::LoadWithPartialName("Microsoft.AnalysisServices") | Out-Null
$server = new-Object Microsoft.AnalysisServices.Server
$server.Connect($serverName) 
foreach ($db in $server.Databases)
{
    Write-Host $db.Name
    foreach ($cb in $db.Cubes)
    {
        Write-Host "`t" + $cb.Name
        foreach ($dm in $cb.Dimensions)
        {
            Write-Host "`t`t" + $dm.Name
            foreach ($at in $dm.Attributes)
            {
                Write-Host "`t`t`t" + $at.Attribute
            }
        }
    }
}
Scott Weinstein