+ Post New Thread
Results 1 to 11 of 11
Windows Thread, Mapping pupils userdrive in Technical; We have a laptop trolley down in science, we've had many issues with getting these laptops on the domain so ...
  1. #1
    richard.thomas's Avatar
    Join Date
    Sep 2007
    Posts
    491
    Thank Post
    5
    Thanked 11 Times in 10 Posts
    Rep Power
    16

    Mapping pupils userdrive

    We have a laptop trolley down in science, we've had many issues with getting these laptops on the domain so we've got them running standalone with steadystate and various other things to lock them down.

    Obviously we'd like them to get access to their shared area. I reckon we can do this by means of visual basic script. This would run when the user logs in and ask them for their network username. Then the script will map the drive (which should throw up the windows authentication window).
    Anyone think of a better way of doing this? Am I going down the wrong route? (Using the domain isn't an option here).

    Thanks

  2. #2

    dhicks's Avatar
    Join Date
    Aug 2005
    Location
    Knightsbridge
    Posts
    5,498
    Thank Post
    1,185
    Thanked 745 Times in 647 Posts
    Rep Power
    228

    Re: Mapping pupils userdrive

    I've done the same thing, except my script is written in Perl and asks for the user's password too.

    --
    David Hicks

  3. #3

    Ric_'s Avatar
    Join Date
    Jun 2005
    Location
    London
    Posts
    7,582
    Thank Post
    107
    Thanked 761 Times in 592 Posts
    Rep Power
    179

    Re: Mapping pupils userdrive

    Quote Originally Posted by dhicks
    I've done the same thing, except my script is written in Perl and asks for the user's password too.
    Any chance of sharing the knowledge?

  4. #4
    AustenLowe
    Guest

    Re: Mapping pupils userdrive

    a bit of an out of the box thought; what about using windows sharepoint services with webdav, you can access the documents via a webpage

  5. #5

    dhicks's Avatar
    Join Date
    Aug 2005
    Location
    Knightsbridge
    Posts
    5,498
    Thank Post
    1,185
    Thanked 745 Times in 647 Posts
    Rep Power
    228

    Re: Mapping pupils userdrive

    The following Perl script uses Tk to create a little GUI box to ask the user for their username and password, then maps a network drive using those details.



    # Connect to senior IT room file areas and printers.
    $doAuthentication = sub {
    $username = $entry1->get();
    $password = $entry2->get();

    # Change the following as appropriate.
    system("net use h: \\\\server\\$username /user:$username $password /persistent:no");

    exit(0);
    };



    # Ask the user for a username and password.
    while (1 == 1) {
    $mainWindow = MainWindow->new();
    $mainWindow->configure(-title=>$computerName, -background=>'blue');
    if ($screenRes == $WXGA) {
    $mainWindow->geometry('+575+350');
    } else {
    $mainWindow->geometry('+375+250');
    }

    $frame1 = $mainWindow->Frame(-relief=>'groove', -borderwidth=>3, -background=>'blue');
    $frame1->pack(-side=>'top', -fill=>'x');
    $label1 = $frame1->Label(-text=>'Username:', -background=>'blue', -foreground=>'white');
    $label1->pack(-side=>'left');
    $entry1 = $frame1->Entry(-width=>40, -background=>'white');
    $entry1->pack(-side=>'left', -pady=>3);

    $frame2 = $mainWindow->Frame(-relief=>'groove', -borderwidth=>3, -background=>'blue');
    $frame2->pack(-side=>'top', -fill=>'x');
    $label2 = $frame2->Label(-text=>'Password:', -background=>'blue', -foreground=>'white');
    $label2->pack(-side=>'left');
    $entry2 = $frame2->Entry(-width=>40, -background=>'white');
    $entry2->pack(-side=>'left', -pady=>3);

    $entry2->bind('<Return>'=>$doAuthentication);

    MainLoop();
    }

  6. #6

    Join Date
    Apr 2007
    Location
    Leicester
    Posts
    33
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Re: Mapping pupils userdrive

    How do I get the script to run?

    Do I need to put it into a bat file and run it?

  7. #7

    Ric_'s Avatar
    Join Date
    Jun 2005
    Location
    London
    Posts
    7,582
    Thank Post
    107
    Thanked 761 Times in 592 Posts
    Rep Power
    179

    Re: Mapping pupils userdrive

    Quote Originally Posted by frankybaloney
    How do I get the script to run?
    If you are talking about the Perl script, you will need a Perl interpreter (dhicks can probably suggest one) and Tk libraries (I suspect GTk is used for this).

    @dhicks: If you would like to share some more Perl scripts with us, PM me and I'll set up a login on the wiki

  8. #8

    Join Date
    Apr 2007
    Location
    Leicester
    Posts
    33
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Re: Mapping pupils userdrive

    Can the script be converted into a program?

    Basically type in username and password, click OK type of thing with a nice GUI interface?

    If so, how is this done? A step by step guide would be helpful - im new to all of this...

    cheers and apologies for my lack of understanding

  9. #9

    dhicks's Avatar
    Join Date
    Aug 2005
    Location
    Knightsbridge
    Posts
    5,498
    Thank Post
    1,185
    Thanked 745 Times in 647 Posts
    Rep Power
    228

    Re: Mapping pupils userdrive

    Perl on Windows: go and download and install ActivePerl from Activestate (www.activestate.com). This includes the Tk library, so the code above should run fine.

    Place the Perl code into a text file with a .pl extension. Double-clicking on the file should then run it.

    The code above produces a little GUI box that asks for username and password (that's what the Tk library does).

    As others have pointed out, a script to to this might be overkill for your situation. I use the above code in part of a larger system that handles workstation reimages, software installation, printing system and so on (most of which isn't finished yet, so it'll be a while until its worth posting anything on the Wiki). I find that the script above is handy when you have several different servers to connect to with the same username/password (I plan to get it to handle logging in to Moodle, too). It also means that teachers can use their own laptops in school without having to make them part of your Windows domain (which is handy, as we don't have one).

    --
    David Hicks

  10. #10
    richard.thomas's Avatar
    Join Date
    Sep 2007
    Posts
    491
    Thank Post
    5
    Thanked 11 Times in 10 Posts
    Rep Power
    16

    Re: Mapping pupils userdrive

    Quote Originally Posted by jwood
    What's wrong with net use s: \\serveranme\sharename ?

    Inevitably autentication will fail, and windows will prompt you to enter valid credentials.
    That's what I was hoping would happen- However, it seems that it doesn't and VB just reports the error... Annoying...

  11. #11
    richard.thomas's Avatar
    Join Date
    Sep 2007
    Posts
    491
    Thank Post
    5
    Thanked 11 Times in 10 Posts
    Rep Power
    16

    Re: Mapping pupils userdrive

    Done it now- Thanks for the input guys

SHARE:
+ Post New Thread

Similar Threads

  1. mapping drives
    By rjsmith in forum *nix
    Replies: 2
    Last Post: 14th November 2007, 05:42 PM
  2. mapping drives
    By chrbb in forum Wireless Networks
    Replies: 3
    Last Post: 3rd November 2007, 03:18 PM
  3. Home directory not mapping
    By Oops_my_bad in forum Windows
    Replies: 9
    Last Post: 25th October 2007, 04:34 PM
  4. Network Mapping
    By enjay in forum Network and Classroom Management
    Replies: 17
    Last Post: 14th September 2007, 01:21 PM
  5. Mapping my network
    By Samson in forum Wireless Networks
    Replies: 15
    Last Post: 15th March 2007, 10:07 AM

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
  •