title: List users from specific groups
body: <p>Good morning all,</p>
  
  <p>I am currentlycovering my line manager. And I need to modify an existing to VBScript, to pull users from specific groups in AD (Commercial, Finance, HR, IT, Marketing, Operations, and Property):</p>
  
  <pre><code>Const ForReading = 1,ForWriting = 2,ForAppending = 8
  StartFilename = "AD groups.txt"
  
  Set objFSO = CreateObject("Scripting.FileSystemObject")
  Set objTextFile = objFSO.OpenTextFile(StartFilename,ForAppending, True)
  
  strDomainName = inputbox("Enter Domain Name","AD Billing","") 
  
  Set objDomain = GetObject("WinNT://" &amp; strDomainName)
  
  For each objDomainObject in objDomain
  If objDomainObject.class = "Group" Then
  Set objGroup = GetObject("WinNT://"&amp; strDomainName &amp; "/" &amp; objDomainObject.Name)
  objTextFile.writeline("")
  objTextFile.writeline("Domain: " &amp; strDomainName &amp; "   Group: " &amp; objDomainObject.Name)
  objTextFile.writeline("")
  Set objMemberList = objGroup.Members
  For Each objGroupMember In objMemberList
  Set objMember = objGroupMember
  objTextFile.writeline ("Group member: " &amp; objMember.Name)
  Next
  End If
  Next
  objTextFile.close
  </code></pre>
  
  <p>Any help is greatly appriciated
  Kind regards</p>
  
  <p>Justin </p>