VBscript & Active Directory and printers ?

Well, since our current solution for mapping printers is an ugly batch file, which needs to be put into Startup, I today poked at doing it in VBscript (I know, but it’s less ugly than the batch script, trust me).

As some of you know, printers are only applicable to users (as in you can’t put a startup script onto an OU, which is going to map the printers). So as we store users and the computes in different OU’s in our Active Directory (we do have about 15.000 students), I can’t apply the printer.vbs to the users OU directly either, unless I implement some intelligence into the script itself.

And that’s basically what I did. Since different pools at the university have different DNS suffixes (like pools.rz.barfoo.org, that our or pools.fmz.barfoo.org) and we only want them students to have our printers when they logon at our pool, I just made the script to get the DNS DomainName of the current active interface and compare it against a given pattern.

One thought to “VBscript & Active Directory and printers ?”

Leave a Reply

Your email address will not be published. Required fields are marked *

I accept that my given data and my IP address is sent to a server in the USA only for the purpose of spam prevention through the Akismet program.More information on Akismet and GDPR.

This site uses Akismet to reduce spam. Learn how your comment data is processed.