【问题标题】:ChangeEffectiveUser API (for user impersonation in SSAS) missing from AdomdConnection Class in ADOMD.NetADOMD.Net 中的 AdomdConnection 类中缺少 ChangeEffectiveUser API(用于 SSAS 中的用户模拟)
【发布时间】:2017-12-11 07:56:53
【问题描述】:

我一直在尝试使用模拟检查用户在 SQL Server Analysis Services (SSAS) 服务器上的访问权限。

AdomdConnection 类有以下实例方法来完成同样的事情:

public void ChangeEffectiveUser(string effectiveUserName)

Here 是相同的 MSDN 文档。

我按照 NuGet 包说明 here 在我的 C# 项目中添加 ADOMD.Net,但是当我尝试使用 API 时,我根本看不到智能感知中的 API。

try
{
    Console.WriteLine("Going to open ADOMD connection.");
    myconnect.Open();
    //below line doesn't compile
    myconnect.ChangeEffectiveUser(@"mydomainname\otherUserIamTryingToImpersonate");
    adomdCommand.ExecuteNonQuery();
    Console.WriteLine("Query executed successfully");
    Console.ReadLine();
}
catch (Exception ex)
{

    MessageBox.Show("error in connection");
}

编译失败:

错误 CS1061 'AdomdConnection' 不包含对 'ChangeEffectiveUser' 并且没有扩展方法 'ChangeEffectiveUser' 可以找到接受“AdomdConnection”类型的第一个参数 (您是否缺少 using 指令或程序集引用?)

我错过了什么吗?

【问题讨论】:

  • 它可能被添加到“较新”版本的 Adomd 中。您可以检查最新版本吗?你会注意到这个组件是 SQL Server 的一部分。
  • 我从 NuGet 服务器安装了最新版本。它在 NuGet 中的最新稳定版本是 12.0.2000.8

标签: c# sql-server ssas impersonation adomd.net


【解决方案1】:

我发现 MS 已将 NuGet 包更改为最新的 ADOMD.Net 版本,该版本是 SQL Server 2016 的一部分。它在 NuGet 包here 上以Unofficial.Microsoft.AnalysisServices.AdomdClient 的名义提供。不知道为什么 MS 采取这种策略来引入一个新包,而不是他们应该只是在现有的 NuGet 包here 中以Microsoft.AnalysisServices.AdomdClient 的名义添加一个新版本。

当我引用 Microsoft.AnalysisServices.AdomdClient.dll 的 v13.x 时出现在 Unofficial.Microsoft.AnalysisServices.AdomdClient NuGet 包中,我的编译错误消失了,我可以看到 API。

【讨论】:

    猜你喜欢
    • 2014-05-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-21
    • 1970-01-01
    • 2013-02-18
    相关资源
    最近更新 更多