none
LOGON SCRIPT TO ADD PRINTER WITH IF STATEMENT

    Question

  • Hi,

    I'm new to the server game so please excuse me if I am not so clear with my question.

    I want to create a logon script in windows server 2008, that will add a printer to a profile, only if the current profile does not have the printer already installed on logon. Is this possible?

    My reason for asking is if I have a basic logon scripts that adds a particular printer every time on logon, when a user sets the particular printer up to meet their individual preferences, when they next log on they will lose the preferences as the logon script will install the default.

    Tuesday, January 10, 2017 2:49 PM

All replies

  • Hi,

    >>I want to create a logon script in windows server 2008, that will add a printer to a profile, only if the current profile does not have the printer already installed on logon. Is this possible?

    Yes, you could!

    My suggestion is: using GPO.

    Create a new OU with these no printer's users in it, apply a new printer gpo under it.

    You only need to filter these users out who has already installed printer.

    How to filter?->open the related GPO, export the settings to some html or xml files, checking it applied to which users.

    Best regards,

    Andy


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Wednesday, January 11, 2017 4:01 AM
    Moderator
  • Hi Andy,

    Thanks for your reply, how can I tell what users have printers installed when checking the html or xml files?

    Thursday, January 12, 2017 4:04 PM
  • To list the printers, you can use Powershell as described here: http://superuser.com/questions/135393/list-printers-from-command-line-to-text-file

    To enforce the installation of a printer, you can use a GPO. To remove any printer which is not set by GPO at logon, you can think about having a logon script which will remove all the printers.


    This posting is provided AS IS with no warranties or guarantees , and confers no rights.

    Ahmed MALEK

    My Website Link

    My Linkedin Profile

    My MVP Profile

    Thursday, January 12, 2017 10:37 PM