SSAS XMLA DISCOVER:如何获取 SSAS 数据库中的角色列表 [英] SSAS XMLA DISCOVER: how to get list of roles in SSAS database

查看:156
本文介绍了SSAS XMLA DISCOVER:如何获取 SSAS 数据库中的角色列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 XMLA 获取 SSAS 数据库中存在的角色列表.我只需要角色,不需要其他信息.

I am trying to get a list of roles existing in an SSAS DB using XMLA. I need only roles, not other information.

我知道有一个 DISCOVER_XML_METADATA:

I know there is a <RequestType>DISCOVER_XML_METADATA</RequestType>:

<Discover xmlns="urn:schemas-microsoft-com:xml-analysis">  
   <RequestType>DISCOVER_XML_METADATA</RequestType>  
   <Restrictions>
       <RestrictionList xmlns="urn:schemas-microsoft-com:xml-analysis">
           <DatabaseID>SSAS_DB_ID</DatabaseID>
       </RestrictionList>
   </Restrictions>  
   <Properties>  
      <PropertyList>
      </PropertyList>  
   </Properties>  
</Discover>

查询返回一个 ~9Mb XML,其中包含关于数据库的完整信息,包括我不需要的信息.

The query returns a ~9Mb XML containing complete information about the database, including the information that I do not need.

是的,它确实包含了角色:

Yes, it does contain the piece with the roles:

...
     <Roles>
        <Role>
          <Name>ROLE_NAME_AND_ID1</Name>
          <ID>ROLE_NAME_AND_ID1</ID>
          <CreatedTimestamp>2020-05-13T11:20:27.343333</CreatedTimestamp>
          <LastSchemaUpdate>2020-06-03T06:16:53.816667</LastSchemaUpdate>
          <Description />
          <Members>
            <Member>
              <Sid>SID1</Sid>
              <Name>DOMAIN\LOGIN1</Name>
            </Member>
            <Member>
              <Sid>SID2</Sid>
              <Name>DOMAIN\LOGIN2</Name>
            </Member>
          </Members>
        </Role>
      </Roles>
...

但我只想有角色列表,没有其他任何东西.

But I would like to have only the role list without anything else.

无法在网络或 MS 网站上找到明确的解释(那里的文档对我来说非常古怪),希望得到任何见解.

Could not find a clear explanation on the web or MS website (where the documentation is extremely quirky for me) and would appreciate any insights.

推荐答案

另一种选择是使用 DMV $SYSTEM.TMSCHEMA_ROLES &$SYSTEM.TMSCHEMA_ROLE_MEMBERSHIPS.您可以使用 Invoke-ASCmd

Another option is to use the DMVs $SYSTEM.TMSCHEMA_ROLES & $SYSTEM.TMSCHEMA_ROLE_MEMBERSHIPS. You can query using Invoke-ASCmd

例如

$serverUri="server.asazure.windows.net/model"

Invoke-ASCmd -Server $serverUri -Query "select * from `$SYSTEM.TMSCHEMA_ROLES"

这篇关于SSAS XMLA DISCOVER:如何获取 SSAS 数据库中的角色列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆