Some printer manufacturers want to “own the world.” A printer only really requires a driver to be installed, but HP has set it up so, especially with multifunction printers, they want to add a printer monitor (so they can advertise their toner/ink when you run low), request your e-mail address for mailing lists by getting you to “register” your product, etc…
However, these functions do not work on a Windows Server, so in order to set up a printer, so you can print from a terminal server, you can not use their installer to do this. Instead, you will need to manually unpack their grossly sized “installer” (hundreds of megabytes), then manually perform the install. Their installer is actually a self-decompressing zip file which automatically runs the installer contained within.
Following are the steps, as of 2019, for doing this install. This is taken from https://support.hp.com/rs-en/document/c03351547
msiexec.exe /i OJ774x64.msi ENTERPRISE=YES FAX=NO SCANTOPC=NO REBOOT=ReallySuppress
Wait until the installer is complete, then change into the directory the software has been installed into. In this case, PRINTER MODEL is a subdirectory of HP which corresponds to the printer model. We are going to add this as a network printer, with IP address 192.168.1.5, so change that to whatever is real for your system.
c: cd \Program Files\HP\PRINTER MODEL\Bin DeviceSetup.exe /networkaddress 192.168.1.5
This will silently install your printer. After a few minutes, you can open the Printers folder and you will see it there.