Re: Logon script: Group membership not recognized?



whoami.exe (A resource kit utility) has an option for showing all groups you're a member of.
http://www.microsoft.com/downloads/details.aspx?amp%3bdisplaylang=en&familyid=49ae8576-9bb9-4126-9761-ba8011fabf38&displaylang=en

--
Kind regards,

Erik Cheizoo
eXcellence & Difference - we keep your business running
============================================
Always test in a non-production environment before implementing
Guidelines for posting: http://support.microsoft.com/?id=555375
============================================


"Mike" <Mike@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:750CE00D-C0A6-4FD4-B1E2-A85C8FC79F19@xxxxxxxxxxxxxxxx
The logon script below disconnects a couple drive letters and then maps them
to the appropriate share based on group membership. The script works just
fine, but it doesn't run properly for a few people.

For the people it doesn't run properly for, the script disconnects the S and
P drives like it should. However, the section where it maps the S and P
drives for users in the DEPT Employees group does not run for these few
users. These users are members of that group.

Any ideas? The script is solid, so the problem must be with the user
accounts. The script is pasted below just so you can see it.

On Error Resume Next

Set objSysInfo = CreateObject("ADSystemInfo")
Set objNetwork = CreateObject("Wscript.Network")

'These 2 lines force the drives to be disconnected
'The first TRUE unmaps the drive even if in use
'The second TRUE removes the mapping from the user profile

objNetwork.RemoveNetworkDrive "S:", True, True
objNetwork.RemoveNetworkDrive "P:", True, True

strUserPath = "LDAP://"; & objSysInfo.UserName
Set objUser = GetObject(strUserPath)

For Each strGroup in objUser.MemberOf
strGroupPath = "LDAP://"; & strGroup
Set objGroup = GetObject(strGroupPath)
strGroupName = objGroup.CN

'TRUE in the statements below stores the drive mapping in the user profile
'making the mapping persist and available when disconnected from the network

Select Case strGroupName
Case "DEPT Employees"
objNetwork.MapNetworkDrive "S:", "\\server1\shared", True
objNetwork.MapNetworkDrive "P:",
"\\server2\fsTaskMan\Report\OutputFiles", True
End Select
Next

.



Relevant Pages

  • Re: Logon script: Group membership not recognized?
    ... When you run GPResults against these users, does it show them as being a member of this group? ... Speed Group Policy Troubleshooting with the NEW GPHealth Reporter tool at http://www.sdmsoftware.com/products.php ... The script works just ... P drives like it should. ...
    (microsoft.public.windows.server.active_directory)
  • Re: Standardize drive assignments
    ... script like I've said with this conditional "question" about which drive G: ... >> G drive) and the same 3 common drives. ... > team1 - contains all permanent members of team number one. ... > So, if a user is a direct member of team1, but only indirect in team2 ...
    (microsoft.public.windows.server.scripting)
  • Re: Standardize drive assignments
    ... > Because, at that time, I had a Windows 4.0 environment, and this script ... >>> G drive) and the same 3 common drives. ... >> team1 - contains all permanent members of team number one. ... >> So, if a user is a direct member of team1, but only indirect in team2 ...
    (microsoft.public.windows.server.scripting)
  • Re: Logon Script
    ... gets deleted and the script goes to the next line. ... pause ---this will let you see what drives are mapped to where and the ... echo "there is a problem. ... if a user is a member of both groups I ...
    (microsoft.public.win2000.active_directory)
  • RE: Login Script Permisions
    ... Script is running as my default shares are mapped. ... Select Case strGroupName ... But when i login as a normal user e.g. Nick as a member of the accounts ... An array is a data structure containing one or more values, ...
    (microsoft.public.scripting.vbscript)

Loading