When installing a printer on Windows 7 or newer the printer installation process hangs. If you manually try to install the printer on the workstation using the Add Printer wizard, you will be prompted with a security prompt asking "Do you trust this printer?".
This error happens when the Point and Print Restrictions group policy requires a warning or elevated prompt to install the printer connection or printer drivers for Vista and newer operating systems. Because of the prompt the printer cannot be installed programmatically as the program is not allowed to interact with the warning or elevated prompt dialogs.
Change the policy to disabled.
Open the Group Policy Management Editor, Computer Configuration, Policies, Administrative Templates, Printers, Point and Print Restrictions, from Not Configured to Disabled.
Change the policy to Enabled
Open the Group Policy Management Editor, Computer Configuration, Policies, Administrative Templates, Printers, Point and Print Restrictions, Enable, check “Users can only point and print to machines in their forest”, set “When installing drivers for a new connection:” to “do not show warning or elevation prompt” and “When updating drivers for an existing connection:” to “Do not show warning or elevation prompt”.