I Need To Make A Change With My IT Support! Call (225) 706-8414

Sharing a Remote Windows Printer from the Command Line

You need to share a printer physically attached to a remote machine and want to do this remotely from the command-line.

Solution

We’ll be using pstools, rundll, and WMIC to do this.

  1. Download the PsTools suite and extract
  2. Open a CMD window and change directory to the extracted PsTools location
  3. Start a CMD session on the remote machine using psexec:
    > psexec \remote-machine cmd
  4. After connecting, list the printers available on the machine:
    > wmic printer get name
    Name
    printer1
    printer2
    \servernameprinter3
  5. If you want to make printer1above shared:
    > rundll32 printui.dll,PrintUIEntry /Xs /n "printer1" Sharename "Printer1"
    > rundll32 printui.dll,PrintUIEntry /q /Xs /n "printer1" Attributes Shared
  6. Confirm the printer is available by going to \remote-machine in Windows Explorer; you should see the printer available now.

 

Concerned About Cyber Attacks?

CLICK HERE >

Want to Migrate to the Cloud?

CLICK HERE >
Office 365

Ready to Experience Microsoft Office 365?

Want the latest IT news directly in your inbox? Subscribe now!