Mass printer creation script does nothing on cluster
i'm using following script import csv printers:
function createprinter { $server = $args[0] $print = ([wmiclass]"\\$server\root\cimv2:win32_printer").createinstance() $print.drivername = $args[1] $print.portname = $args[2] $print.shared = $true $print.sharename = $args[3] $print.location = $args[4] $print.comment = $args[5] $print.deviceid = $args[6] write-host "creating printer $printer" -foregroundcolor "green" $print.put() } function createprinterport { $server = $args[0] $port = ([wmiclass]"\\$server\root\cimv2:win32_tcpipprinterport").createinstance() $port.name= $args[1] $port.snmpenabled=$false $port.protocol=1 $port.hostaddress= $args[2] write-host "creating port $port" -foregroundcolor "green" $port.put() } $printers = import-csv f:\import.csv foreach ($printer in $printers) { createprinterport $printer.printserver $printer.portname $printer.ipaddress createprinter $printer.printserver $printer.driver $printer.portname $printer.sharename $printer.location $printer.comment $printer.printername }
i don't errors, no new ports or printers appear on server.
we run service cluster on vmware 4.0 infrastructure 2 nodes, csv file points print service name.
could there issue csv? i'd expect sort of error if so. haven't touched windows environment in 3 years i'm not doing correctly. i'm running windows7 desktop server, i'm missing sort of remote session need setup.
nope, you�??ll need find different solution.
based on wants unc path of virtual name or cluster manager. there command line tool clusters might allow this.
as far unc there way automate you�??ll need dig bit.
also found this
Windows Server > Windows PowerShell
Comments
Post a Comment