Hi folks I have the following code which I am using to print to screen the groups of which the current logged in user is part of :
On Error Resume Next
Set objADSysInfo = CreateObject("ADSystemInfo")
strUser = objADSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUser)
For Each strGroup in objUser.memberOf
Set objGroup = GetObject("LDAP://" & strGroup)
When a user is part of 3 or more groups the script works perfectly. However I have one user which is part of the domain users group and a test group. When you run the script on this user it does not return any groups until you add a third group which can be anything.
I was just wondering if anyone knew why this was the case ? It is not a permissions based thing as I have tried giving the user administrative privilages.