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
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.
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