Mapping Pupils Home Drives On Netbooks
I think this has been mentioned before but couldn’t find the thread, but anyhow. One of my schools has a trolley of 30 netbooks that are standalone and have a standard local account for the pupils to use that auto logs on. This works well as they are quick to get to the desktop as no logging on the domain over wireless. The only downside is transferring work pupils do on them back to their home drives on the network.
Now I know I could make a shared folder that pupils could dump stuff into from the netbooks and then copy back when on a domain computer but that was too much faf, plus not much help the other way.
So after digging around Google and chopping up some scripts I now have a VBScript that prompts for a username and password and then maps the Home Folder based on the username entered and then opens the newly created drive. Code below for anyone who might find it useful.
'Script to map Home Folder on netbook
On Error Resume Next
Dim strDriveLetter, strRemotePath, strUserName, strPassword
strDriveLetter = "N:"
strRemotePath = "\\w2k8srv01\pupils$"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objNetwork = WScript.CreateObject("WScript.Network")
'Removes strDriveletter if it exists.
If objFSO.DriveExists("N:") = True Then
objNetwork.RemoveNetworkDrive "N:", True, True
'Ask for Username
strUserName = InputBox ("Enter your Username")
'Ask for Password
strPassword = InputBox ("Enter your Password")
'Maps Networkdrive path to strRemotePath & strUserName using credentials strUserName & strPassword
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath _
& "\" & strUserName, False, strUsername, strPassword
If Err.Number <> 0 Then
WScript.Echo " Drive not mapped. Incorrect Username or Password"
'Opens mapped drive
Set objShell = CreateObject("WScript.Shell")
objShell.run ("Explorer" & " " & strDriveLetter & "\" )