0

I have a tabular model/database in an Azure Analysis Server instance. Model/database has roles and users/groups were added on each role. I can see the list by right click on the role and then go to membership.

My questions are:

1-Is there a script I can use to list the roles and the users in each role without using the method described? It can be using powershell, TMSL or any other ideas.

2-When you add a group as a role member, the group is displayed as a long hexadecimal string, is there a way to get the name of the group?

3
  • If you have the model solution in Visual Studio which has all the right members (or if you can import the model into Visual Studio with New Project... Import from Server (Tabular)) then you can use the BI Developer Extensions "Roles Report" feature to spit out a nice report including role members: bideveloperextensions.github.io/features/RolesReport Feb 24, 2018 at 4:27
  • Thanks Greg, I have tried your method, and the report is generated with the roles but it shows that the roles are empty, as if they don't have any users/groups added to the roles. I'm not sure if this is a feature that does not work on azure analysis services. Thanks! Feb 26, 2018 at 20:16
  • hmm. Thanks for reporting. That surprises me. I put it on the issues list so we can take a look: github.com/BIDeveloperExtensions/bideveloperextensions/issues/… Feb 27, 2018 at 6:12

1 Answer 1

0

this should get you started (boogles my mind that there isn't a Get-RoleMember cmdlet)

[Reflection.Assembly]::LoadWithPartialName("Microsoft.AnalysisServices")

$ServerName = "asazure://aspaaseastus2.asazure.windows.net/alignpocaas"
$DB = "alignpocaas"

$MyServer = New-Object Microsoft.AnalysisServices.Server
$MyServer.Connect($ServerName)

$myDatabase = $myServer.Databases.Item($DB)
$myDatabase.Roles
3
  • Thanks Jason. I have tried scripts like that but they don't seem to work. I'm running this script in my local machine and I also tried it on a VM with SQL Server with no results. Where are you running it for it to work? I just received a dataset with 3 columns: GAC, VERSION, LOCATION. But nothing about the roles and users. :( Feb 15, 2018 at 16:09
  • I ran it from my local machine... Can you output the value of $myserver Feb 15, 2018 at 19:47
  • I tried to paste the info here but it's a lot of data, and it does not allow images either, I saved an screenshot and share it using dropbox, you will see some data in black, that's private data like server name: dropbox.com/s/zgn2uz5wmxpyibk/MyServer.png?dl=0 Feb 15, 2018 at 20:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.