With help of AMO (Application Management Objects) was able to find a solution to clear members of a particular role in a cube with c# code. 
Simple code i used was :

```
Role role = new Role();
role = db.Roles.FindByName("roleName1");
role.Members.Clear();
role.Update()

```

Now i seem to have a situation. I do not know before hand the roleName parameter that i pass in "FindByName" function..
I do not know RoleName before.
Any kind of idea so as to how to get role names for a cube?