Thanks Ken Would you by chance have an example of the function and subroutine. I have been having problems with those.
Thanks ----- Original Message ---- From: Ken Schaefer <[EMAIL PROTECTED]> To: NT System Admin Issues <[email protected]> Sent: Sunday, February 10, 2008 6:01:14 PM Subject: RE: Script to list users <!-- _filtered {font-family:"Cambria Math";panose-1:2 4 5 3 5 4 6 3 2 4;} _filtered {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;} _filtered {font-family:Tahoma;panose-1:2 11 6 4 3 5 4 4 2 4;} _filtered {font-family:Consolas;panose-1:2 11 6 9 2 2 4 3 2 4;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0cm;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman", "serif";} a:link, span.MsoHyperlink {color:blue;text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {color:purple;text-decoration:underline;} p {margin-right:0cm;margin-left:0cm;font-size:12.0pt;font-family:"Times New Roman", "serif";} pre {margin:0cm;margin-bottom:.0001pt;font-size:10.0pt;font-family:"Courier New";} span.HTMLPreformattedChar {font-family:Consolas;} span.EmailStyle20 {font-family:"Calibri", "sans-serif";color:#1F497D;} .MsoChpDefault {font-size:10.0pt;} _filtered {margin:72.0pt 72.0pt 72.0pt 72.0pt;} div.Section1 {} --> You don’t ask for much do you :-) If you are using LDAP you can check the .class property of your AD object (objUser.Class). If it’s of type “group” then don’t add it to the list of enumerated users. If it’s of type “group” then you want to pass it back into your enumeration function/subroutine (you’ll need to put this into a routine of some kind so that you can make your code handle recursion). The only thing to be aware of is the possibility of infinite nesting – if you have a group that’s a member of another group, which in turn is a member of the first group, then you’ll get OOM (or stack overflow) errors from your script. Cheers Ken From: mck1012 [mailto:[EMAIL PROTECTED] Sent: Monday, 11 February 2008 5:21 AM To: NT System Admin Issues Subject: Script to list users I need a script to list users of a group and all nested groups with in that group. Here is what I have so far. I set the File System Object I set the WshShell Set ObjGroup to get object from the ldap search For each objuser in objgroup.members wscript.echo "SamID:" & objUser.Samaccountname This will list all users and groups in the group specified in the LDAP search. All i want to list is users of that groups and users of any nested group. Thanks M C K ____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping ~ Upgrade to Next Generation Antispam/Antivirus with Ninja! ~ ~ <http://www.sunbelt-software.com/SunbeltMessagingNinja.cfm> ~
