I have root site and it has many subsites. I have to get Site owners of each subsite using CMOS. I have writtern below code but its not giving owner's detials instead its giving all site group information.
var ctx = new SP.ClientContext("<subsite url>"); var web = ctx.get_web(); var groupCollection = web.get_siteGroups(); ctx.load(groupCollection, 'Include(Users,Title)');
Now, Once I get values in "groupCollection", I am looping into groups and then users. But I am getting all sharepoint group not specific to .
Please suggest where I am wrong.