Announcement

Collapse
No announcement yet.

Deploying Printer - Client Printer Removal (Access is Denied)

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Deploying Printer - Client Printer Removal (Access is Denied)

    Hello i have created a GPO script that deploys printers to client machines all went well. I then modified the script to delete a specific
    printer from the users i created. So if they log in that specific printer gets deleted when user logs in but i keep getting this message when i log in with any of my created users. I'm using windows server 2012r2. Any ideas?
    Attached Files
    Last edited by Jtek; 30th October 2017, 22:05.

  • #2
    Are you trying to remove it from the User or Computer in the GPO? Remember that the User can install a printer so it stands that it can remove them either. I assume you are not actually running a script to install the printers but the GPO tool.
    1 1 was a racehorse.
    2 2 was 1 2.
    1 1 1 1 race 1 day,
    2 2 1 1 2

    Comment


    • #3
      Originally posted by biggles77 View Post
      Are you trying to remove it from the User or Computer in the GPO? Remember that the User can install a printer so it stands that it can remove them either. I assume you are not actually running a script to install the printers but the GPO tool.
      I'm trying to remove it from the computer so when a user logs in the printer will be deleted. I am using a script to add printers through GPO but i want to modify the script to remove that specific printer from the user.

      Comment


      • #4
        Ok, now somewhere on the Forums there is a script that will do that. I will have a look for it and post the link back here when I find it.

        Just a curiosity question, why are you using a script when you can add the printers using a plain old standard GPO?

        Shit, found it real quick. Read the whole post as it may explain why you are not able to delete some printers. I had the same problem but the genius REMS was able to explain and resolve my issue. If you add both removal scripts to your script then you will likely not have a delete printer problem.
        https://www.petri.com/forums/forum/w...etting-default

        Also, run the script under Computer and NOT User or it won't work.
        Last edited by biggles77; 2nd November 2017, 03:26.
        1 1 was a racehorse.
        2 2 was 1 2.
        1 1 1 1 race 1 day,
        2 2 1 1 2

        Comment


        • #5
          Originally posted by biggles77 View Post
          Ok, now somewhere on the Forums there is a script that will do that. I will have a look for it and post the link back here when I find it.

          Just a curiosity question, why are you using a script when you can add the printers using a plain old standard GPO?

          Shit, found it real quick. Read the whole post as it may explain why you are not able to delete some printers. I had the same problem but the genius REMS was able to explain and resolve my issue. If you add both removal scripts to your script then you will likely not have a delete printer problem.
          https://www.petri.com/forums/forum/w...etting-default

          Also, run the script under Computer and NOT User or it won't work.

          I manged to figure it out this is what i used...

          reg query HKCU\Printers\Connections |find "Printer-name" && goto delete

          :delete
          rundll32 printui.dll,PrintUIEntry /dn /q /n"\\Server-name\Printer-name"

          Comment

          Working...
          X