SBS 2003: Mapping network drives for users at logon

by Soddengecko @ 20:07   Code | Tech   Permalink

Some time ago I installed an SBS 2003 server to act as Domain Controller/Exchange server/File and Print Server etc. The main aim was to centralise all the different locations of my data and printing needs into one manageable system. Although I am more than capable of mapping a drive manually and navigating to shared folders, I wanted a solution that did it all when I log onto my computers at home. Here is brief overview of what logon scripts do and how to get them working for you.

Everytime a user logs onto a windows domain a batch file is run from the NETLOGON folder on the domain controller, in this case, Windows Small Business Server 2003. The primary function of this file is to install any application that has been pushed to the client workstations. I wanted to amend this so that printers and shares were automatically allocated depending on the user who logs in.

For this example our server is called SBS, the user will be “ANother” and the folder we want to share is “Applications”. The first thing you need to do is find the logon script: it will be located here – “C:\WINDOWS\SYSVOL\sysvol\<domain name>\scripts\SBS_LOGIN_SCRIPT.bat”

The logon script will contain the line needed to add applications to users computers instead of manually installing them. For the sake of my setup I deleted this line as I do not need it but the line looks like this: “\\sbs\clients\setup\setup.exe /s sbs“. Please leave this line in if you plan to deploy software to workstations from the server.

Open up the SBS_LOGIN_SCRIPT.bat file (right click and select “edit”). What we are going to do is create a shortcut in this file to a file that matches the username of the logged on user. So add this line to the login script batch file, save it and close it. “\\sbs\netlogon\%username%.bat

What this line does is look within the scripts folder for any batch files matching the username of the logged on user. So if Tom was to log on with his name “another” the login script will look for another.bat.

Now we can create out user files so we can map drives and printers specifically for them. I will cover printers in another post. Create a new file in the scripts folder and call it “another.bat” and open this up ready to edit. We need to add the applications share to Toms logon script.

In Toms file add the line: NET USE F \\sbs\applications

Save and close this file.

Now whenever Tom logs onto his computer the applications share will automatically be added as a network drive. All he has to do is go to “My Computer” and it will be listed for him to access. Of course we can go further than this and add shortcuts to the desktop and other mapped drives as well as printers and installs. I will not cover those here but check back for my update on adding default printers to a users account.

Everytime you add a new user to your domain, don’t forget to add a new batch file for that user and add in all the drives you want to map for them.

If you have any questions, comments and any other info just let me know.

Do you want to leave a reply?


XHTML: You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>



Contact