Roman78b
Contributor
Contributor

How to install Printers

I'm struggling to add printers to instant clones computers. We use FS-Logix to save the user state (settings, desktop and so on). The problem is, Printers are saved in the HKEY_Local_Machine, this part is not saved by FS-Logix.

I made a script to add printers by IP-Adress, This works great on physical computers but not on instant clones. This also worked on the older Linked clones.

                cls
                $ip = Read-Host "Bitte IP-Adresse eingeben" 
                $SNMP = New-Object -ComObject olePrn.OleSNMP
                $SNMP.Open($IP, "public")
                $model = $SNMP.Get(".1.3.6.1.2.1.25.3.2.1.3.1")
                $SNMP.Close()
                $inst = "Drucker/Druckertreiber nicht gefunden: $model"
                switch($model) {
                    "Officejet Pro 8100 N811a" { $inst = "HP Officejet Pro 8100"}
                    "HP OfficeJet Pro 8210" { $inst = "HP OfficeJet Pro 8210 PCL 6"}
                    "ECOSYS P3045dn" { $inst = "Kyocera ECOSYS P3045dn KX"}
                    "ECOSYS P2040dn" { $inst = "Kyocera ECOSYS P2040dn KX"}
                    "ECOSYS P2135dn" { $inst = "Kyocera ECOSYS P2135dn KX"}
                    "ECOSYS P4040dn" { $inst = "Kyocera ECOSYS P4040dn KX"} 
                    "ECOSYS P6130cdn" { $inst = "Kyocera ECOSYS P6130cdn KX"}
                    "FS-C5150DN" { $inst = "Kyocera FS-C5150DN KX"}
                    "ECOSYS M6630cidn" { $inst = "Kyocera ECOSYS M6630cidn KX"}
                    "ECOSYS P6230cdn" { $inst = "Kyocera ECOSYS P6230cdn KX"}
                    "ECOSYS P6230cd" { $inst = "Kyocera ECOSYS P6230cdn KX"}
                    "FS-1300D" { $inst = "Kyocera FS-1300D KX"}   
                    "EPSON WF-C5290BA" { $inst = "EPSON WF-C5290BA"}  
                    "EPSON WF-C5790BA" { $inst = "EPSON WF-C5790BA"}  
                    "RICOH AficioSG3110DN" { $inst = "RICOH AficioSG3110DN PCL 6"}           
                    }
                If($inst -like 'Drucker/D*') 
                    {write-host "$inst"
                    Pause}
                    else { 
                    Write-Host "Drucker $inst mit IP $ip wird installiert..."
                    Add-PrinterPort -Name "$ip" -PrinterHostAddress "$ip"
                    Add-PrinterDriver -name "$inst"
                    Add-Printer -name "$inst" -Drivername "$inst" -PortName "$ip"

 

The first part asks the user for the IP-address, the last 3 lines adding the Printer to the machine. (this script took me 2 days, especially the SNMP.Get-Part)

My idea is to add the printer in HKEY_Current_User,  but I cloud not find any information how to add a Printer as Local User.

0 Kudos
0 Replies