Drucker auf mehrere Arbeitsplätze übernehmen
Hi,
Ok.. ich kann mir vorstellen, dass man dieses Problem mit Programmierkenntnissen einfacher lösen könnte. Mal schauen ob es in diesem Forum lösbar ist...
Problem: Der Benutzer soll beim wechseln des Arbeitplatz seine Drucker automatisch gemappt bekommen. Hierfür möchte ich eine Liste der Drucker in eine Datei im Homeverzeichnis des Benutzers kopieren.
Ein zentrales Profil gibt es leider nicht. Ich habe herausgefunden wo sich die gemappten Drucker und vor allem der Standarddrucker des Benutzers in der Registry befinden.
Ein Tool zum Mappen des Druckers habe ich"con2prt.exe /c \\Printserver\Druckerfreigabe", ich brauch ein brauchbares Export von der Registry:
Standarddrucker (Printername = Wert)
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device = \\Printserver\Druckerfreigabe,winspool,Ne00:
Also ohne dieses ",winspool?".
Restliche Drucker (Printername = Schlüsselname)
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\PrinterPorts\\Printserver\Druckerfreigabe
Natürlich sollte der Export nur bei gemappten Druckern sein und nicht bei z.B. PDFMaker oder sowas.![face-smile face-smile](/images/icons/fa/light/face-smile.svg)
Wenn der Kram in einer Datei ist, muss ich nur noch einen Weg finden, die Drucker nacheinander zu importieren. Ich wäre auch dankbar für andere Vorschläge...
Danke für die Aufmerksamkeit, jetzt sind die Helden gefragt
Ok.. ich kann mir vorstellen, dass man dieses Problem mit Programmierkenntnissen einfacher lösen könnte. Mal schauen ob es in diesem Forum lösbar ist...
Problem: Der Benutzer soll beim wechseln des Arbeitplatz seine Drucker automatisch gemappt bekommen. Hierfür möchte ich eine Liste der Drucker in eine Datei im Homeverzeichnis des Benutzers kopieren.
Ein zentrales Profil gibt es leider nicht. Ich habe herausgefunden wo sich die gemappten Drucker und vor allem der Standarddrucker des Benutzers in der Registry befinden.
Ein Tool zum Mappen des Druckers habe ich"con2prt.exe /c \\Printserver\Druckerfreigabe", ich brauch ein brauchbares Export von der Registry:
Standarddrucker (Printername = Wert)
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device = \\Printserver\Druckerfreigabe,winspool,Ne00:
Also ohne dieses ",winspool?".
Restliche Drucker (Printername = Schlüsselname)
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\PrinterPorts\\Printserver\Druckerfreigabe
Natürlich sollte der Export nur bei gemappten Druckern sein und nicht bei z.B. PDFMaker oder sowas.
Wenn der Kram in einer Datei ist, muss ich nur noch einen Weg finden, die Drucker nacheinander zu importieren. Ich wäre auch dankbar für andere Vorschläge...
Danke für die Aufmerksamkeit, jetzt sind die Helden gefragt
Bitte markiere auch die Kommentare, die zur Lösung des Beitrags beigetragen haben
Content-ID: 20792
Url: https://administrator.de/forum/drucker-auf-mehrere-arbeitsplaetze-uebernehmen-20792.html
Ausgedruckt am: 16.02.2025 um 22:02 Uhr
7 Kommentare
Neuester Kommentar
Hi MuriBln,
welche Art Scripte setzt du ein? Batch, VBS?
Anyway, du könntest im Script die Variable %USERNAME% oder das entspr. VBS-Pendant abfragen und dann mit IF oder eleganter mit CASE auswerten.
Mimik:
Eine Liste der Drucker ist dazu nicht nötig, schon gar nicht auf dem Client.
Greetz
gemini
welche Art Scripte setzt du ein? Batch, VBS?
Anyway, du könntest im Script die Variable %USERNAME% oder das entspr. VBS-Pendant abfragen und dann mit IF oder eleganter mit CASE auswerten.
Mimik:
Select Case %USERNAME%
Case "Meier'
Mapping für Meier (printui.dll, con2prt, AddWindowsPrinterConnection etc.)
Case "Huber"
Mapping für Huber
Case ...
Mapping für ...
Case Else
Wenn kein Case zurifft
End Select
Eine Liste der Drucker ist dazu nicht nötig, schon gar nicht auf dem Client.
Greetz
gemini
strLogonServer = "\\Server"
strFilesServer = strLogonServer
strPrintServer = strLogonServer
'
strUNCPrinter1 = strPrintServer & "\KMS_H07_Farblaserdrucker"
' strUNCPrinter2 = strPrintServer & "\KMS_H08_SWLaserdrucker"
' strUNCPrinter3 = strPrintServer & "\KMS_H08_FarbInjektDrucker"
' strUNCPrinter4 = strPrintServer & "\KMS_H06_Klasse_1A"
' strUNCPrinter5 = strPrintServer & "\KMS_H05_Klasse_2A"
' strUNCPrinter6 = strPrintServer & "\KMS_H09_Klasse_3A"
' strUNCPrinter7 = strPrintServer & "\KMS_H09_Klasse_4A"
'
objNetwork.RemovePrinterConnection strUNCPrinter1, bForce, bUpdateProfile
' objNetwork.RemovePrinterConnection strUNCPrinter2, bForce, bUpdateProfile
' objNetwork.RemovePrinterConnection strUNCPrinter3, bForce, bUpdateProfile
' objNetwork.RemovePrinterConnection strUNCPrinter4, bForce, bUpdateProfile
' objNetwork.RemovePrinterConnection strUNCPrinter5, bForce, bUpdateProfile
' objNetwork.RemovePrinterConnection strUNCPrinter6, bForce, bUpdateProfile
' objNetwork.RemovePrinterConnection strUNCPrinter7, bForce, bUpdateProfile
'
Select Case strUserName ' oder strComputer
' **ist eher sinnvoll bei wenigen user oder computer, sonst location
'
Case "4007231053"
strUNCPrinterPath = strUNCPrinter1
Case "Administrator"
strUNCPrinterPath = strUNCPrinter1
'Case Else
' strUNCPrinterPath = strUNCPrinter1
End Select
'
'
objNetwork.AddWindowsPrinterConnection strUNCPrinterPath
objNetwork.SetDefaultPrinter strUNCPrinterPath
ich hoffe dich richtig verstanden zu haben![face-smile face-smile](/images/icons/fa/light/face-smile.svg)
coli
strFilesServer = strLogonServer
strPrintServer = strLogonServer
'
strUNCPrinter1 = strPrintServer & "\KMS_H07_Farblaserdrucker"
' strUNCPrinter2 = strPrintServer & "\KMS_H08_SWLaserdrucker"
' strUNCPrinter3 = strPrintServer & "\KMS_H08_FarbInjektDrucker"
' strUNCPrinter4 = strPrintServer & "\KMS_H06_Klasse_1A"
' strUNCPrinter5 = strPrintServer & "\KMS_H05_Klasse_2A"
' strUNCPrinter6 = strPrintServer & "\KMS_H09_Klasse_3A"
' strUNCPrinter7 = strPrintServer & "\KMS_H09_Klasse_4A"
'
objNetwork.RemovePrinterConnection strUNCPrinter1, bForce, bUpdateProfile
' objNetwork.RemovePrinterConnection strUNCPrinter2, bForce, bUpdateProfile
' objNetwork.RemovePrinterConnection strUNCPrinter3, bForce, bUpdateProfile
' objNetwork.RemovePrinterConnection strUNCPrinter4, bForce, bUpdateProfile
' objNetwork.RemovePrinterConnection strUNCPrinter5, bForce, bUpdateProfile
' objNetwork.RemovePrinterConnection strUNCPrinter6, bForce, bUpdateProfile
' objNetwork.RemovePrinterConnection strUNCPrinter7, bForce, bUpdateProfile
'
Select Case strUserName ' oder strComputer
' **ist eher sinnvoll bei wenigen user oder computer, sonst location
'
Case "4007231053"
strUNCPrinterPath = strUNCPrinter1
Case "Administrator"
strUNCPrinterPath = strUNCPrinter1
'Case Else
' strUNCPrinterPath = strUNCPrinter1
End Select
'
'
objNetwork.AddWindowsPrinterConnection strUNCPrinterPath
objNetwork.SetDefaultPrinter strUNCPrinterPath
ich hoffe dich richtig verstanden zu haben
coli