For a company I have to remove the default printers(fax, onenote, ...). Manually you would do this in control panel, right clicking it, and do remove printer.

Using i.e.: printui.exe /dd /m "Send to Microsoft OneNote 15 driver"

It doesn't always work, it states that the specified driver is currently in use. Even when the printer does not have a green check (for being the default when printing stuff). If I can recall correctly, it does work for printers you have added yourself.

It would be nice is if I could catch the default printers dynamically and delete them that way. This is a solution for the problem that you get when the driver is already deleted. For now the names have to be manually changed and I would have to combine this with an if-structure which is not really advisable.

  • I may have figured out that I need to use "/dl" instead of "/dd" but I still would like the dynamic part :) – Jonathan May 30 '16 at 9:27

Normally in a company environment, one would use Group Policies to manage printers.

One of the rules you can set through a group policy, is to remove all printers, followed by adding a printer.

You could then add all the printers you want and have everything uniform. With the option to have multiple Group Policies, you can specify which user is assigned to which group policy, as such, you can create specific situations for different offices. A user could be placed in a specific Organisation Unit inside Active Directory, and the Group Policy would then manage its printers based on what is standard for that location.

Also, setting the default printer can be done using Group Policies too.

  • It's for a hospital, every department needs a computer and sometimes they need to be recycled or renewed. We do not know ahead of time what department the computer will be heading. The script also does other stuff like defragmenting the c-drive, so it's certainly not a waste of time. – Jonathan May 30 '16 at 9:55
  • @Jonathan if you're having AD, this is the way to go. It doesn't matter that you don't know to which department your computer goes (which is a questionmark in my mind, since an admin should know where his computers are), as long as you put the computer in the correct Computer OU and the departments log on to the system by the User OU they belong to, there is no need for a script. defragmenting isn't necessary anymore for win7+. – SimonS May 30 '16 at 11:16
  • You can both use the computer and the user. The benefit of using the user, is that when a user moves to a different department, you move it to a different OU, and automatically it gets the new printers, and what else you specify in your policies. – LPChip May 30 '16 at 11:38
Get-WMIObject Win32_Printer | foreach{$_.delete()}

source: https://msitpros.com/?p=1215

  • this will simply delete all printers, not just the default ones. – SimonS May 30 '16 at 11:10

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.