I want to add users in SSAS security using following XMLA script.
DECLARE @CreateUserInSsasXMLA VARCHAR(MAX) =
\'
If you install ASSP then you can run the following SQL query which calls an ASSP sproc to get the list of current members. Once this completes, you can append @oldMembers to your existing XMLA:
declare @members table (Sid varchar(1000), Name varchar(1000), Parent_RoleID varchar(1000), Parent_DatabaseID varchar(1000))
insert @members
EXECUTE('CALL ASSP.DiscoverXmlMetadata("\Database\Roles\Role\Members\Member")') at AdminCPM
declare @oldMembers varchar(max) = ''
select @oldMembers = @oldMembers + '<Member><Name>'+Name+'</Name></Member>
'
from @members