title: Same script giving different results for Google Apps account domainUser
body: <p>I am a super administrator for two Google Apps for Education Accounts and I'm getting different results for the same script in both domains.  Here is the script :</p>
  
  <pre><code>function listUsers(s) {     
    var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet()
    sheet.getDataRange().clear()
    var users = UserManager.getAllUsers();
    var r = new Array();
    var f = new Array();
    var Uconnect = '';
  
    for( var i = 0 ; i &lt; users.length ; i++ ){
      var Umail = users[i].getEmail(); 
      var UnomF = users[i].getFamilyName()
      var UnomP = users[i].getGivenName()
  
      if(users[i].getAgreedToTerms()){Uconnect = 'yes'}else{Uconnect = 'never'}
  
      r.push([UnomF,UnomP,Umail,Uconnect]);
      if(i%2==0){
        f.push(['#eeeeff','#eeeeff','#eeeeff','#eeeeff']);
      }else{
        f.push(['#ffffff','#ffffff','#ffffff','#ffffff']);
      }
    }   
    r.sort(function(x,y){
      var xp = x[0].toLowerCase();
      var yp = y[0].toLowerCase();
      Logger.log(xp+'   '+yp)
      return xp == yp ? 0 : xp &lt; yp ? -1 : 1;//  sort on name ascending
    }
          )
    var header = ['Nom de famille','Prénom','Email','Déjà Connecté?']
    sheet.getRange(1,1,1,r[0].length).setValues([header]).setFontWeight('bold')
    .setBackground('silver').setBorder(true,true,true,true,true,true);
    sheet.getRange(2,1,r.length,r[0].length).setValues(r);
    sheet.getRange(2,1,f.length,f[0].length).setBackgroundColors(f);
    sheet.getDataRange().setVerticalAlignment('middle').setFontSize(11);
  }
  </code></pre>
  
  <p>The script is very simple : it gets all the domain users and shows a list in a spreadsheet with some formatting. It is also supposed to show wether users have initialize their accounts using the <a href="https://developers.google.com/apps-script/reference/domain/domain-user#getAgreedToTerms%28%29" rel="nofollow">getAgreedToTerms()</a> method from the domainUser class.</p>
  
  <p>On one of the domains I get real results (identical to what I can see in the Google Apps admin control panel) but in the second one <code>getAgreedToTerms()</code> returns always <code>true</code>, even for newly created users.(From what I can see the domain settings are the same.)</p>
  
  <p>Is there something I am missing somewhere ? Is there another way to check wether a user has connected himself with his account ? </p>
  
  <p>I know this is not really a programming question but I also know that many of us have Google Apps accounts and users to administrate :-) so I decided it's worth trying.</p>