I am having the exact same issue and it's driving me nuts. The AddPrinterConnection line is giving me error 123. The share and printer name are identical (copied and pasted), and I can browse to the share and see the printer.