0

I've been trying to check the access of a user on a SQL Server Analysis Services (SSAS) server using impersonation.

AdomdConnection class has following instance method to accomplish the same:

public void ChangeEffectiveUser(string effectiveUserName)

Here is the MSDN documentation for the same.

I followed the NuGet package instructions here to add ADOMD.Net in my C# project but when I try to use the API then I don't see the API in intellisense at all.

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");
}

It is giving compilation failure:

Error CS1061 'AdomdConnection' does not contain a definition for 'ChangeEffectiveUser' and no extension method 'ChangeEffectiveUser' accepting a first argument of type 'AdomdConnection' could be found (are you missing a using directive or an assembly reference?)

Am I missing something?

RBT
  • 24,161
  • 21
  • 159
  • 240
  • It is possibly added in the 'newer' versions of Adomd. Are you able to check with the latest version ? You would have noticed that this component is part of SQL Server. – Subbu Jul 07 '17 at 06:39
  • I installed the latest version from NuGet server. Its latest stable version in NuGet is 12.0.2000.8 – RBT Jul 07 '17 at 06:47

1 Answers1

1

I was able to figure out that MS has changed the NuGet package for the latest ADOMD.Net release which came as part of SQL Server 2016. It is available on NuGet package here in the name of Unofficial.Microsoft.AnalysisServices.AdomdClient. Not sure why MS has taken this strategy to introduce a new package instead when they should have simply added a new version in the already existing NuGet package here in the name of Microsoft.AnalysisServices.AdomdClient.

The moment I took reference of v13.x of Microsoft.AnalysisServices.AdomdClient.dll present in Unofficial.Microsoft.AnalysisServices.AdomdClient NuGet package my compilation error went away and I could see the API.

RBT
  • 24,161
  • 21
  • 159
  • 240