Group lookup problem



I have an old script I use to verify what groups a user is in and then run
scripts based on thoughs groups. This script run perfectly fine on my current
domain/forest with all users.
However when I created a new domain/forest for a sub company that is braking
off from us the script no longer works.
The funny part is that for Domain admins it works fine but not for a regluar
user. I think it is some permission change in AD and would like to know what
I have to change to get this to work.

Here is the part of the script I use to vailadate groups:


' Check For Group Messages and Mappings

Set ADSysInfo = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://"; &ADSysInfo.UserName)
arrMemberOf = CurrentUser.MemberOf

For each Group in arrMemberOf
Group = Mid(Group,4)
intLeft = Instr(Group,",") - 1
Group = Left(Group, intLeft)
'WScript.Echo Group

' Check for a message for each Group

Messagepath = Scrpath & "\" & Group & ".txt"
'WScript.Echo Messagepath

If (fso.FileExists(Messagepath)) Then
Set f = fso.OpenTextFile(Messagepath, ForReading, True)
temp = WShShell.Popup(f.Readall,30,ExtremeM, 0 + 48)
End If

' Chech for a Script for each Group

Scriptpath = Scrpath & "\" & Group & ".VBS"
'WScript.Echo Scriptpath

If (fso.FileExists(Scriptpath)) Then
Temp = WshShell.Run(Scriptpath ,1 , True)
End If


Next



.



Relevant Pages

  • Re: Group lookup problem
    ... However when I created a new domain/forest for a sub company that is ... off from us the script no longer works. ... For each Group in arrMemberOf ... direct group memberships. ...
    (microsoft.public.scripting.vbscript)
  • Re: Group lookup problem
    ... ' Chech for a Script for each Group ... However when I created a new domain/forest for a sub company that is ... direct group memberships. ... The link has a fix, plus other ways to check for direct ...
    (microsoft.public.scripting.vbscript)
  • Re: Reporting on Group Members
    ... > I copied this script from the script vault and it works fine if the group ... > For Each strMember in arrMemberOf ... One possible problem is that the "member" attribute has less than 2 values. ...
    (microsoft.public.windows.server.scripting)
  • Re: DSGET/DSQUERY Question
    ... strGroupDN = objRecordSet.Fields.Value ... For Each strMember in arrMemberOf ... user display name so i can sort it in excel? ... thanks chong, the script works, but it pops up a new window for each ...
    (microsoft.public.windows.server.active_directory)
  • Re: List Group membership
    ... I am getting the below mentioned Error Message while executing your Script ... I use the following script which basically exports the member of a ... For Each strMember in arrMemberOf ...
    (microsoft.public.windows.server.scripting)