AMO Wrappers for Securing Analysis Service Cube

As you can see, it’s fairly easy to automate cube security using AMO methods.

Example of Calling AMO Wrappers

Shown below is a vb application that implements the AMO wrappers (repeat of the code shown at the beginning of the post). The creating of wrappers around generic AMO methods simplifies automation, promotes code re-use and enables better error handling.


Imports BennyAustin.SSAS.Wrappers

Module CallAMOWrapper

Sub Main()

Try

'Instantiate Major Objects

Dim objSec As AMOWrapper = New AMOWrapper("localhost", "Adventure Works DW", "Adventure Works DW")

'Backup AS Database before proceeding...

objSec.BackupDatabase("d:\backups\AW.abf")

Dim roleName As String = "Reader"

'Add New Role

If objSec.AddRole(roleName) Then

'Give Read Permission on Cube to New Role

objSec.GrantCubeRead(roleName)

'Give Read Permission on all Dimensions to the New Role

objSec.GrantDimensionRead(roleName)

'Add Members to the New Role

objSec.AddMemberToRole(roleName, "\benny.austin")

End If

Catch ex As Exception

'log exception using your exception handler

End Try

End Sub

End Module

BENNY AUSTIN

3 thoughts on “AMO Wrappers for Securing Analysis Service Cube

  1. I think speaking or writing it out loud made me think about it more. Then it downed on me to use SQL Profiler!

    … why didn’t I think of this before?!?!

    I’m proud and ashamed at the same time in finding out this simple answer to my own question.

  2. Hi,

    This question has been bugging me for a long time. How can you identify who are the currently connected users on your Analysis Services?

    Any insight would be appreciated.

    Thanks in advance

Leave a Reply to CountDigit Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s