Hey again,
i was wondering if you encountered some issues regarding the usage of Add-printer command in sps2016.
im getting strange behavior when using it.
basically this is the line im running from a wizard form template:
Add-Printer -Name "$($labelPrinterNameCustom.Text)" -DriverName "$($comboboxPrinterDriver.Text)" -PortName "$($labelPortNameCustom.Text)" -Comment "$($textboxPrinterComment.Text)" -Location "$($textboxPrinterLocation.Text)" -Shared -Published -RenderingMode SSR
even if i replace all the vars with text i get the same error.
Here is the error:
ERROR: Add-Printer : An error occurred while performing the specified operation. See the error details for more information.
NewPrinterWizard_v0.psf (751, 3): ERROR: At Line: 751 char: 3
ERROR: + Add-Printer -Name "$($labelPrinterNameCustom.Text)" -Driv ...
ERROR: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ERROR: + CategoryInfo : NotSpecified: (MSFT_Printer:ROOT/StandardCimv2/MSFT_Printer) [Add-Printer], CimException
ERROR: + FullyQualifiedErrorId : HRESULT 0x80070bce,Add-Printer
but it doesnt happen every time - sometimes it does create the printer (???). i tried running the SPS2016 as admin and marked the enabled elevation (even though microsoft states there is no need for that when using add-printer)
maybe im using wrong call for variables? you guys had some issues with add-printer?
thanks again for all the time and help!
Sean.