[gptalk] Re: Vbs logon script for mapped drives - one group having problems

  • From: "Jeremy Saunders" <Jeremy.Saunders@xxxxxxxxxxxxxx>
  • To: <gptalk@xxxxxxxxxxxxx>
  • Date: Sat, 15 Nov 2008 11:10:05 +1100

This optional component controls whether the new mapped network drive
should be stored in the user's profile. It's a Boolean argument that
takes either true or false.  The default is false, so the only time you
need to enter a value is if you positively want the user to receive this
drive every time they logon, in which case you set it to true.

 

If comparing it to the "NET USE" command line, it's the same concept as
the /PERSISTENT:{YES | NO}

 

Cheers,

Jeremy.

 

From: gptalk-bounce@xxxxxxxxxxxxx [mailto:gptalk-bounce@xxxxxxxxxxxxx]
On Behalf Of Booker.Washington@xxxxxxxxxxxxxx
Sent: Saturday, November 15, 2008 7:40 AM
To: gptalk@xxxxxxxxxxxxx
Subject: [gptalk] Re: Vbs logon script for mapped drives - one group
having problems

 

David, what function does the , False perform in this snippet of your
code

 

Booker T. Washington III

Systems Support Specialist

 

From: gptalk-bounce@xxxxxxxxxxxxx [mailto:gptalk-bounce@xxxxxxxxxxxxx]
On Behalf Of David Palombi
Sent: Thursday, November 06, 2008 4:18 PM
To: gptalk@xxxxxxxxxxxxx
Subject: [gptalk] Re: Vbs logon script for mapped drives - one group
having problems

 

This is what we have for our login script.  This is just a snippet of
the code.

 

If (IsMember(objUser, "PERFORMANCE") = True) Then
 objNetwork.MapNetworkDrive "v:", "\\bluewater\performance$
<file:///\\bluewater\performance$> ", False
End If

 

David Palombi

        ----- Original Message ----- 

        From: Booker.Washington@xxxxxxxxxxxxxx 

        To: gptalk@xxxxxxxxxxxxx 

        Sent: Thursday, November 06, 2008 4:07 PM

        Subject: [gptalk] Vbs logon script for mapped drives - one group
having problems

         

        I have the following vbs script below.  The script maps drives
based on the users group membership

         

        For some members of the group MGT Undergraduate Office, they
report that "sometimes" when they login the drive will not map, but if
they restart, then the drive shows.  Obviously, that is not ideal, so I
am trying to figure out where to start troubleshooting to see why this
is occurring.

         

        So far in my testing, I have not heard complaints from the one
other group that is a part of my test roll out of this logon script

         

        On Error Resume Next

         

        Set objSysInfo = CreateObject("ADSystemInfo")

        Set objNetwork = CreateObject("Wscript.Network")

         

        strUserPath = "LDAP://" & objSysInfo.UserName

        Set objUser = GetObject(strUserPath)

         

        'Removes curent mappings

        objNetwork.RemoveNetworkDrive "L:", True, True

        objNetwork.RemoveNetworkDrive "J:", True, True

        objNetwork.RemoveNetworkDrive "Z:", True, True

        objNetwork.RemoveNetworkDrive "R:", True, True

        objNetwork.RemoveNetworkDrive "N:", True, True

        objNetwork.RemoveNetworkDrive "O:", True, True

        objNetwork.RemoveNetworkDrive "U:", True, True

        objNetwork.RemoveNetworkDrive "S:", True, True

        objNetwork.RemoveNetworkDrive "M:", True, True

        objNetwork.RemoveNetworkDrive "I:", True, True

        objNetwork.RemoveNetworkDrive "K:", True, True

        objNetwork.RemoveNetworkDrive "Z:", True, True

        objNetwork.RemoveNetworkDrive "X:", True, True

        objNetwork.RemoveNetworkDrive "Y:", True, True

        objNetwork.RemoveNetworkDrive "Q:", True, True

         

        'Finds users group membership

        For Each strGroup in objUser.MemberOf

        strGroupPath = "LDAP://" & strGroup

        Set objGroup = GetObject(strGroupPath)

        strGroupName = objGroup.CN

         

         

        'Mappings for all users

        'objNetwork.MapNetworkDrive "T:",
"\\nas1.prism.myschool.com\com\profiles\%username%\My Documents"

        'wscript.Echo strUser.userName

         

         

        'Mappings Based on Group Membership

        'wscript.Echo objGroup.CN

        Select Case strGroupName

         

        Case "MGT IT Services Group"

        objNetwork.MapNetworkDrive "Y:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\IT services"

         

        'Case "MGT Accounting"

        'objNetwork.MapNetworkDrive "R:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Accounting"

         

        Case "MGT Career Services"

        objNetwork.MapNetworkDrive "L:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Career Services"

        objNetwork.MapNetworkDrive "j:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Career Svcs_Act"

        objNetwork.MapNetworkDrive "z:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Undergraduate
Office"

         

        Case "MGT Career Services SAs"

        objNetwork.MapNetworkDrive "L:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Career Services"

        objNetwork.MapNetworkDrive "j:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Career Svcs_Act"

        objNetwork.MapNetworkDrive "z:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Undergraduate
Office"

         

         

        Case "MGT CIBER"

        objNetwork.MapNetworkDrive "R:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\CIBER"

         

        Case "MGT CIBER GRAs"

        objNetwork.MapNetworkDrive "R:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\CIBER"

         

         

        Case "MGT Communications"

        objNetwork.MapNetworkDrive "R:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Communications"

        objNetwork.MapNetworkDrive "N:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\DeanSuite"

         

        Case "MGT Communications Share Guest access"

        objNetwork.MapNetworkDrive "R:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Communications"

        objNetwork.MapNetworkDrive "N:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\DeanSuite"

         

         

        Case "MGT Dean Suite non HR"

        objNetwork.MapNetworkDrive "L:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Building Operations"

        objNetwork.MapNetworkDrive "N:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\DeanSuite"

        objNetwork.MapNetworkDrive "O:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Accounting"

        objNetwork.MapNetworkDrive "U:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Graduate
Assistantship"

        objNetwork.MapNetworkDrive "S:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Accounting\FAcS"

         

         

        'Case "MGT Dean's Suite"

        'objNetwork.MapNetworkDrive "T:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups"

         

         

        Case "MGT Development"

        objNetwork.MapNetworkDrive "L:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Development"

        objNetwork.MapNetworkDrive "R:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Communications"

        objNetwork.MapNetworkDrive "M:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Development\Student
Share"

        objNetwork.MapNetworkDrive "N:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\DeanSuite"

         

        Case "MGT Development SAs"

        objNetwork.MapNetworkDrive "M:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Development\Student
Share"

         

        'Case "MGT Event Support"

        'objNetwork.MapNetworkDrive "T:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups"

         

         

        Case "MGT Eview Users"

        objNetwork.MapNetworkDrive "T:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\eview"

         

         

        Case "MGT Executive Masters"

        objNetwork.MapNetworkDrive "I:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Executive Education"

        objNetwork.MapNetworkDrive "J:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\EMSMOT_Act"

        objNetwork.MapNetworkDrive "K:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\EMSMOT"

        objNetwork.MapNetworkDrive "O:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Accounting"

        objNetwork.MapNetworkDrive "L:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Executive Programs"

         

        Case "MGT Executive Programs"

        objNetwork.MapNetworkDrive "I:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Executive Education"

        objNetwork.MapNetworkDrive "J:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\EMSMOT_Act"

        objNetwork.MapNetworkDrive "K:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\EMSMOT"

        objNetwork.MapNetworkDrive "O:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Accounting"

        objNetwork.MapNetworkDrive "L:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Executive Programs"

         

        Case "MGT Explab Share participants"

        'objNetwork.MapNetworkDrive "L:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Explab"

        objNetwork.MapNetworkDrive "Z:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\ExpLab"

         

         

        'Case "MGT FACS Admin Assistant List F access"

        'objNetwork.MapNetworkDrive "T:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups"

         

         

        'Case "MGT FACS Admin Assistant read access"

        'objNetwork.MapNetworkDrive "T:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups"

         

         

        'Case "MGT FACS Admin Assistant read write access"

        'objNetwork.MapNetworkDrive "T:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups"

         

         

        'Case "MGT Faculty"

        'objNetwork.MapNetworkDrive "T:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups"

         

        'Case "MGT Staff FaCs access"

        'objNetwork.MapNetworkDrive "T:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups"

         

         

         

        Case "MGT Graduate Office"

        objNetwork.MapNetworkDrive "M:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Graduate Office"

         

        Case "MGT Grad Assistant Share"

        objNetwork.MapNetworkDrive "U:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Graduate
Assistantship"

         

        Case "MGT HR staff"

        objNetwork.MapNetworkDrive "X:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Building Operations"

        objNetwork.MapNetworkDrive "N:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\DeanSuite"

        objNetwork.MapNetworkDrive "O:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Accounting"

        objNetwork.MapNetworkDrive "Y:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Communications"

        objNetwork.MapNetworkDrive "R:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Human Resources"

        objNetwork.MapNetworkDrive "Q:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Accounting\Pcard"

         

         

        Case "ILE Office"

        objNetwork.MapNetworkDrive "J:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Institute for LE"

         

        Case "ILE GRAs"

        objNetwork.MapNetworkDrive "J:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Institute for LE"

         

        Case "MGT Tiger Share participants"

        objNetwork.MapNetworkDrive "T:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Tiger"

         

         

        Case "MGT Undergraduate Office"

        objNetwork.MapNetworkDrive "M:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Undergraduate
Office"

         

         

        Case "MGT Recruiting Share Access"

        objNetwork.MapNetworkDrive "Q:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Recruiting"

         

        Case "MGT Faculty"

        objNetwork.MapNetworkDrive "S:",
"\\mgt-fileshare.mgt.myschool.com\com\shares\groups\Accounting\FAcS"

         

         

         

        End Select

        Next

         

        Booker T. Washington III

        Systems Support Specialist


#####################################################################################
Confidentiality and Privilege Notice 
This document is intended solely for the named addressee.  The information 
contained in the pages is confidential and contains legally privileged 
information. If you are not the addressee indicated in this message (or 
responsible for delivery of the message to such person), you may not copy or 
deliver this message to anyone, and you should destroy this message and kindly 
notify the sender by reply email. Confidentiality and legal privilege are not 
waived or lost by reason of mistaken delivery to you.
#####################################################################################

Other related posts: