Jobos Posted April 26, 2017 Posted April 26, 2017 With Windows 7 I used a vbs script to deploy printers and never had any problems with it. Now as we are starting to move to Windows 10 I'm finding the script is not reliable so have started playing with GPP but have found a strange problem which I cannot answer. I have a win10 vm and configured GPP to deploy one printer and as long as I give the machine time to settle before logging on GPP works. If I am too quick logging on after a restart GPP fails and no printers get installed. Right, the problem I'm having is I have a test user who has a super mandatory profile. I let GPP install the printer then I added a printer using the add a printer wizard. Now when I delete the printer I just added the printer comes back on the next restart even though the user has a super mandatory profile and their profile gets deleted on logoff. The machine must be remembering the printer but I cannot find out where?
ZeroHour Posted April 26, 2017 Posted April 26, 2017 Try setting a GPP to delete all ip printers in computer policy for the PC's OU. Also are you using "Always wait for the network at computer startup and logon" computer policy to see if GPP applies properly each time?
Jobos Posted April 28, 2017 Author Posted April 28, 2017 Been trying different things most of the afternoon. I tried using GPP to delete all shared and ip printers in both user and computer policies but the printers are still there. When logged on as admin and deleting printers by hand after I have deleted the last printer they all come back again within 15 seconds.
free780 Posted April 29, 2017 Posted April 29, 2017 Are your gpp settings user or.computer? Also Windows 10 sets the last used printer as default. Which may be why they keep coming back.
Jobos Posted May 3, 2017 Author Posted May 3, 2017 I'm using gpp user settings to add the printer and I can add printers ok using gpp. It's just the other printers I added using vbs that keep coming back.
chaunka420 Posted November 17, 2017 Posted November 17, 2017 We are experiencing the EXACT same problem as you Jobos. What did you end up doing? We did find the old printers mapped by script had entries in the registry. But we now have about 100 PCs with ghost printers on them. [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\Client Side Rendering Print Provider\Servers] https://social.technet.microsoft.com/Forums/windowsserver/en-US/71d06204-3735-4473-8bc9-20be9e19090e/problem-with-multiple-instances-of-shared-printers-being-installed-on-client-computers-when-the?forum=winserverprint
Jobos Posted November 23, 2017 Author Posted November 23, 2017 @chaunka420 Yes is seems even when the user profile is deleted the printers the user had are still in the registry so when the user logs back on the old printers are still there unless they are manual removed. The problem only started for us when upgrading from 1607 to 1703. What I did was to closely search the registry and list what was needed to be removed but found I needed PSExec to run regedit under the system logon to remove the keys and add them back. Rename the attached to .reg and put it and this bat file on the system, open a command prompt as admin and run this: Reset_Win10_Printers.bat It will use PSExec to load regedit and import the .reg file then restart the machine. I only has 20 machines but if you have 100 you may want to script it. File Name: Reset_Win10_Printers.bat \\\\PSexec \\%1 -s regedit.exe /s \\\\Reset_Win10_Printers.reg Shutdown -r -t 0 -m \\%1 Reset_Win10_Printers.txt 2
gshaw Posted November 23, 2017 Posted November 23, 2017 I'm using gpp user settings to add the printer and I can add printers ok using gpp. It's just the other printers I added using vbs that keep coming back. @Jobos you can turn that off via GPO User Configuration/Policies/Administrative Templates/Control Panel/Printers Turn off Windows default printer management > Enabled
chaunka420 Posted November 23, 2017 Posted November 23, 2017 @Jobos thanks for the response. That's quite a bit of registry modification you've done there. @gshaw I have the policy enabled and the ghost printers were still coming back. The ghosted printers were interfering with my logon script as well. The logon script wouldn't re-map new printers every time, only at every other logon. So I ended up using a Powershell logoff script to unmap all printers. To fix the ghosting of unwanted printers, I made one regedit. After it was applied the ghosted printers would still be visible, but if you removed them from the user profile they would no longer come back. (Without the regkey being deleted they would come back) 1. Create GPP regedit (Computer) : Delete - HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers 2. Add Powershell logoff script (User): Get-WmiObject Win32_Printer | where{$_.Network -eq ‘true‘} | foreach{$_.delete()} 3. Remove ALL mapped printers manually when logged in with the mandatory profile. Logon script or GPP will remap your correct printers at next logon. This part can probably be scripted using the regedit's @Jobos supplied, but I just had library staff do it. This is my fix for now, I know it's not really great but it will suffice for now. PC's are Windows 10 Pro 1703, using Mandatory User Profiles.
Jobos Posted November 23, 2017 Author Posted November 23, 2017 @chaunka420 yes it is rather a lot but found it quicker to remove on mass and re-add but only needs to be done once. @gshaw that policy was already enabled
WBLimburg Posted August 13, 2024 Posted August 13, 2024 @Jobos Is this script still valid for latest stable releases of Windows 10? Kind Regards
Jobos Posted August 13, 2024 Author Posted August 13, 2024 @Jobos Is this script still valid for latest stable releases of Windows 10? Kind Regards I've not needed to use the script to remove printers for years and it was for version 1703 so guess it's not valid now.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now