Good day Maheen,
Would you kindly follow these community posts they might be of relevance to your question especially trhe comment made be "Jean".
https://community.k2.com/t5/K2-Blackpearl-Forum-Posts/Get-list-of-all-members-in-an-AD-Group/m-p/90735?collapse_discussion=true&page=2&q=get%20AAD%20group%20list&search_type=thread
Also, there was a second post that was similar to that but the user was asking for groups within groups smart object, I believe the comments in this post as well might be insightful and have information that could be of assistance.
https://community.k2.com/t5/General/Is-there-a-smartobject-with-a-get-groups-within-groups-method/m-p/109844#M4875
Kindly feel free to mark as “Accepted solution, kudo and/me too”
If you find this information answered your question or leads to your answer.
Thank you and kind regards,
Dumisani
K2 will not accept any liability for any issues arising from actions taken in respect of the information provided by any forum member.