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?