Solved

How to remove and add LOCAL printers via script

Posted on 2016-09-20
5
107 Views
Last Modified: 2016-09-23
Hello, I have an environment that I want to remove the printers (including the drivers) and add them back via a script.  These printers work best if they are LOCAL so I need to have them install via the local machine and not on a print server.

These systems are on a AD Domain with the DC having Windows 2008

Windows 7 64bit and 32bit systems.
0
Comment
Question by:tucktech
5 Comments
 
LVL 29

Expert Comment

by:Randy Downs
ID: 41807967
Try this  .

VBS
set objNetwork = CreateObject(“WScript.Network”)
objNetwork.RemovePrinterConnection “\\Your_print_server\printer_name_being_removed”
objNetwork.AddWindowsPrinterConnection “\\Your_print_server\printer_name_being_added”

Open in new window


Logon Script
 @echo off 
    Pushd %~dp0 
    Cscript printerinst.vbs

Open in new window

0
 
LVL 12

Accepted Solution

by:
Sandeep earned 250 total points
ID: 41808486
You can use PrintUI tool to configure the script (.bat) and remove the network printer and add same printers as Local printers.

https://technet.microsoft.com/en-us/library/ee624057(v=ws.11).aspx

This article is self explaining so you should be able to try it on one system by using command prompt. Once you are sure it works save same commands in a batch file one after the other like printer removal command on first line and on next addition of printer. I assume you have same name of printer to add and remove on all machines. Then use same batch file to run from all machines and hope this should work.
0
 
LVL 24

Assisted Solution

by:Lionel MM
Lionel MM earned 250 total points
ID: 41808574
This site is similar to the one already provided -- I use it as my reference point so it may help you too http://windowsitpro.com/windows/how-can-i-add-printer-command-line; shows how to add, remove, & delete drivers & printers
0
 

Expert Comment

by:jdmailny
ID: 41811864
What is your exact question - this is not clear
0
 

Author Closing Comment

by:tucktech
ID: 41812285
Printui scripts are the way to go for this problem.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
This article explains how to install and use the NTBackup utility that comes with Windows Server.
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question