can i query roles and users from my various tabular databases

  • hi we've begun recording apps x roles at my company.  Currently the apps are erp's but i think roles attached to tabular models would blend nicely, especially if i can find a way to also expand the groups assigned to certain roles.  i'd feed the data daily.  from what i've seen AD has some kind of query capability but i couldnt get it too far in my installed AD client.

  • if you are comfortable with PowerShell, this example command will get all end users, including those that are members via a group-within-a-group:

     

    here i am assuming you found a group named "SSASTabularAccess" with current permissions, and want to know who's getting access.

    Get-ADGroupMember -Identity "SSASTabularAccess" -Recursive | SELECT -property SamAccountName |Sort-Object -Property SamAccountName

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • thx lowell, by any chance do you also know how to get a list of members/groups from each role under a tabular model database?   I might have asked too  many questions in this post and can easily post this portion in a new post.

  • This?

    SELECT * FROM $System.TMSCHEMA_ROLES

    SELECT * FROM #TMSCHEMA_ROLE_MEMBERSHIPS

     

     

    • This reply was modified 9 months ago by  Chrissy321. Reason: Added second select
  • thx chrissy321.  Where would i run that?  in the engine on the same server where ssas is?  I dontg think t-sql ius a choice of language on the ssas instance.  i get an error when i run that on the engine.

  • You can issue an MDX query or a TSQL query against a linked server.

    https://www.sqlshack.com/linking-relational-databases-with-olap-cube/

  • thank you chrissy321,

    i read your link quickly and see if i have an mdx query, it would be sent native thru openquery probably via a new query from a db or the instance itself.

    But i can also send thru openquery your t-sql looking querys?

     

  • This is tsql

    DROP TABLE IF EXISTS #Roles;

    SELECT * INTO #Roles FROM OPENROWSET

    (

    'MSOLAP',

    'Data Source=localhost;Initial Catalog=YourSSASDatabaseName;Provider=MSOLAP.4;Integrated Security=SSPI;Format=Tabular;',

    'SELECT * FROM $System.TMSCHEMA_ROLES'

    );

    DROP TABLE IF EXISTS #RoleMemberships;

    SELECT * INTO #RoleMemberships FROM OPENROWSET

    (

    'MSOLAP',

    'Data Source=localhost;Initial Catalog=YourSSASDatabaseName;Provider=MSOLAP.4;Integrated Security=SSPI;Format=Tabular;',

    'SELECT * FROM $System.TMSCHEMA_ROLE_MEMBERSHIPS'

    );

    SELECT * FROM #Roles

    SELECT * FROM #RoleMemberships

  • thx, so those 2 selects are mdx.   i was able to run them right on the ssas instance without a linked server.  But i understand the value in having a linked server where more flexibility is possible.   Now i have to decide whose post to mark as an answer.  i believe only one answer is allowed per post on this forum.  Chrissy321 i "liked" yours and marked lowell's as an answer.  next time i'll separate posts better.

    • This reply was modified 9 months ago by  stan.

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply