Deploying Printer – Client Printer Removal (Access is Denied)

Home Forums Server Operating Systems Windows Server 2012 / 2012 R2 Deploying Printer – Client Printer Removal (Access is Denied)

This topic contains 4 replies, has 3 voices, and was last updated by  ammelsayed 1 year, 1 month ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts

  • Jtek
    Member
    #167276

    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?


    biggles77
    Spectator
    #214338

    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.


    ammelsayed
    Member
    #391895
    biggles77;n514716 wrote:
    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.


    biggles77
    Spectator
    #214343

    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:bowdown: REMS :bowdown: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.


    ammelsayed
    Member
    #391896
    biggles77;n514758 wrote:
    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:bowdown: REMS :bowdown: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 HKCUPrintersConnections |find “Printer-name” && goto delete

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

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.