none
How to create WSD port in Powershell

    Pregunta

  • How do I create a WSD port using Powershell in Win8. I tried using the Add-Printer cmdlet with -DeviceURL parameter but I get the following error:

    Add-Printer : An error occurred while performing the specified operation.  See the error details for more information.
    At line:1 char:1
    + Add-Printer -Name 'Test WSD Printer' -DeviceURL 'ipaddress'
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (MSFT_Printer:ROOT/StandardCimv2/MSFT_Printer) [Add-Printer], CimException
        + FullyQualifiedErrorId : HRESULT 0x8007200f,Add-Printer

    Not sure if the failure is cause the port does not already exist.

    Thanks,

    lunes, 18 de marzo de 2013 20:59

Respuestas

Todas las respuestas

  • totally just guessing on this one, but I wonder if you are missing some parameters such as Portname, etc... technically you could be blocked also somehow, but I don't see how, its just a printer setup.
    I suppose you could also try using alternate credentials type of thing or an admin console and see if that does anything..

    just code, no beer...although that would probably help..

    martes, 19 de marzo de 2013 2:57
  • Hi,

    Just checking in to see if the suggestions were helpful. Please let us know if you would like further assistance.

     

    If you have any feedback on our support, please click here .


    Cataleya Li
    TechNet Community Support

    miércoles, 20 de marzo de 2013 5:34
    Moderador
  • I've still not been able to solve this issue. I ran the command from admin console. Below is the list of parameters for Add-Printer for the WSD port.  In the printmanagement.msc console I can see the printer port and printer object is getting created. But it does not have a given name and also I've no control over which driver is chosen. I'd really like to be able to create the port first, install the driver and then install the printer giving it the port and drivername.

    Parameter Set: wsd Add-Printer [-Name] <String> [-AsJob] [-CimSession <CimSession> ] [-Comment <String> ] [-ComputerName <String> ] [-Datatype <String> ]

    [-DeviceURL <String> ] [-DeviceUUID <String> ] [-KeepPrintedJobs] [-Location <String> ] [-PermissionSDDL <String> ] [-PrintProcessor <String> ]

    [-Priority <UInt32> ] [-Published] [-RenderingMode <RenderingModeEnum> ] [-SeparatorPageFile <String> ] [-Shared] [-ShareName <String> ]

    [-StartTime <UInt32> ] [-ThrottleLimit <Int32> ] [-UntilTime <UInt32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

    miércoles, 20 de marzo de 2013 13:45
  • maybe you could try "Add-PrinterPort", :Add-PrinterDriver", and "Add-Printer" together in a script to achieve the same thing

    Parameter Set: tcp Add-PrinterPort [-Name] <String> [-PrinterHostAddress] <String> [-AsJob] [-CimSession <CimSession> ]

    [-ComputerName <String> ] [-PortNumber <UInt32> ] [-SNMP <UInt32> ] [-SNMPCommunity <String> ] [-ThrottleLimit <Int32> ]

    [-Confirm] [-WhatIf] [ <CommonParameters>]


    just code, no beer...although that would probably help..

    miércoles, 20 de marzo de 2013 22:49
  • Here is something that could also help about a WSD printer in Win Server 2008

    http://pinchii.com/home/2010/09/the-printer-installation-failed-operation-could-not-be-completed-error-0x00000643/
    .

    and here on wsd printer install failed
    .
    http://support.microsoft.com/kb/951449?wa=wsignin1.0


    just code, no beer...although that would probably help..


    • Editado justcode_ca miércoles, 20 de marzo de 2013 23:02
    miércoles, 20 de marzo de 2013 23:01
  • Here also is a WMI directip script from "MrPowerScripts"

    https://github.com/MrPowerScripts/PowerScripts/blob/master/Printers/InstallDirectIPPrinter.ps1

    and here is a youtube link for a video about it..

    http://www.youtube.com/watch?v=E2x6NG72tn4

    I know thats not what you want to do, but maybe its an option to do a direct ip setup for now using the new methods or WMI - whatever works for you


    just code, no beer...although that would probably help..

    miércoles, 20 de marzo de 2013 23:08
  • @justcode_ca: I really appreciate your help with this. I already have the scripts to setup a printer on TCP/IP (I also used the printui.dll, so no issues there).

    I was hoping that a WSD install script would also be easier but so far no luck. Unfortunately when using the WSD parameter set it does not allow to specify the driver, it seems to automatically use the inbox driver. Note that I can manually install the printer to the WSD port without issues and also be able to specify which driver to use.


    • Editado banglr5 jueves, 21 de marzo de 2013 0:08
    jueves, 21 de marzo de 2013 0:04
  • your welcome, I do not have access to or have used a wsd printer setup, so its interesting. Here are some pages ( at end ) on WSD device technical details.

    I wonder if now that you have it installed if you could use something like the "Get-PrinterPort"  to get the port name and then  substitute in in for more details  ie-"Get-PrinterPort -Name LPT1", or the Get-Printer command

    I also wonder if you don't need the DeviceUUID parameter. Maybe you could get that on the printer page or with Get-Printer etc..


    WSD

    http://msdn.microsoft.com/en-us/library/bb204786(VS.85).aspx

    http://msdn.microsoft.com/en-us/library/aa823078(VS.85).aspx
    .

    Fdphost
    You might also want to check out the "function discovery provider host" service tech note here

    http://support.microsoft.com/kb/973560




    just code, no beer...although that would probably help..




    jueves, 21 de marzo de 2013 1:09