I am running a script that looks at the username and maps drives according to that user's group membership within Active Directory. Everything works fine, however I want to change the way the drives are labeled within "My Computer".
Currently, a network drive is labeled similar to the following:
Accounting on 'fileserver' (M
or
HR on 'fileserver\department shares' (H
(This depends on whether the folder is being shared directly or a parent folder is only being shared.)
Is there any way to change the way that these network drives are labeled after mapping them? Rather than the above, I would like them to simply say:
(H
HR
or
(M
Accounting
If this isn't possible, then minimally I would like the drive letter to be displayed first. I constantly refer users to drives by drive letter when troubleshooting problems over the phone. My users get lost when they don't see the drive letter displayed and only see the share.
Here is a sample of my script, I left out the portions of the script that don't pertain to this question.
'************************************************
'CREATE OBJECTS AND DEFINE VARIABLES
'************************************************
on error resume next
Set wshNetwork = CreateObject("WScript.Network")
Set ADSysInfo = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & ADSysInfo.UserName)
set ofso=createobject("Scripting.filesystemobject")
strGroups = LCase(Join(CurrentUser.MemberOf))
'msgbox(strgroups)
MyUsername = Right(CurrentUser.Name, Len(CurrentUser.Name)-3)
'************************************************
'DELETE ALL NETWORK DRIVES
'************************************************
Set Drives = WshNetwork.EnumNetworkDrives
For i = 0 to Drives.Count - 1
on error resume next
wshNetwork.RemoveNetworkDrive Drives.Item(i)
Next
'***********************************************
'Drive Mappings
'***********************************************
If InStr(strgroups, "cn=fp human resources") Then
wshNetwork.MapNetworkDrive "H:", "\\fileserver\HR", "False"
End If
If InStr(strGroups, "cn=fp accounting") Then
wshNetwork.MapNetworkDrive "M:", "\\fileserver\department shares\Accounting", "False"
End If
**************************************************
Thank you in advance.
Chris
Currently, a network drive is labeled similar to the following:
Accounting on 'fileserver' (M
or
HR on 'fileserver\department shares' (H
(This depends on whether the folder is being shared directly or a parent folder is only being shared.)
Is there any way to change the way that these network drives are labeled after mapping them? Rather than the above, I would like them to simply say:
(H
or
(M
If this isn't possible, then minimally I would like the drive letter to be displayed first. I constantly refer users to drives by drive letter when troubleshooting problems over the phone. My users get lost when they don't see the drive letter displayed and only see the share.
Here is a sample of my script, I left out the portions of the script that don't pertain to this question.
'************************************************
'CREATE OBJECTS AND DEFINE VARIABLES
'************************************************
on error resume next
Set wshNetwork = CreateObject("WScript.Network")
Set ADSysInfo = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & ADSysInfo.UserName)
set ofso=createobject("Scripting.filesystemobject")
strGroups = LCase(Join(CurrentUser.MemberOf))
'msgbox(strgroups)
MyUsername = Right(CurrentUser.Name, Len(CurrentUser.Name)-3)
'************************************************
'DELETE ALL NETWORK DRIVES
'************************************************
Set Drives = WshNetwork.EnumNetworkDrives
For i = 0 to Drives.Count - 1
on error resume next
wshNetwork.RemoveNetworkDrive Drives.Item(i)
Next
'***********************************************
'Drive Mappings
'***********************************************
If InStr(strgroups, "cn=fp human resources") Then
wshNetwork.MapNetworkDrive "H:", "\\fileserver\HR", "False"
End If
If InStr(strGroups, "cn=fp accounting") Then
wshNetwork.MapNetworkDrive "M:", "\\fileserver\department shares\Accounting", "False"
End If
**************************************************
Thank you in advance.
Chris