ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Network Printer Removal - GPO Configured

    Scheduled Pinned Locked Moved IT Discussion
    gpowindowswindows 7windows 8.1windows 10printers
    1 Posts 1 Posters 913 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DustinB3403D
      DustinB3403
      last edited by

      Network Printer Removal that were configured via GPO

      I wrote this script some time ago because we were replacing our printers, that were all configured via GPO. Removing the printers would've been a pain in the rear otherwise. This script will simply delete the GPO that created the connections and allow you to follow up with a GPO update to pull in any new printers.

      	@ECHO off
      	title Printer System Cleanup
      
      	::Stopping the Print Spooler
      		net stop spooler
      		ECHO.
      		ECHO Cleaning up the registry a bit, Please Wait ...
      		ECHO.
      
      	::Removing Network Printer Registry Keys
      		ECHO Y | reg delete HKEY_CURRENT_USER\Printers\Connections\
      		ECHO.
      		ECHO Registry cleanup completed, starting print spooler.
      		ECHO.
      
      	::Starting the Print Spooler
      		net start spooler
      		ECHO.
      		ECHO Printers are on their way, this'll take a minute or two.
      		ECHO.
      
      	::Forcing a GPUPDATE
      		ECHO N | gpupdate /force
      		ECHO.
      
      	::Opening up the devices and printers window, and loading the printers to confirm for the end user. 
      
      		ECHO Printers are now added, please confirm by checking the recently opened window.
      		control /name Microsoft.DevicesAndPrinters  
      		ECHO.
      		ECHO.
      		ECHO.
      		ECHO Make sure to set your DEFAULT printer!!
      		ECHO.
      		ECHO Done!
      		ECHO.
      
      1 Reply Last reply Reply Quote 1
      • 1 / 1
      • First post
        Last post