I needed to create this drive mapping workaround because our ports use 802.11x.  The user authentication happens post login so the home drive would never be mapped automatically by Active Directory.  This script maps the home drive using the logon script.

On your AD server, in the NETLOGON folder create a logon.bat file

{codecitation style="brush: plain text;"}
@echo off
wscript %0\..\login.vbs{/codecitation}

In the same folder create a logon.vbs
{codecitation style="brush: visual basic;"}
Dim objFSO, objNetwork, strDirectory, oShell

Set oShell = CreateObject("WScript.Shell")
Set objNetwork = CreateObject("WScript.Network")
Set objFSO = CreateObject("Scripting.FileSystemObject")

strDirectory = "\\fileshare\Users\" & objNetwork.UserName

'If the user has a home directory then map it
If objFSO.FolderExists(strDirectory) Then
 'If the M: drive is already mapped then unmap it so it can be re-mapped
 If objFSO.FolderExists("M:\") Then
   ' Disconnect drive the nice way
  objNetwork.RemoveNetworkDrive "M:", True, True
  ' Force disconnect if above disconnect fails
  oShell.Run "NET USE M: /DELETE"
 End If
 on error resume next
  'Map the drive
       objNetwork.MapNetworkDrive "M:", strDirectory, True
  'objNetwork.MapNetworkDrive "I:", "\\path\u","True","username","pw"
 on error goto 0
     'Folder doesnt exist so needs home folder set up in AD
End If


Set your \\fileshare\Users to only be accessible by Administrators, open ActiveDirectory and open the desired user(s).  Go to the profile tab and set the 'Home Folder' connect radio button and drive letter to M: and \\fileshare\Users\%username%

In the 'User Profile' section set the 'Logon script:' to 'logon.bat'

Other useful things to consider:

GPO folder redirection. User Configuration>Windows Settings>Folder Redirection>My Documents. Right click>Properties. Basic, Target folder location. Redirect to user's home directory. May not be a need to Grant the user exclusive rights since the parent folder created by AD 'Home Folder' configuration took care of this. 

Computer Configuration>Administrative Templates>System>Logon>Always wait for the network at the computer startup and logon 'Enabled'


Automatically create desktop shortcuts depending on the users group. Warning, code not optimized.
{codecitation style="brush: visual basic;"}

Dim wshNetwork, ADSysInfo, CurrentUser, fso, wshshell, oUrlLink

on error resume next

Set wshNetwork = CreateObject("WScript.Network")
Set ADSysInfo = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & ADSysInfo.UserName)
Set fso = wscript.CreateObject("Scripting.FileSystemObject")
Set WshShell = WScript.CreateObject("WScript.Shell")
StrUsersDesktop = WSHShell.SpecialFolders("Desktop")

colGroups = CurrentUser.MemberOf

If IsEmpty(colGroups) Then
    strGroups = ""
ElseIf (TypeName(colGroups) = "String") Then
    strGroups = LCase(colGroups)
    strGroups = LCase(Join(colGroups))
End If

'Shortcuts for All Users
set oUrlLink = WshShell.CreateShortcut(StrUsersDesktop & "\Google.url")
oUrlLink.TargetPath = "http://www.google.com"

'Shortcut for the users in the techs group
If InStr(strGroups, "cn=techs") Then
 set oUrlLink = WshShell.CreateShortcut(StrUsersDesktop & "\Microsoft Tech Net.url")
    oUrlLink.TargetPath = "http://technet.microsoft.com"
End If

Set oUrlLink = Nothing
Set WSHShell = Nothing
Set fso = Nothing
Set wshNetwork = Nothing
Set ADSysInfo = Nothing
Set CurrentUser = Nothing