MSFN Forum: Script to set default printers - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Script to set default printers Rate Topic: -----

#1 User is offline   ding8503 

  • Group: Members
  • Posts: 1
  • Joined: 19-November 12
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 19 November 2012 - 12:27 PM

I'm new to VB scripts, and having issues wrapping my head around how to do this. I have a simple script written to put on machine by machine that will set default printer, but looking to write one to apply through Domain policy to cover all. We have some computers installed in cars that have local USB connections to Brother Pocket Jet printers (some Brother Pocket Jet 3 Plus and some Brother PJ-623). I’m trying to write a script that on can be applied to user OU from AD that when the user logs in the script will look to see if one of the Brother printers are installed, if so make that the default printer. If the script finds that there is not a Brother printer I want it to connect to a network share printer and set the network share as the default. It would be nice to set the network share as a printer to for all computers, just set the default depending on the Brother printers.
Thanks in advanced for any and all help.

Here is the only thing I have now.

Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection "\\Server\printer"
WshNetwork.SetDefaultPrinter "\\Server\printer"


#2 User is offline   gunsmokingman 

  • MSFN Master
  • Group: Super Moderator
  • Posts: 2,352
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 19 November 2012 - 02:21 PM

Here is a Link to some WMI Printer Scripts
Here is a Link to the WMI Printer Class

#3 User is offline   draxx 

  • Certified Geek
  • Group: Members
  • Posts: 43
  • Joined: 06-May 03

Posted 03 March 2013 - 06:25 AM

What Server OS are you using on your domain? If you are using Windows Server 2008 or higher, you may be able to do this without scripts at all, and simply use Group Policy preferences. See this article -> http://blogs.technet...lt-printer.aspx

You'll note that you can share a printer, update a shared printer to be default and also update a shared printer to be default ONLY if there is no local printer present, which seems to cover what you need. If you want to target specific computers, users, OU's, security groups etc, you can use Item Level targeting from the Common tab shown in the article I mentioned. (more info here -> http://technet.micro...y/cc733022.aspx)


I'm happy to provide assistance on this as I use this feature across the 4 schools networks I manage.

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy