Setting default printer remotely

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Don Jones Don Jones 4 months, 3 weeks ago.

  • Author
    Posts
  • #65322
    Profile photo of Andrew Herbert
    Andrew Herbert
    Participant

    I'm attempting to use PowerShell to set a default printer in Windows 2012 R2. This works fine every time whenever I do it locally, however regardless of how I attempt to run it remotely, which I need to do, it always fails with the below error. I've tried this with the Domain Administrator account as well as the user's credentials who I need to change the default printer for, but it always fails with the following error:

    Exception calling "SetDefaultPrinter" : "Not supported "
    At line:1 char:1
    + $Printer.SetDefaultPrinter()
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : WMIMethodException

    Working code when run locally

  • #65389
    Profile photo of Don Jones
    Don Jones
    Keymaster

    Can you show the code you're running?

You must be logged in to reply to this topic.