MCC account

Get information for all Search Ads accounts under the MCC

function getAllMccAccounts(){
  const managerAccountId = AdsUtilities.getCurrentAccountId();
  const accountLinks = Search.AccountLinkService.get({
    mccAccountId: managerAccountId,
  }).rval;
  for (let i = 0; i < accountLinks.values.length; i++){
    let accountLink = accountLinks.values[i].accountLink;
    Logger.log('accountId-> ' + accountLink.accountId 
      + ', ownerShipType-> ' + accountLink.ownerShipType);
  }
}