We have 4 network printers in 1 location. I want to make sure that certain computers always have certain printers set as default no matter who logs on. How can this be done by logon script? My ideal way would be to add certain computers to an active directory group and then have a user logon script run which would set the default printer based on the computers group membership.
This conversation is currently closed to new comments.
Might be the simplest solution if you plan to have all the users in the same OU. If you plan to use sub-OU's, you could do it via GPO.
If you wanted to get truly fancy, you could do it via GPO and filter it by security group, but this will increase the GPO processing time on the end systems. This might or might not be an issue depending on the size of your environment and speed of the links between Active Directory sites.
This answer is user based. I need a PC based solution so that when any domain member logs on to a particular computer, it's default printer will be the one it is supposed to be without anyone having to manually set it.
This answer is user based. I need a solution that is PC based so that when any domain member logs on to a particular computer, it's default printer will be the one it is supposed to be without anyone having to manually set it.
On the OU containing the computers place a GPO with the logon printer script in the User Configuration section of the OU. That way anyone who uses the machine gets the machine default printer through a log on script (net use or Object.AddWindowsPrinterConnection). You can modify which machines this applies to by defining a group in the GPO scope. This works as long as you keep an eye on enforced user-based GPOs which will override it.
I have tried that without success. I created a gpo with the user logon script defined. I then turned on loop back processing so that the user logon script will run when any user logs on to the PCs listed in the OU. In the security filter of the GPO, I removed authenticated users (so that it won't run on every pc in the ou) and then specified only the PCs in the OU I wanted the logon script to run. It didn't work. It does work if I specify user accounts or user groups in the GPO security filter but not computer accounts or computer groups. Am I missing something?
You are correct. You can use a logon script that queries LDAP/Active directory for group membership, then installs or sets a printer as default based on that membership It can work based on the user "objuser" or the computer "objcomputer" See this link http://tinyurl.com/4zzvq He has written and shared a lot of good scripts Within this script "Logon #3" Replace the "front office" with the name of the global group you create. that contains the computer objects you want to control
If IsMember(objComputer, "Front Office") Then objNetwork.AddWindowsPrinterConnection "\\PrintServer\HPLaser2" objNetwork.SetDefaultPrinter "\\PrintServer\HPLaser2" End If
I use this method to install and set default printers based on both user group and computer group membership and it works well.
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
Default Printer Mappings by location or PC name