Replace printer information on printserver

This topic contains 0 replies, has 1 voice, and was last updated by Profile photo of Forums Archives Forums Archives 5 years, 3 months ago.

  • Author
    Posts
  • #5064

    by Zushakon at 2012-08-31 10:31:59

    Hello,

    I would like to change sharename on one printer on a remote printserver. I know how to extract the data but i dont know how to update this data.

    $koza = gwmi win32_printer -computername server | where-object {$_.sharename -eq "dupa"}
    $koza.sharename = $koza.sharename.replace("dupa","ladnadupa")

    but how to now update this on my printserver ?

    Any help ?

    by DonJ at 2012-08-31 10:40:01

    I'm not sure you could do that via WMI or not – I don't know how, at least. The command-line described at http://www.robvanderwoude.com/2kprintcontrol.php can be used to share a printer – essentially, you'd create a new share name, and either keep or drop the old one. There's some additional information at http://support.microsoft.com/default.as ... -us;189105.

    by Zushakon at 2012-08-31 11:11:57

    Thx for the tip. I searched around a bit more and found a method – "put()"

    Meaning the last line now is just

    $koza.put()

    And it updates all perfetly 🙂

    by DonJ at 2012-08-31 11:21:18

    Ah... sorry, I was confused about what you were asking for. Apologies.

You must be logged in to reply to this topic.