Re: help on EZScriptomatic mod
From: Don Wilwol (donwilwol_at_yahoo.com)
Date: 02/22/05
- Next message: Todd J Heron: "Re: Can't see SBS Server"
- Previous message: Doug Frisk: "Re: How to search in Active directory with no basedn"
- In reply to: Tadashi Inayama: "Re: help on EZScriptomatic mod"
- Next in thread: Al Mulnick: "Re: help on EZScriptomatic mod"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 21 Feb 2005 21:01:47 -0500
I didn't have time to really clean it up, but this should work.
'XXXXXXXXXXXXXXXXX Beginning of GetGroupMembers.vbs XXXXXXXXXXXXXXX
'**********************************
' Creates a list of users in the group specified
' Created by Don Wilwol 2/2005
' donwilwol@yahoo.com
'**********************************
'**********************************
'**********************************
Dim strOutput
Const ForAppending = 8
Set wFSO = CreateObject("Scripting.FileSystemObject")
Set wTS = wFSO.OpenTextFile("C:\ListGrp.txt", ForAppending, True)
'Puts it in C:\
'Replace with currect path
getGroupMembers("LDAP://CN=GroupName,OU=OUName,DC=DomainName,DC=com")
Sub getGroupMembers(strGroup)
'wscript.Echo "Parsing: " & strGroup
Set GroupObj = GetObject(strGroup)
For each UserObj in GroupObj.Members
if UserObj.Class = "user" then
'strOutput = strOutput & UserObj.AdsPath & SAMAccountNAME & vbCrLf
wscript.echo UserObj.name
wTS.writeline UserObj.cn
else
getGroupMembers(UserObj.AdsPath)
end if
Next
End Sub
'XXXXXXXXXXXXXXXXX End of GetGroupMembers.vbs XXXXXXXXXXXXXXX
-- Hope it helps........... dw Don Wilwol Blog - http://spaces.msn.com/members/wilwol/ Web - http://capital.net/~wilwol/dw.htm DonWilwol(REMOVE)@yahoo.com "Tadashi Inayama" <inayama@aerovironment.com> wrote in message news:u7bk$LHGFHA.2180@TK2MSFTNGP12.phx.gbl... > Thanks for the reply, > > I was referred to EZADScriptomatic on this forum earlier, you just > download off of microsoft website. > it's easy to use, but still needs some massaging when actually using it. > > This is the default script for reading objects/group > So the problem is with the Members Properties Page section > > what I wanted was to get a listing of the logon name but I'm not sure if I > can do that, so the display name from groups will do. > > Also since I'm vb illiterate is there a way to either print to a text file > or to append it to a text file in a single column? > > Thanks, > Tadashi > > strContainer = "" > strName = "EzAdGroup" > > On Error Resume Next > > '*********************************************** > '* Connect to an object * > '*********************************************** > Set objRootDSE = GetObject("LDAP://rootDSE") > If strContainer = "" Then > Set objItem = GetObject("LDAP://" & _ > objRootDSE.Get("defaultNamingContext")) > Else > Set objItem = GetObject("LDAP://cn=" & strName & "," & strContainer & "," > & _ > objRootDSE.Get("defaultNamingContext")) > End If > '*********************************************** > '* End connect to an object * > '*********************************************** > > WScript.Echo VbCrLf & "** General Properties Page**" > WScript.Echo "** (Single-Valued Attributes) **" > strname = objItem.Get("name") > WScript.Echo "name: " & strname > strsamAccountName = objItem.Get("samAccountName") > WScript.Echo "samAccountName: " & strsamAccountName > strdescription = objItem.Get("description") > WScript.Echo "description: " & strdescription > strmail = objItem.Get("mail") > WScript.Echo "mail: " & strmail > > WScript.Echo VbCrLf & "** General Properties Page**" > WScript.Echo "** (The groupType attribute) **" > Set objHash = CreateObject("Scripting.Dictionary") > objHash.Add "ADS_GROUP_TYPE_GLOBAL_GROUP", &h2 > objHash.Add "ADS_GROUP_TYPE_DOMAIN_LOCAL_GROUP", &h4 > objHash.Add "ADS_GROUP_TYPE_UNIVERSAL_GROUP", &h8 > objHash.Add "ADS_GROUP_TYPE_SECURITY_ENABLED", &h80000000 > intgroupType = objItem.Get("groupType") > For Each Key in objHash.Keys > If objHash(Key) And intgroupType Then > WScript.Echo Key & " is enabled." > Else > WScript.Echo Key & " is disabled." > End If > Next > If intgroupType AND objHash.Item("ADS_GROUP_TYPE_DOMAIN_LOCAL_GROUP") Then > WScript.Echo "Group Scope: Domain Local Group" > ElseIf intGroupType AND objHash.Item("ADS_GROUP_TYPE_GLOBAL_GROUP") Then > WScript.Echo "Group Scope: Global Group" > ElseIf intGroupType AND objHash.Item("ADS_GROUP_TYPE_UNIVERSAL_GROUP") > Then > WScript.Echo "Group Scope: Universal Group" > End If > If intgroupType AND objHash.Item("ADS_GROUP_TYPE_SECURITY_ENABLED") Then > WScript.Echo "Group Type: Security" > Else > WScript.Echo "Group Type: Distribution" > End If > WScript.Echo VbCrLf & "** Managed By Properties Page**" > WScript.Echo "** (Single-Valued Attributes) **" > strmanagedBy = objItem.Get("managedBy") > WScript.Echo "managedBy: " & strmanagedBy > > If strmanagedBy <> "" Then > Set objItem1 = GetObject("LDAP://" & strManagedBy) > WScript.Echo "physicalDeliveryOfficeName: " & _ > objItem1.physicalDeliveryOfficeName > WScript.Echo "streetAddress: " & _ > objItem1.streetAddress > WScript.Echo "l: " & _ > objItem1.l > WScript.Echo "c: " & _ > objItem1.c > WScript.Echo "telephoneNumber: " & _ > objItem1.telephoneNumber > WScript.Echo "facsimileTelephoneNumber: " & _ > objItem1.facsimileTelephoneNumber > End If > > WScript.Echo VbCrLf & "** Member Properties Page**" > WScript.Echo "** (MultiValued Attributes) **" > strmember = objItem.GetEx("member") > WScript.Echo "member:" > For Each Item in strmember > WScript.Echo vbTab & Item > Next > > WScript.Echo VbCrLf & "** Member Of Properties Page**" > WScript.Echo "** (MultiValued Attributes) **" > strmemberOf = objItem.GetEx("memberOf") > WScript.Echo "memberOf:" > For Each Item in strmemberOf > WScript.Echo vbTab & Item > Next > > WScript.Echo VbCrLf & "** Managed By Properties Page**" > WScript.Echo "** (Single-Valued Attributes) **" > strmanagedBy = objItem.Get("managedBy") > WScript.Echo "managedBy: " & strmanagedBy > > If strmanagedBy <> "" Then > Set objItem1 = GetObject("LDAP://" & strManagedBy) > WScript.Echo "physicalDeliveryOfficeName: " & _ > objItem1.physicalDeliveryOfficeName > WScript.Echo "streetAddress: " & _ > objItem1.streetAddress > WScript.Echo "l: " & _ > objItem1.l > WScript.Echo "c: " & _ > objItem1.c > WScript.Echo "telephoneNumber: " & _ > objItem1.telephoneNumber > WScript.Echo "facsimileTelephoneNumber: " & _ > objItem1.facsimileTelephoneNumber > End If > > > > > > > > > > > > > > "Al Mulnick" <amulnick_No_SPAM@ncDOTrr.com> wrote in message > news:Oody2pGGFHA.444@TK2MSFTNGP15.phx.gbl... >> I'm not familiar with EZADScriptomatic. Where'd that come from? >> How does your script differ from this one: >> http://www.houseofqueues.com//CodeSamples/FindMembers.html (this is >> mostly for one-off searches, but it pulls the group members and reports >> the member DN to the file.) >> >> If I understand your request, you want the user display name (or some >> other field?) vs. the DN. Is that correct? >> >> If so, can you post the code so we can see where to modify it? >> >> >> "Tadashi Inayama" <inayama@aerovironment.com> wrote in message >> news:esspwkGGFHA.428@TK2MSFTNGP15.phx.gbl... >>>I was trying to just get a list of users for some the groups, since there >>>are bunch of groups with hundreds of users I was using EZADScriptomatic >>>but for the members properties page it lists all of the info the member >>>users, I just wanted to get the name of the users and that's it. Is >>>there a mod I can use for EZADScript for "Read an Object" for "group" to >>>list only the name of member users? >>> >>> Thanks, >>> Tadashi >>> >> >> > >
- Next message: Todd J Heron: "Re: Can't see SBS Server"
- Previous message: Doug Frisk: "Re: How to search in Active directory with no basedn"
- In reply to: Tadashi Inayama: "Re: help on EZScriptomatic mod"
- Next in thread: Al Mulnick: "Re: help on EZScriptomatic mod"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|