Thanks everyone for your responses.
@Avinash : I am trying to get this macro for users who are not familar with SQL queries. So hence I went for OTA API.
right now I am able to get the list of inactive users in a project by using @Srihari_Amgen method of using usr.Ingroup("Inactive").
Is there a way to create a list of active users in the project too using ingroup method ?