Jump to content

Recommended Posts

Posted (edited)

Hi everybody.

 

I am sure by now we have all seen the exact same old boring print script a thousand times.

You create a set of groups sharing the same name as your printers and add your machines to those groups.

 

How ever, I felt that this basic boring print script was actually sub standard and that as a programmer I could whip up something with a lot more functionality.

So with out further delay I present to you my Over Complicated Printer Logon script lets begin with a break down of how this print script is superior

 

 

  • Logging: The ability to create a text log of what the print script is doing, perfect for debugging those irritating issues.
  • Recursive Groups: When searching for printer groups, say if my machine is a member of a sub group or a sub sub sub group with a printer then it still gets the printer.
  • Multiple Servers: Why map printers on 1 print server, when you can map printers on all your print servers.
  • Exclusion Group: You can add a group that prevents the print script from making any changes to the computers printers.
  • OU Group Printers: You can define a group using a named prefix in an ou container, any machine in this ou will search that group for printer groups too.
  • Follow Me Printers: Not only can you define print groups by machine and ou but it will also search the logged in user for printer groups.
  • Easy to understand config section built into the script, this is the one part you are allowed to change.
    • Print Servers
    • Group name to prevent printer changes
    • Print group name prefix
    • Delete local printers, yes or no
    • Enable ou printer groups
    • Prefix name of ou printer groups
    • File path for logging (supports %USER% and %COMPUTER%).

 

I do apologise, I am the absolute worst at explaining things, but if you have any questions just drop em below and i shall do my best to reply with an answer.

 

Printer Script:

Click here for the Gist on Github.

Please keep note of the version number in the top comment as this will be used to track changes.

 

The bar for printer scripts has now been raised!

 

Thank you and Enjoy!

 

- - - Updated - - -

 

Reserved for change log.

Edited by adm_cg
  • Thanks 2
  • 4 months later...
Posted
Can I ask what are the benefits of adding printers via a logon script vs GPP? We scrapped our printer logon script as it was exactly this, too complicated. I have found deploying via Group Policy is a lot simpler, and allows to do all of what is listed in the script features.
Posted

I work on a site with a at least 50 different printers dotted around the building, using GPO to handle and manage that volume of printers is an absolute night mare.

Especially when it comes to targeting printers to a specific machine or set of machines, whilst having a printer deployed to all members of an machine OU group is impractical (due to security or confidentiality concerns).

The print script simply allows you to make a shared printer on a print server, whilst creating an AD Security Group of the same name for instant deployment. No editing or waiting for Group Policy to update, just add machines to the group and away you go.

 

Whilst making it easier to deploy printers out to individual machines, up until now they have been lacking a lot of functionality that GPO provides such as targeting users and OU groups instead of just machines.

Hence I set to work, making a print script that has all the extra desired features that I would of otherwise had to of spent hours in GPO setting up or would have had to have purchased professional software to handle.

As with today's update, as I encounter limitations such as the local USB card printer for 1 machine being the default and confusing users, I will improve the script with additional functionality.

 

Hope that answers the question.

Posted (edited)

Especially when it comes to targeting printers to a specific machine or set of machines, whilst having a printer deployed to all members of an machine OU group is impractical (due to security or confidentiality concerns).

The print script simply allows you to make a shared printer on a print server, whilst creating an AD Security Group of the same name for instant deployment. No editing or waiting for Group Policy to update, just add machines to the group and away you go.

 

Whilst making it easier to deploy printers out to individual machines, up until now they have been lacking a lot of functionality that GPO provides such as targeting users and OU groups instead of just machines.

 

I’m sorry I still fail to see the benefits. Most of the sites I manage now how follow me print setup but the most complicated site I have 2 x print managed service as well as 80 printers dotted around the site (don’t ask it’s been inherited and already I’m looking to consolidate the manage service and reduce the printer to a max of 10 but have these annoying ppl called management standing in my way) however in the interim I use a single GPO with ILT on OUs, security groups, specific users and specific computers and computer groups depending on the printer and never had any issues. Someone wants a printer I either security group assign or most complicated add a line in the ILT of the printer in question

 

The thing with scripting it can get dated very quickly eg. Move a computer etc or a user leaves. Rather then edit the specific line it get added to the bottom of the script. The script get bigger, syntax errors start creeping in and contradicting statements. It all then becomes a minefield to diagnose.

 

Batch scripting was the simpler of scripting languages and still was a nightmare which practically made everyone jump to GPP when it became available. I wouldn’t want to login script printers via powershell or vbs. that would be idea of hell.

 

Another question would be who would managed this script? Something so simple that a first liner could achieve using GPP, your script is bespoke and made it so even a second or third liner would have to depict your script to simply add a printer to a new user or group.

 

But good luck to you if you go on to proceed.

Edited by dapaulio
Posted
I'm with @dapaulio As much as the script may work, you mention one of the reasons to use this script is the lack of targeting users and OU groups. This is definitely achievable via GPO, I know this as I've got it setup. We have all our network printers deployed via one GPO, then each printer is deployed dependant on a specific user, security group, computer name(s), OU, etc. You can have AND and OR variables for membership which really helps with deployment. Again, your script may work how you want it to, however I find managing deployment through a nice clean interface of Group Policy much easier to manage than via a script. Each to their own I suppose.
Posted
Have you tried looking at a managed print service? We're finally moving to one and we're going to have a single follow-me print queue which will be deployed by GPO. Nice and simple :)
Posted

Sorry one of the questions I first should have asked is what is your domain functional level and what os are your dc’s.

As a few of us have now said what you are looking to achieve is possible and is simpler if your server are ... now I’m not 100% on this but Item level targeting (ILT) in group policy was introduced with a domain functional level of 2008 r2. Iv seen some network have 2008 and 2012 servers but still running a DFL of 2000

 

There were a number of improvements also in later versions of server os but these features will not be utilised if you haven’t raised your DFL.

Posted

Forgive me guys the point of this thread is not to force or convince users to move to this as a solution, this is for those sites that are all ready using a print script system and would do not have the money available to purchase a managed system.

Since the MS api for vb script and login scripts is not changing no editing of this script is ever required since everything is managed by AD groups, memberships and shared printers. The script just ties them all together autonomously, plus i am here to try and help people who gets confused.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...