title: Lists in VBScript
body: <p>I'm trying to create a simple list in a VBscript, but I'm unable to find something similar.</p>
  
  <p>Basically, I'm working on Active directory, and I need to get all the groups a user is a member of for all the users within a domain. Now, every user might be a member of a different number of groups, so I plan to use a dictionary, with the key being the SAMID for the user, and the value being a list of all the groups he/she is a member of.</p>
  
  <p>I can do this with a static array, but then I have to declare a random large size for the array which is not nice. What I would ideally like to do is have a python-like list, where I can simple do something like myList.Add  and don't have to worry about sizing.</p>
  
  <p>I tried using System.Collection.ArrayList, but I get an error when I run it:</p>
  
  <pre><code>PS C:\tmp&gt; cscript.exe .\foo.vbs
  Microsoft (R) Windows Script Host Version 5.8
  Copyright (C) Microsoft Corporation. All rights reserved.
  
  C:\tmp\foo.vbs(1, 1) (null): 0x80131700
  </code></pre>
  
  <p>how can I accomplish this?</p>