none
Add a printer to a Remote MAchine RRS feed

  • Question

  • does anyone  have a Vbscript that can add a shared printer to a remote machine?
    Wednesday, February 11, 2009 8:29 PM

Answers

  • Check the prnmngr.vbs script, it should be on %windir%\system32 (in XP by default), here's the help text:

    ' Abstract:
    ' prnmngr.vbs - printer script for WMI on Whistler
    '     used to add, delete, and list printers and connections
    '     also for getting and setting the default printer
    '
    ' Usage:
    ' prnmngr [-adxgtl?][c] [-s server][-p printer][-m driver model][-r port]
    '                       [-u user name][-w password]
    '
    ' Examples:
    ' prnmngr -a -p "printer" -m "driver" -r "lpt1:"
    ' prnmngr -d -p "printer" -s server
    ' prnmngr -ac -p "\\server\printer"
    ' prnmngr -d -p "\\server\printer"
    ' prnmngr -x -s server
    ' prnmngr -l -s server
    ' prnmngr -g
    ' prnmngr -t -p "printer"



    Another way would be via logon script:

    Set oNet = CreateObject("WScript.Network")
    oNet.AddWindowsPrinterConnection "\\server\printerName"
    http://blogs.microsoft.co.il/blogs/ScriptFanatic PowerShell Toolbar: http://tinyurl.com/PSToolbar
    • Marked as answer by IamMred Friday, January 8, 2010 8:27 AM
    Thursday, February 12, 2009 1:10 PM
    Moderator
  • You can try the scripts outlined here:

    http://vbsbob.blogspot.com/2008/01/adding-printer-on-remote-computer.html

    Regards,

    Salvador Manaois III
    C|EH MCSE MCSA MCITP|Server/Enterprise Admin
    Bytes & Badz : http://badzmanaois.blogspot.com
    • Marked as answer by IamMred Friday, January 8, 2010 8:27 AM
    Thursday, February 12, 2009 3:47 AM
    Moderator

All replies

  • You can try the scripts outlined here:

    http://vbsbob.blogspot.com/2008/01/adding-printer-on-remote-computer.html

    Regards,

    Salvador Manaois III
    C|EH MCSE MCSA MCITP|Server/Enterprise Admin
    Bytes & Badz : http://badzmanaois.blogspot.com
    • Marked as answer by IamMred Friday, January 8, 2010 8:27 AM
    Thursday, February 12, 2009 3:47 AM
    Moderator
  • Check the prnmngr.vbs script, it should be on %windir%\system32 (in XP by default), here's the help text:

    ' Abstract:
    ' prnmngr.vbs - printer script for WMI on Whistler
    '     used to add, delete, and list printers and connections
    '     also for getting and setting the default printer
    '
    ' Usage:
    ' prnmngr [-adxgtl?][c] [-s server][-p printer][-m driver model][-r port]
    '                       [-u user name][-w password]
    '
    ' Examples:
    ' prnmngr -a -p "printer" -m "driver" -r "lpt1:"
    ' prnmngr -d -p "printer" -s server
    ' prnmngr -ac -p "\\server\printer"
    ' prnmngr -d -p "\\server\printer"
    ' prnmngr -x -s server
    ' prnmngr -l -s server
    ' prnmngr -g
    ' prnmngr -t -p "printer"



    Another way would be via logon script:

    Set oNet = CreateObject("WScript.Network")
    oNet.AddWindowsPrinterConnection "\\server\printerName"
    http://blogs.microsoft.co.il/blogs/ScriptFanatic PowerShell Toolbar: http://tinyurl.com/PSToolbar
    • Marked as answer by IamMred Friday, January 8, 2010 8:27 AM
    Thursday, February 12, 2009 1:10 PM
    Moderator