Connecting Remotely to a Windows 10 Computer - Connect Printer Share

Caesar Corinthos 21 Reputation points
2023-05-08T18:41:35.93+00:00

Hi,

I found this utility that seems to work pretty well:

rundll32 printui.dll,PrintUIEntry /c[computername] /il

My only question is, does anyone know if you can use this command to connect a shared printer to a specific profile on a workstation? I found one article which stated the command would connect the shared printer to ALL the profiles on the target machine but that isn't proving out to be true.

My goal is to be able to remotely connect to a workstation and connect a user to a shared printer without using remote desktop or some other desktop control application. Remotely through CMD or PowerShell would be great.

Thanks!

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,948 questions
Windows 10 Network
Windows 10 Network
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Network: A group of devices that communicate either wirelessly or via a physical connection.
2,293 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,219 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 44,046 Reputation points
    2023-05-09T10:57:30.9433333+00:00

    Hello Caesar,

    Thank you for your question and for reaching out with your question today.

    The reason this is not working out for you is that printers are installed per user profile, especially if they are network printers. Running Add-Printer remotely won't usually add the printer to the user logged in (assuming that there is a logged in user) or all of the profiles on the computer.

    I have needed to deploy network printers to groups of users on various networks and I have always used a logon script or group policy.

    On your print server, expand Print Servers > ServerName (local) > Printers, select the printer you want to deploy (HP LaserJet M2727 in our case), right-click on it, and select from the menu Manage Sharing.

    Check the options Share this printer and List in the directory, and then click Apply.

    Right-click on your printer in Print Management snap-in and choose Deploy with Group Policy.

    Now press Browse.

    Using the Domain Browser, you need to locate the OU (organizational unit) on which you want to deploy the printer, and then click Create a New Group Policy Object button.

    Enter the policy name and click Ok. You can assign the created policy to domain users, computers, or both.

    Per User — this setting assumes that a specific printer is connected on a user desktop, regardless of which computer it is logged on. This is useful if you have a VDI, or each user can use different workstations (for example, in a Call center). This policy should not be used if users are distributed across different buildings or office branches. Otherwise, the user will have to take a walk to pick up his documents from the printer;

    Per Computer — no matter which user is working on the computer, it will always print on a specific printer (all users of a computer can access the printer). This printer connection policy is commonly used in large distributed corporate networks.

    Since we have linked policy to OU named Managers with only user’s objects, we need to select The users that this GPO applies to (per user). Press the Add button in order to add your shared printer to the GPO.

    The configuration is now completed, just press Apply.

    If the reply was helpful, please don’t forget to upvote or accept as answer.