none
Install printer on remote PC from a script

    Question

  • We are currently looking for a way to remotely install printers on a PC as a non-admin.  What we are trying to do is give our Level 1 help desk this ability.  Currently we map our printers as a local printer to a network port so it will be available to all profiles.  Is this possible?  Anyone know of a way to go about this either by script or third party utility?
    "You can't fix stupid!"
    Tuesday, April 05, 2011 3:25 PM

Answers

  • I did find a script to get this to work.  Works with a network printer so this is all I need.  Here is the code

     

    @echo off 

    echo This will install a printer across profiles on a remote computer 

    rem \\PrintServerName\printerName 

    set /p printer= What is the printer name? Include the back slashes and the print server. 

    rem \\ComputerName 

    set /p computer= What is the computer name? Include the back slashes or leave blank to run on local machine  

     

    rundll32 printui.dll,PrintUIEntry /ga /c%computer% /n%printer% 

    start /wait sc %computer% stop spooler 

    start /wait sc %computer% start spooler 

    rem make the printer default 

    rem rundll32 printui.dll,PrintUIEntry /y /n %printer%

     

    echo Printer install complete 

    pause 

    @echo on

     

     

    I rem'd out the part to make it a default printer.  That seemed to fail more than work for me


    "You can't fix stupid!"
    • Marked as answer by Jason_King313 Thursday, April 07, 2011 12:39 PM
    Thursday, April 07, 2011 12:39 PM

All replies

  • This may help you decide the permission level you would like to assign.  I think you can add your level1 support group to the 'Load and Unload Device Drivers' group policy setting as described:-

    http://support.microsoft.com/default.aspx?scid=kb;en-us;297780

    In addition, I would probably recommend the following script for adding machine-level printers remotely, you don't need to map network printers to a port this way either.  I use it all of the time, it is so much easier this way:-

    http://support.microsoft.com/kb/314486


    Alan Moseley
    Tuesday, April 05, 2011 6:11 PM
  • Hi,

    How's going?

    Please feel free to give us any udpate.

    Regards,

    Miya

    TechNet Subscriber Support in forum. If you have any feedback on our support, please contact tngfb@microsoft.com


    This posting is provided "AS IS" with no warranties, and confers no rights. | Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Thursday, April 07, 2011 7:18 AM
  • I did find a script to get this to work.  Works with a network printer so this is all I need.  Here is the code

     

    @echo off 

    echo This will install a printer across profiles on a remote computer 

    rem \\PrintServerName\printerName 

    set /p printer= What is the printer name? Include the back slashes and the print server. 

    rem \\ComputerName 

    set /p computer= What is the computer name? Include the back slashes or leave blank to run on local machine  

     

    rundll32 printui.dll,PrintUIEntry /ga /c%computer% /n%printer% 

    start /wait sc %computer% stop spooler 

    start /wait sc %computer% start spooler 

    rem make the printer default 

    rem rundll32 printui.dll,PrintUIEntry /y /n %printer%

     

    echo Printer install complete 

    pause 

    @echo on

     

     

    I rem'd out the part to make it a default printer.  That seemed to fail more than work for me


    "You can't fix stupid!"
    • Marked as answer by Jason_King313 Thursday, April 07, 2011 12:39 PM
    Thursday, April 07, 2011 12:39 PM
  • For me, prnadmin.dll is still the way to go.  Only works with 32-bit wscript.exe:

    http://support.microsoft.com/kb/321025

     

    Thursday, April 07, 2011 9:11 PM