How to setup default printer script in Window server 2008 domain controller

Open up a notepad and copy this script down and save it with a login.bat extension into the \\servername\logon folder (maps to the default location of scripts on server)
———————————————————————————-
@ECHO OFF
::Replace CompanyName With your company’s real name
TITLE COMPANYNAME LOGON SCRIPT
:: echo off will hide the actions of the logon scripts
:: and allow you to leave a message of your own.
ECHO. ADDING PRINTER
Cscript \\serverdc\sysvol\domain.com\scripts\AddPrinter.vbs
ECHO. PERFORMING OTHER ACTIONS
::Add additional commands here.

 ——————————————————————————————————-
You can remove all of the lines that use ::, they are just notes for anyone using the script.

Open a new notepad and copy the following script and save it as - AddPrinter.vbs
—————————————————————————————–
Set WSHNetwork = CreateObject(“WScript.Network”)
WSHNetwork.AddWindowsPrinterConnection “\\servername\HP Laserjet″
WSHNetwork.SetDefaultPrinter “\\serverdc\HP Laserjet″

——————————————————————————

Be sure to store both scripts in the \\servername\netlogon folder. The folder simply maps to C:\Windows \ Sysvol \ Sysvol \ Domain.com \ Scripts

Next, open Group Policy Deployment on the server and go to User Configuration -> Windows Settings -> Scripts (Logon/Logoff) -> Logon

Right click logon and select properties, add \\servername\netlogon

Be sure to replace the \\servername\netlogon with the real name of your domain controller

Add Feedback