Archive for the ‘Windows’ Category

Network Logon script – Windows 2008 Domain

Wednesday, September 1st, 2010

Ever wanted to Map Network drives for your Domain users when they log on ? How about automatically adding a printer ? Or Map a Network Drive for specific users only ?

No problem ! :)

@echo off
net use * /delete /y
net use R: \\DATA_SERVER\HOME_DRIVES$\%USERNAME% /persistent:no
net use W: \\DATA_SERVER\SHARE /persistent:no
start \\PRINT_SERVER_IP_ADDRESS\PINTER_NAME /MIN
IF (%USERNAME%) == (SOME_USER_NAME) net use N: \\DATA_SERVER\SOME_SHARE /persistent:no

Put the above code into a text file on windows and rename it to logon_script.bat or any name really, as long as it is a .bat file.

Place the .bat file into your SYSVOL folder, and now, using Active Directory, Users and Groups, add the logon script to each user of your domain, and your done :)

To test, please log off and log on again, your printer should be added now, and your drives mapped.