I want to provide admin access rights to an account on SQL Server Analysis Services (SSAS) server through code (C# or SQL script). This is how we do it through SQL Server Management Studio (SSMS).
I want to achieve the same through SQL query or may be C# code if it is possible. I searched a lot but I'm not getting anything very relevant.
I've one administrator user which already has the access on the SSAS server. So, I can fire any SQL or MDX query on the SSAS server which results in adding other user as administrator on the SSAS server.
For initial pointers, if I want to achieve the same in SQL Server instance then it is all about firing a few system-defined stored procedures like sp_addrolemember
to grant access to any SQL Server database as detailed here. I'm trying to achieve something similar if at all it is possible through code for an SSAS server.