Page 1 of 1 1
Topic Options
#185710 - 2008-02-26 03:07 PM Group Type
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
I apoligize that I am unable to determine this on my own, but I am not in a location with an AD to test it.

Question is when using the UDF ListNestedGroups(), will it read the group type "Distribution Group"?
_________________________
Today is the tomorrow you worried about yesterday.

Top
#185714 - 2008-02-26 03:25 PM Re: Group Type [Re: Gargoyle]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Yes.

 Code:
Break on

$oDomain = GetObject("WinNT://@LDomain")
$oDomain.filter = "User",""
For Each $oUser in $oDomain
	;Get the DN name from AD for the specific user.
	$dn = TranslateName (3, "", 3, @LDomain + "\" + $oUser.Name, 1)
	;Get all groups and add <nested> to nested groups (see options).
	$groups = ListNestedGroups("LDAP://" + $dn[0],1)
	For Each $group in $groups
		?$group
	Next
Next


Edited by Mart (2008-02-26 03:25 PM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#185715 - 2008-02-26 03:47 PM Re: Group Type [Re: Mart]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
Thanks Mart.
_________________________
Today is the tomorrow you worried about yesterday.

Top
#185719 - 2008-02-26 04:14 PM Re: Group Type [Re: Gargoyle]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
To think that Mart stayed away from COM not too long ago ;\)
Nice one Mart \:\)

Top
#185720 - 2008-02-26 04:16 PM Re: Group Type [Re: Arend_]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
Actually though, that filter doesn't really work.
The filter requires an array
 Code:
Dim $filter[0]
$filter[0] = "user"
$oDomain.filter = $filter

learned that the hard way... it isn't really documented

from VBS, "User","" is regarded as array in WSH. Not in kix \:\)

Top
#185723 - 2008-02-26 04:41 PM Re: Group Type [Re: Arend_]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
 Originally Posted By: apronk
To think that Mart stayed away from COM not too long ago ;\)
Nice one Mart \:\)


Eventually the dark side got a hold of me.
No man just kidding. Looked at it several times and abandoned it quickly each time. I just couldn’t see the forest because of all the d#mn trees.
I started when we implemented a new logon script that creates and sets outlook sigs. It uses Word COM. Amazingly enough I started to like it.
In other words: COM is cool
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#185724 - 2008-02-26 04:42 PM Re: Group Type [Re: Arend_]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
 Originally Posted By: apronk
Actually though, that filter doesn't really work.
The filter requires an array
 Code:
Dim $filter[0]
$filter[0] = "user"
$oDomain.filter = $filter

learned that the hard way... it isn't really documented

from VBS, "User","" is regarded as array in WSH. Not in kix \:\)


It works fine when I run it. Maybe that's because of my lack of VB knowledge or COM experience.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#185741 - 2008-02-26 09:11 PM Re: Group Type [Re: Mart]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
I am actually using the ListNestedGroups() UDF in my script, just needed to confirm if all types of groups were returned.

Of course it has a COM component in it, but I don't know if that counts as "me" using COM \:D
_________________________
Today is the tomorrow you worried about yesterday.

Top
#185753 - 2008-02-27 08:23 AM Re: Group Type [Re: Mart]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
 Originally Posted By: Mart

It works fine when I run it. Maybe that's because of my lack of VB knowledge or COM experience.


It works, but the filter isn't applied \:\)
So it returns everything matching your criteria.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 781 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.055 seconds in which 0.011 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org