Powershell script for adding one or more network printers.

MS006 1 Reputation point
2021-12-16T21:39:14.35+00:00

I am trying to add one or more network printers to intune managed devices. I have printers shared using print server. It works perfectly with group policy but for intune, when I use script below it does not add printers for most users. Is there a better script for network printer mapping.

Add-Printer -ConnectionName "\printsrv\PRINTER 01"
Add-Printer -ConnectionName "\printsrv\PRINTER 02"

Windows for business Windows Server User experience Print jobs
Windows for business Windows Server User experience PowerShell
Microsoft Security Intune Other
0 comments No comments
{count} votes

5 answers

Sort by: Most helpful
  1. Limitless Technology 39,916 Reputation points
    2021-12-17T15:53:39.83+00:00

    Hello @MS006

    By default, Windows doesn’t trust printer drivers. There are actually two policies you need to define and one of them currently doesn’t appear in the administrative templates available to us in Intune. So you can use the Powershell commands to network printers to Intune managed devices.

    Here is a forum to help you out with this issue.
    https://learn.microsoft.com/en-us/answers/questions/582891/installing-local-network-printer-to-group-of-lapto.html

    Hope this resolves your Query!!

    --If the reply is helpful, please Upvote and Accept it as an answer--

    1 person found this answer helpful.
    0 comments No comments

  2. Rahul Jindal [MVP] 10,911 Reputation points MVP
    2021-12-18T07:54:38.607+00:00

    I wrote a blog on different ways of configuring printers.
    intune-configure-printers-for-non.html

    1 person found this answer helpful.

  3. Rahul Jindal [MVP] 10,911 Reputation points MVP
    2021-12-16T22:46:05.297+00:00

    Have you tried device restriction policy for adding network printers?

    0 comments No comments

  4. Lu Dai-MSFT 28,496 Reputation points
    2021-12-17T06:20:17.68+00:00

    @MS006 Thanks for posting in our Q&A. From your description, did you mean that you deploy the PowerShell script via intune and it doesn't work on the device? If there is anything misunderstanding, please correct me.

    To clarify this issue, we appreciate your help to collect some information:

    1. Is it successfully when you run the Powershell script on the device manually?
    2. Please check if the status of the Powershell script shows "succeeded" in intune portal.
    3. As RahulJindal-2267 said, please check if there is a setting "Add new printers" is configured to "block" in a device restriction profile.
      158397-image.png

    If there is anything update, feel free to let us know.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  5. MS006 1 Reputation point
    2021-12-21T17:00:28.94+00:00

    Hi...

    Sorry for the delayed response.

    @Rahul Jindal [MVP] Yes, I tried device restriction to add network shared printer. Status will show 'success' in the portal but it will never get added to the device.

    @Lu Dai-MSFT Yes, when I manually run the command in 'users context' it gets added to the device. When we deploy the same script via intune not add devices gets the device (Some gets, some not). These devices are having same policies so not sure what makes some devices get it while some are not.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.