Replace printer information on printserver

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 :slight_smile:
by DonJ at 2012-08-31 11:21:18
Ah… sorry, I was confused about what you were asking for. Apologies.