X Connect to Printer
To reduce the number of GPOs and increase efficiency I recently switched from deploying printers through a user-based (per department) GPO to deploying them from a computer-based (all workstations) GPO.
Shortly afterwards XenDesktops with Windows 7 had the printers, but they were faded out and "offline". The event log showed Print Service Event 513:
Group Policy was unable to add per computer connection "Printer". Error code 0x6xba. This can occur if the name of the printer connection is incorrect, or the print spooler cannot contact the print server.
Attempting to add printers manually produces a vague "Windows cannot connect to the printer." error with error code 0x00000002.
The issue was present with VDA 7.1, 7.6, and 7.8 so upgrading the VDA didn't fix it.
The temporary work around was to stop the Citrix Print Manager service, restart the Print Spooler service, and then we were able to add the printers manually, but this has to be repeated every time a reboot occured.
(Note: Restarting the print spooler also restarts the Citrix Print Mgmt. service, however this doesn't produce the desired result. The Citrix Print Manager service has to be stopped first, then the Print Spooler service has to be restarted.)
I have not seen the issue on Windows 8.1 or 10.
I was told later from Citrix Support that "GPOs are not recommended for deploying printers to VDAs. Only Citrix Policies should be used to deploy printers."
It's not enough to just remove the computer-based GPO.
Verify that the computer-based GPO is not applied to the master image, or exclude the master image from the GPO if needed and verify that it is not applied.
Open Print Management on the master image and select All Drivers in the left side navigation.
Right click, Remove Driver Package, and delete all print drivers except the 2 default Microsoft Drivers, the 2 default Citrix drivers, and any PDF printers.
If the print spooler has the driver locked…
Open Services. Stop the Citrix Print Manager service.
Right click the driver, Remove Driver Package, then leave it on the screen where you have the option to Delete the driver.
Restart the Print Spooler service. Wait for it to stop, and while it is starting up delete the driver. It's tricky to time it right and it may have to be done several times before it works.
Restart and verify that printers can now be added without having to mess with any services. Optionally, manually add the printers to install the drivers now.
At this point either switch back to user-based GPO printer deployment, or from the DDC under Policy, use the Citrix Policy called Session Printers to deploy printers. The Citrix policy is essentially a user-based GPO, however the assignments make it easier to deploy to delivery groups instead of OUs.
Once the policy has been set up you must open a command prompt on the DDC and run gpupdate /force to push the changes to the VDAs.