Category Archives: IT Management

FreeNAS: Automate Drive Mappings for Windows Users

This is the third in a series about FreeNAS, the free network attached storage application which allows you to create an inexpensive but highly capable network file server for backups, iTunes, and general file sharing. Our application is a server for student data. We want to give each student a secure folder in which to store files that they create and use when working in our student computer labs.  The two previous postings are:

Creating a FreeNAS server for student data

Adding students and creating folders 

Note that the first link picks up at the point that the FreeNAS server software has been installed on to server hardware with a minimal configuration. The FreeNAS web site has links to several tutorials as well as the official setup guide.

By the way, FreeNAS installs really nicely within a virtual machine so you can easily test it out. I’ve got it running in Parallels on my MacBook, with software RAID 5 providing redundant disk storage.

Mapping a drive to a student folder

Once I set up the student’s folder and account on the FreeNAS server, I wanted to be able to give them the opportunity to access it from any workstation in our student lab.  The cleanest way I could think of was to create an icon on the desktop which runs a script. The script does the following:
1. Asks for the student login name
2. Asks for the student’s password
3. Maps the H: drive to the student’s folder on the FreeNAS server.

Student folders are named exactly the same as the student login, and they all appear under a shared folder called “StudentData”.  The full path is /mnt/StudentData/.  So, when student Myron Kapoodle logs in with his user name mkapoodle, the script takes him to: 


Thus, when the student accesses drive H:, they find themselves in their own folder. They can’t select a folder “above” their own, and they can’t access anyone else’s folder, even if they can see it when browsing around the network neighborhood.

The Script

' VBScript to map a network drive.
' Heavily borrowed from ....
' Guy Thomas
' Larry Keyes
' ------------------------------------------------------'
Option Explicit
Dim strDriveLetter, strRemotePath, strUser, strPassword
Dim objNetwork, objShell, objFSO
Dim CheckDrive, AlreadyConnected, intDrive

' This section gets the name and password
strUser=InputBox("Enter your User Name")
strPassword=InputBox("Enter your Password")

' The section sets the variables.
strDriveLetter = "H:"
strRemotePath = "\\freenas\StudentData\" & strUser

' This sections creates two objects:
' objShell and objNetwork and counts the drives
Set objShell = WScript.CreateObject("WScript.Shell")
Set objNetwork = WScript.CreateObject("WScript.Network")
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
Set CheckDrive = objNetwork.EnumNetworkDrives()

If objFSO.DriveExists(strDriveLetter) Then
objShell.Popup "The H: Drive is already mapped"
objNetwork.RemoveNetworkDrive strDriveLetter
strRemotePath = "\\freenas\StudentData\" & strUser
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath , false, strUser, strPassword
strRemotePath = "\\freenas\StudentData\" & strUser
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath , false, strUser, strPassword
End if

'Section which actually (re)names the Mapped Drive to eliminate naming problem.
Set objShell = CreateObject("Shell.Application")
objShell.NameSpace(strDriveLetter & "\").Self.Name = strUser
Wscript.Echo "Check : "& strDriveLetter & " for " & strUser

There is some extra stuff in there that attempts to fix an issue that appeared in Windows 7, where if the drive mapping is reused, it shows up with the name of the previous user.

Our student workstations have a single “student” local account.  Every student logs in to that account when they use the workstation. There are no individual user profiles. In some cases I have the student account log in automatically, and I’ll probably do this on all machines that use the FreeNAS network so that a student doesn’t have to log in twice…once to the desktop and once with their own user name and password on the FreeNAS server.

This script should be installed on each Windows workstation, with a desktop icon to appear on the desktop of the student account.

Two other observations and questions:

1. Obviously you can simply map a drive from the command line using Start->Run->CMD, and then at the prompt  type MAP H: /freeNAS/StudentData/mkapoodle.

2. I searched all over for a more elegant way to have a screen that came up that would ask for the name and password and then make the call to create the drive mapping. First I looked at C#, then, because Visual Basic has a “shell” command, I switched to VB. However that required a full-blown Windows installation of the .exe file, as well as a batch file which was called by the VB program. I finally decided I could live with two windows popping up; one asking for the name and another for the password.

Remote Access via iPhone and iPod Touch

Logmein now has a version of Ignition for the iPhone and the iPod Touch.

Logmein continues to provide terrific value for remote access. We’re using it extensively, with a combination of the free version for most workstations and LogMeIn IT Reach for our servers and critical workstations. Ignition is the desktop client which is slightly more convenient than accessing your Logmein computers from a web page.


After more than two years, a former and much loved non-profit client called for some help in sorting out their donor database. That’s another story which may be worth telling, but I was interested in seeing how they have weathered the economic downturn, and how some of the networking decisions that we took some years ago have held up. They have a main office and several field offices scattered among three counties. They have about 55 employees.

  1. By the time I had left, most of field offices had a broadband connection. That work was completed, and each office now has a DSL broadband connection, either from a local ISP, or from Fairpoint (the company who bought the Verizon landline and consumer data service in the three northern N.E. states). After working with it for a couple days, I’d say performance is OK.. although today, curiously, there was a twenty minute outage.
  2. With broadband available, they how have remote access software going to EVERY computer in EVERY office, as well as their central file server. Much desktop maintenance that required an on-site visit, can now be accomplished over the wire.
  3. Electronic mail accounts are hosted by the local internet service provider. People use Outlook or Outlook Express as their desktop eMail client….and access their eMail account when away from the office via webmail.
  4. They refreshed their desktop hardware with Dell Optiplexes that were donated by a local large employer. Although the machines are hand-me-downs, they are more than adequate for eMail, web browsing, and running the database application. The donor also gave them several laser printers that were only a few years old. Everyone is running XP, with Office 2007. (Without prompting, they said that Office 2007 is fine.) They have Norton Anti-Virus which is managed from the file server. No less than three of the staff said, in casual conversation… “well, I do have a Mac at home”. I nodded toward my Macbook, running Parallels, wondering if this turns out to be a longer term gig, if I will need to get a new Windows laptop.
  5. Their Dell file server is probably going on five years; but it is built like a tank, with RAID drives, and the original HP backup tape system. They have HP Procurve 2124 ethernet switches, and HP continues to keep replacing them under a lifetime warranty, when the fans go bad. I think we’ve replaced two or three switches with this client, and a couple of them with other clients. It takes one phone call.
  6. Several old battles were, well, old, if not forgotten. They have made their peace with a state-mandated performance data application which gave us all fits for years. The Executive Director attributes this success to attentive support from the state agency which mandated the system.
  7. If there is one especially popular non-business application being used by the staff, it is streaming audio. In fact, today, the first indication that there was a glitch in the internet connection was when a staff member came in and asked why her “radio” wasn’t working.

In short, it Just Works. I think this is attributable to the existing staff who have educated themselves over the years, and new staff who have come on board with full expectations of a functioning network and desktop workstation and how to use it. Add in some longstanding support from management who recognize the value of investing in technology and training, and the efforts of the current part-time network manager who keeps it all humming.

NPower – Network Documentation Template

NPower Seattle has a Network Documentation Template which is in Word. This is a great start for documenting your computer network. The file is called SBS2003template.doc which suggests it might have been modified by one supplied by Microsoft, and it includes inserted Visio files to show the networking diagrams. If you are a MS shop this will work out of the box. If not, you can easily modify it in OpenOffice, or Pages, or whatever. The object of documenting your network is not necessarily perfection…but to have something to give you a clue when things start going haywire.

Call Centers from Hell and Customer Contempt

Especially during a recession, it amazes me the utter contempt company call centers show toward their customers. I spend a lot of time on calls with technical support people, and it remains as irritating as ever to get to them. Once I get a live person, however, I can usually calm down.

I really hate hearing that “This call may be monitored or recorded for training or quality control purposes”. Especially right at the outset of a call. Maybe for my broker… (what broker?) when giving financial instructions. For all the “training” that is going on sitting in phone tree hell doesn’t seem to be getting any easier. And quality control purposes? It makes me uneasy that I’m being recorded at all.

On hold, I really hate hearing every 15 seconds that “We appreciate your patience, and thank you for waiting during this brief delay”. and “We know that you are very busy, we appreciate your call”. Or worse, blabbing on about the web site, or the new product, or alternate ways to contact us, or whatever. These constant interruptions makes it impossible to concentrate on other work while waiting. What ever happened to playing Vivaldi and not inserting commercial messages?

While there are “secret” phone numbers floating around the internet for various services, I can’t imagine a company would want these internal numbers published; they would get spammed quickly.

So, I’m holding for Fairpoint right now, and have had 5 dumb “Thank you for holding messages” in the previous minute.
“Thank you for holding, your call will be answered in just a moment”
“We know your time is important, and appreciate your patience while on hold”
“Every effort is being made to ensure that your wait is as short as possible… Thank you”
“Thank you for holding, someone will be right with you.”
“Your call is very important to us. Thank you for waiting and bearing with us during this brief delay”.

And then the cycle starts again. All this accompanied by ear-splitting muzak (tacky fake FM-synthesized saxophones.)

Odds and Sods

Going Aerial

Smashing Magazine has a collection of images taken from above and links to additional collections and tips for aerial photography.

There are a couple of tutorials over at Make Magazine’s web site for kite aerial photography, and photography on a pole. Both units use a similar yoke-mounted camera assembly that is controlled by servos. In fact, if you made the yoke once, you could probably use it for both applications.

Old Dogs/New Tricks Department

Jeff Duntemann gets Ubuntu. His Contrapositive Diary has now been moved over to a WordPress platform. I miss the old single page with the spiral-bound notebook illustration.

I’ve been working with MindManager for the Mac. This is available in version 8 for Windows, and version 7 for the Mac. Version 7 works fine; while not elaborate, it is quick to learn, and strikes me as an excellent example of “less is more”. More ideas for mind mapping are on Chuck Frey’s blog and he has a useful e-Book with lots of ideas. One suggestion from the book; when showing a mind map diagram to someone, don’t call it a “mind map”. My most elaborate map to date was the proposal outline of our NIH grant application discussed a couple posts ago.

Question of the Day: “Why is there no Visio for the Mac?” Or maybe a better way of asking the question, “What is the equivalent of Visio on the Mac?

Non-Technical Question of the Day: Watching the follies surrounding the confirmation of Timothy Geithner as treasury secretary, I have to ask, what is a guy who underpaid $34,000 in income tax using Turbo-Tax and doing his own taxes in the first place? Oh, and why did this happen to get resolved shortly before his nomination to the post of treasury secretary, even though the years when he didn’t pay were back in the first part of the decade? $34,000 is still a respectable salary in my neck of the woods… how much was the guy making in gross salary to be able to owe that much and then not pay it?

MobileMe – Synchronizing Macs

I’ve been intending to sketch out my whole synchronization scheme which keeps multiple applications synched between two Macs and the rest of the world, but it is so complicated that just documenting it has made me want to rethink. In the interim, I noticed yesterday that a bunch of changes that I had put into my address book on the MacBook didn’t get synched to the iMac, and after a lengthy chat with Apple’s MobileMe tech support the answer appeared to be nothing more than logging out of MobileMe on the laptop and then logging back in.

One trick with synching with MobileMe is to strip down the applications, so that you are only trying to sync one thing at a time when troubleshooting. Right now I’ve only got the contacts synching.

If one forgot that you can actually log into your MobileMe account from a web browser, one should be reminded of that helpful suggestion, as you can check whether your sync changes reach the the “cloud”. Obviously (in hindsight) if you make a change in iCal on one machine, and do a sync, the changes should appear in the copy of your files in the cloud, before any other machine can sync and download the changes.