Missing Users in "Group Listing"...

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi there

I have a very simple script which accepts the name of a User Group, and then
lists the names of all users who are a member thereof... An excerpt of this
script is listed below...
'******************************************************
ADGroup="CN=DialupUsers, OU=Servers"
ADDomain="DC=domainname,DC=com"

Set objGroup = GetObject ("LDAP://"&ADGroup&","&ADDomain)
For each objMember in objGroup.Members
WScript.Echo objMember.sAMAccountName & "," & objMember.sAMAccountName &
"," & objMember.Name
Next
'******************************************************

The problem that I have is that any User Account that has the ADGroup in
question as it's Primary Group, does not get included in my report. Case in
point:
I have a few "contractor" logons of people who dialup into our organisation
for support purposes. These user accounts typically are not members of any
Active Directory groups, apart from my "DialupUsers" group which is used to
authorise these support users on my IAS server. These user accounts are only
a member of 1 group, thus the "DialupUsers" group is set as the "Primary
Group" for these users.
I have managed to duplicate this as follows:
- Set the Primary Group of a user account to "Group1"
- Run the above script, and the user account in question will not be
reported in the results
- Take the same user account above, add them to another group, set the
Primary group to this "Group2", and run the above script again.
- The user i question will now be returned...

Anyone perhaps got an idea on how to get past this??

Thanks
William R.


.



Relevant Pages

  • Re: Runtime permissions?
    ... The same script does NOT work on a computer which is member of our ... I have a script that runs OK in our Domain with one user account but not ... The target machine account, against which I tested is trusted for ...
    (microsoft.public.scripting.vbscript)
  • Re: Im new to scripting a I working on a project that I need some help with.
    ... After that the script ... >> that the user account is not valid. ... > it to the Administrators group: ... If the user does not have it, maybe a RunAs solution ...
    (microsoft.public.scripting.vbscript)
  • Re: Memory consumption PowerShell
    ... The mechanism of the Identity Management system (it is Novell Identity ... And we could initiate to run a script oout side the IDN 3.0. ... is the case we want to do, if a new user account was created. ... memory. ...
    (microsoft.public.windows.server.scripting)
  • Re: simple Q for advanced: how to find out what rundll32.exe is executing?
    ... You may use the following script. ... Lists all the processes running in the ... currently logged on user account. ... Dim strUserName ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Local account creation
    ... What I want to do is to use the script in a startup GPO so that there a generic local admin account on all computers for the helpdesk staff to logon to and perform troubleshooting/etc. ... Dim objNetwork, strComputer, strUser ... ' Specify name of local user account to be created. ...
    (microsoft.public.windows.server.scripting)