Can anyone help me with vbscripts in detail?

September 18, 2010 at 05:40:06
Specs: Windows XP
I barely know anything about vbs but have been thrown into the pool to get some tasks.

I need to know how to list out the membership of groups within an OU. Not by user which is memberof, but groups.

See More: Can anyone help me with vbscripts in detail?

Report •

September 18, 2010 at 06:37:19
Possibly; most VBScript questions end up being dependent on me helping. In this (generic) case, Google's a good source as any.

Report •

September 18, 2010 at 07:36:54
Thank you. I have my vbscript for dummies, and some other literature, plus samples of other scripts. But it seems listing out a group membership in Active Directory (and printing it to a file) needs variables, an array and I am lost.

I understand declaring, (DIM) I have the code to bind to AD, and of course my domain name, the name of the group, and the associated OU's. And yes, the normal wscript statements

I have VBScript editor, but it is not always helpful.

I can get as far as (and this is not the right syntax, just an example - ("LDAP cn= (groupname goes here) (instead of OU), and the OU structure.

I get hung up on whether to use user or group strings, since I want to list the users of a group.

I have searched the Web, the old scripting guy (which is now PowerShell) and the UK site which is very good, but not good enough from someone trying to self learn with very little time at work. And all the samples are different.
I understand Do Until, and Loop, but not the command strings for the task of listing a group, or the variables that seem to be need to to get through a group membership.
I need to list out (to a spreadsheet) a group called BI.CNGS.Prod.Analysis
the path in Active Directory is: ou=groups,ou=Cngs,ou=apps,dc=fabricom (my domain here) etc. (plus a couple of more groups in that CNGS OU )

Thank you

Report •

September 18, 2010 at 07:49:17
Set out = CreateObject("Scripting.FileSystemObject").OpenTextFile("out.csv", 8, True)
Set objGroup = GetObject("LDAP://CN=BI.CNGS.Prod.Analysis,ou=groups,ou=Cngs,ou=apps,dc=fabricom")

For Each strUser in objGroup.Member
  out.WriteLine strUser

Report •

Related Solutions

Ask Question