I tried this code, but I get only the SharePoint Groups.
var groupCollection;
function getAllGroups() {
var ctx = new SP.ClientContext();
groupCollection = ctx.get_web().get_siteGroups();
ctx.load(groupCollection);
ctx.executeQueryAsync(Function.createDelegate(this, this.onSuccess), Function.createDelegate(this, this.onFailure));
}
function onSuccess() {
var grpColEnum = groupCollection.getEnumerator();
var ulcollection = document.getElementById('ulGroup');
while (grpColEnum.moveNext())
{
var currentGrp = grpColEnum.get_current();
ulcollection.innerHTML += '<li>' + currentGrp.get_id() + ':' + currentGrp.get_title() + '</li>';
}
}
function onFailure(sender, args) {
alert('Failed:' + args.get_message() + '\n' + args.get_stackTrace());
}
Please do needful to get "Active Directory" groups and group members.