+ Post New Thread
Results 1 to 8 of 8
Coding Thread, Mapping Pupils Home Drives On Netbooks in Coding and Web Development; ...
  1. #1

    SYSMAN_MK's Avatar
    Join Date
    Sep 2005
    Posts
    4,012
    Thank Post
    490
    Thanked 1,345 Times in 731 Posts
    Rep Power
    429

    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.

    Code:
    'Script to map Home Folder on netbook
    On Error Resume Next
    Dim objNetwork 
    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
    End If
    
    '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"   
    Err.Clear 
    WScript.Quit
    End If 
    
    'Opens mapped drive
    Call ShowExplorer
    WScript.Quit
    
    Sub ShowExplorer()
    Set objShell = CreateObject("WScript.Shell") 
    objShell.run ("Explorer" & " " & strDriveLetter & "\" )
    End Sub
    
    WScript.Quit

  2. 5 Thanks to SYSMAN_MK:

    garethedmondson (23rd September 2011), SimpleSi (28th September 2011), speckytecky (28th September 2011), stevenlong1985 (22nd September 2011), tech_guy (22nd September 2011)

  3. #2

    MK-2's Avatar
    Join Date
    Oct 2006
    Location
    Nottingham
    Posts
    3,237
    Thank Post
    149
    Thanked 581 Times in 307 Posts
    Blog Entries
    8
    Rep Power
    200
    i did also have a program that would do this, minimise to sys tray and give them the option to disconnect at the end of it.

    mine was done with it popping up a box saying "This software needs to be unlocked to this machine, your unique code is xxxx please see the techies for an unlock code"
    and all it basically done was make an encryption key out of a mac address on the machine and the unlocked key used that. it just meant the software couldn't be passed around to students we didn't want having it.
    if anyone wants it let me know as ill have to change a couple of the strings (like server, sec group etc) before compiling

  4. #3

    Join Date
    Dec 2007
    Location
    cumbria
    Posts
    182
    Thank Post
    7
    Thanked 43 Times in 39 Posts
    Rep Power
    26
    What would be even more impressive would be to take the credentials , query AD to find the home drive location for that user, and then map it - don't know if this is even possible, but something to ponder over the weekend ..

  5. #4

    Join Date
    Sep 2011
    Posts
    1
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Quote Originally Posted by SYSMAN_MK View Post
    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.

    Code:
    'Script to map Home Folder on netbook
    On Error Resume Next
    Dim objNetwork 
    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
    End If
    
    '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"   
    Err.Clear 
    WScript.Quit
    End If 
    
    'Opens mapped drive
    Call ShowExplorer
    WScript.Quit
    
    Sub ShowExplorer()
    Set objShell = CreateObject("WScript.Shell") 
    objShell.run ("Explorer" & " " & strDriveLetter & "\" )
    End Sub
    
    WScript.Quit
    I'm having the same issue with mapping network shares on standalone laptops running windows 7. My issue is that I cannot get the script to run with strUserName as "domain\username". If I set srtUserName as "domain\username", then I cannot map the home folder since all I need is the username part and not all the strings. Neither can I use strUserName as "username", since the username required to authenticate is in the format "domain\username". I will appreciate if anybody can elaborate on this for me. Thanks in advance.

  6. #5

    MK-2's Avatar
    Join Date
    Oct 2006
    Location
    Nottingham
    Posts
    3,237
    Thank Post
    149
    Thanked 581 Times in 307 Posts
    Blog Entries
    8
    Rep Power
    200
    Quote Originally Posted by femilovechild View Post
    I'm having the same issue with mapping network shares on standalone laptops running windows 7. My issue is that I cannot get the script to run with strUserName as "domain\username". If I set srtUserName as "domain\username", then I cannot map the home folder since all I need is the username part and not all the strings. Neither can I use strUserName as "username", since the username required to authenticate is in the format "domain\username". I will appreciate if anybody can elaborate on this for me. Thanks in advance.
    something along the lines of two separate variables; a variable for logon username and one for username.
    strUserName = InputBox ("Enter your Username")
    strLogonUserName = "domain\" & strUserName

    Then in the script where you need to use domain\user you use strLogonUserName and where you need to map the drive you use strUserName

    That should work I think?

  7. #6

    MK-2's Avatar
    Join Date
    Oct 2006
    Location
    Nottingham
    Posts
    3,237
    Thank Post
    149
    Thanked 581 Times in 307 Posts
    Blog Entries
    8
    Rep Power
    200
    Quote Originally Posted by tumbleweed View Post
    What would be even more impressive would be to take the credentials , query AD to find the home drive location for that user, and then map it - don't know if this is even possible, but something to ponder over the weekend ..
    I'll have a look at rewriting the little prog I had, it should be possible to read the AD home directory.

  8. #7

    Join Date
    Dec 2009
    Posts
    33
    Thank Post
    6
    Thanked 2 Times in 2 Posts
    Rep Power
    11
    we use the same style - local log-ins to netbooks / tablets and then use the external link to HAP - that way all the drives are accessible to students, and they can upload to their own areas.

  9. #8

    Join Date
    Jul 2008
    Location
    Raunds
    Posts
    14
    Thank Post
    4
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Hi! I tried a modified version of this script (for our network) but it breaks whenever user credentials are passed to it.

    I think it's a permissions problem because it works when mapping with my own (admin) account, but not for any other. Does anyone know what requirements there are for the share and user permissions for this to work? Anyone care to give a working set of permissions as an example?

    Google says system, creator owner, authenticated users, and admin should be present, but even with all these at full access, there's no joy...

    TIA



SHARE:
+ Post New Thread

Similar Threads

  1. Mapping Home Drives with wierd results
    By sreiach in forum Wireless Networks
    Replies: 12
    Last Post: 11th April 2011, 03:26 PM
  2. Weird issue - home drives not mapping
    By chrisjako in forum Windows Server 2008
    Replies: 4
    Last Post: 15th September 2010, 10:01 AM
  3. Replies: 3
    Last Post: 15th February 2008, 01:58 PM
  4. Map network drives on wireless network
    By woody in forum Windows
    Replies: 24
    Last Post: 1st December 2007, 07:27 PM
  5. Replies: 27
    Last Post: 25th January 2007, 04:42 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •