SharePoint 2013 get Group Owner Login Name and set Group Owner via JavaScript <p>I'm try to first find out an owner of a Group in SharePoint 2013, and then I would like to try and set the owner of a Group using JavaScript, I am will to try either JSOM, or REST API. (if I understand how that, JSOM vs. REST works)</p> <p>I have tried with JSOM:</p> <pre><code>function getGroupOwner (desiredGroupName) { var clientContext = new SP.ClientContext.get_current(); var web = clientContext.get_web(); var groups = web.get_groups(); var group = groups.getByName(desiredGroupName); var groupOwner = group.get_owner(); clientContext.load(web); clientContext.executeQueryAsync( function() { console.log('Success'); var ownerLoginName = groupOwner.get_loginName(); console.log('ownerLoginName: ' + ownerLoginName); }, function (sender, args) { console.log('Error: ' + args.get_message()); } } </code></pre> <p>I at least get a "Success", but it then gives me an error of:</p> <p>The property or field 'LoginName' has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested.</p> <p>Once I solve this, I was going to move onto the set_owner() function.</p> <p>Any advice on this would be appreciated.</p>