#130315 - 2004-11-29 08:01 PM
ENUMGROUP don't display all group-memberships
|
Anonymous
Anonymous
Unregistered
|
I'm making a script, using ENUMGROUP.
Is it correct, that this command won't return all groupmemberships?
I don't get any groups outside the OU of the user, even though the user is member of these groups.
|
Top
|
|
|
|
#130316 - 2004-11-29 08:18 PM
Re: ENUMGROUP don't display all group-memberships
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
This function should return the groups that the user executing this code is a member of at the time of the last logon.
Could you post your properly formatted code so we could possibly test and comment?
What groups do not show up that you would expect to see?
Edited by Howard Bullock (2004-11-29 08:19 PM)
|
Top
|
|
|
|
#130317 - 2004-11-29 08:23 PM
Re: ENUMGROUP don't display all group-memberships
|
Anonymous
Anonymous
Unregistered
|
IF InGroup ("PRN_PSERV_EKSP") ? "Your in the group PRN_PSERV_EKSP" ENDIF
The above code, dosn't return anything.
I can see in my usermanager, that i am a member of this group but it's not returned with ENUMGROUP.
I have a bunch of local groups returned, but only global groups placed in the OU: USERS.
Other groups outside this OU, that i am member of, is not displayed.
|
Top
|
|
|
|
#130318 - 2004-11-29 08:24 PM
Re: ENUMGROUP don't display all group-memberships
|
Anonymous
Anonymous
Unregistered
|
I have tried to restart my computer and using the /F parameter. Nothing happens.
|
Top
|
|
|
|
#130320 - 2004-11-29 08:44 PM
Re: ENUMGROUP don't display all group-memberships
|
Anonymous
Anonymous
Unregistered
|
There isn't any policies set on the useraccount i'm testing with, nor the computer.
The user is member of the Domain admin group.
|
Top
|
|
|
|
#130321 - 2004-11-29 09:00 PM
Re: ENUMGROUP don't display all group-memberships
|
Anonymous
Anonymous
Unregistered
|
If i use this code, i get a list of all groups in the domain, including the one i can't get with ENUMGROUP:
$Computer = GetObject("WinNT://tredom.local") dim $filter[0] $filter[0]="Group" $Computer.filter = $filter
For Each $Group in $Computer ? $Group.Name Next
|
Top
|
|
|
|
#130322 - 2004-11-29 09:39 PM
Re: ENUMGROUP don't display all group-memberships
|
Anonymous
Anonymous
Unregistered
|
I am using some adsi on advice on another Forum.
Question closed.
|
Top
|
|
|
|
#130323 - 2004-11-29 10:38 PM
Re: ENUMGROUP don't display all group-memberships
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Depending on what exactly you were trying to accomplish, you may have gotten the same advice here. We have plenty of KiX ADSI COM code on this board.
Incidentally, the test code you show above using the WinNT:// provider is not user based. The function ENUMGROUPS only enumerates groups that have been attached to your security token at logon. This work is none by your Global Catalog server.
If you want the groups that your account is a member of, then I would suggest using reviewing some other threads such as: http://www.kixtart.org/ubbthreads/showthreaded.php?Cat=&Number=70104
where GetGroups code is posted.
|
Top
|
|
|
|
#130324 - 2004-11-30 09:55 AM
Re: ENUMGROUP don't display all group-memberships
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11623
Loc: CA
|
Did you try using this code example from the manual?
Code:
$Index = 0 DO $Group = ENUMGROUP($Index) $Index = $Index + 1 ? $Group UNTIL Len($Group) = 0
Or if you know the LDAP path you could do something similar to this:
Code:
Break On Dim $SO $SO=SetOption('Explicit','On') $SO=SetOption('NoVarsInStrings','On') Dim $User,$Group $User = GetObject('LDAP://CN=John\, Doe G.,OU=Users,OU=Finance,OU=WEST,DC=MyCompany,DC=com') ? 'Getting object err was: ' + @ERROR + ' ' + @SERROR For Each $Group in $User.groups ; ? Join(Split($Group.name,"CN="),"") ; ? $Group.SamAccountName ; ? $Group.name ? $Group.adspath Next
As Howard mentioned you need to add some error codes if you have problems returning the expected data so that you can determine why.
|
Top
|
|
|
|
#130327 - 2006-03-23 08:53 AM
Re: ENUMGROUP don't display all group-memberships
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11623
Loc: CA
|
Quote:
When I get time I'll try to investigate what is up with the ADSI code and why it does not return all the same Network groups
Well I finally got a little time
I have some code that will now enumerate all the groups including the nested groups. I'm still working on a parameter for the UDF but hope to post the UDF sometime tomorrow.
The code currently works but want to allow another option for showing or not showing the nested groups, and or flagging the nested ones.
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 262 anonymous users online.
|
|
|