We are moving all of our printers from one server to another. We have the new server and printers set up. We have a new script that will check a users group membership in 70 or so groups will map associated printer for each group they are in (usually not more than 3 or so).
We want to remove ALL of the mappings associated with the old server. I thought the unmapprinters function would server us well if we just put all of the printers on the new server in the ini (thus removing all of the old mappings).
I am having a difficult time figuring out the EXACT format of the INI file. Could someone advise me as to what it should look like if I want the INI to contain merely the list of print shares or printers that exist on the new server, without regard to OS, uses, groups, and default printers etc. as mentioned in the script comments?
I have seen previous posts (by tjcarst) where a the user used "[PRINTERS]" and numerated each line, but I don't see in the script comments that these are required.
I am not sure I agree. I want to LEAVE the clients new server printers that are already mapped alone. thus I would think those new printers should be in the INI.
You create an INI file with the previous server/printer names and on the otherside of the = sign you put the new server/printer names.
You use the PriMapState() UDF and it goes through and checks the INI against the installed printers and if there is a match it changes the OLD name to the NEW name.
YES!! Very slick. I am having a hard time with the upper part .. specifically HOW each line is split into two parts (old,new). I would think the delimeter is =, but it seems you are using chr(10).
Also, I am not so sure I need the Select part, as I have only one domain.
Also .. I only want users to run this ONCE via our login script, as I am sure it will take a while to check all 70 printers. What is the best way to tag a user so that it only does run one time? a reg value? a 0k text file in their profile?
Okay... I've modified the script some and commented it.
I would let the script run for every logon for like a couple of weeks myself. It only takes less than a second on a 100MB LAN to read the INI file and check the Registry if any of the old ones exist or not.
It will only add a printer connection if the old one is found.
Remember though that Printer NAMES and Printer SHARE NAMES are not the same.
Hopefully whoever setup the printers the first time set the PRINTER NAME and SHARE NAME to the same values so you don't have to mess with it.
Create a PRINTERS.INI file and place it in your NETLOGON share and make sure it replicates to all DC.
It should look something like this with all your printers in the file.
Then either add this to your logon script or create a RESETPRINTERS.KIX script and call it from you Logon script.
Here is what the script should look like. NOTE!! This script has not been tested - it looks correct but may contain errors since it has not been run in a real test. It also has no logging or real error checking for feedback which you may or may not want.
Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Why do you guys need me?
BTW, the UnMapPrinters UDF header fully describes the .iNI file format: Code:
;REMARKS Companion function to MapPrinter at http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=12&t=000109 ; The printer.ini file has the following format: ; [Printer name] = Name of the printer share ; Win2K3 = Name of the printserver(s) for Windows 2003 Server computers ; WinXP = Name of the printserver(s) for Windows XP computers ; Win2K = Name of the printserver(s) for Windows 2K computers ; WinNT = Name of the printserver(s) for Windows NT computers ; GroupInclude = User groups to be included in the printer connection ; CompExplude = Computers to be excluded from the printer connection ; Users = Users to be included in the printer connection ; FullName = Full name of the printer ; Default = Boolean indicating whether this printer will be the default printer ;
However, this UDF is rather old and was part of a login script system. The main purpose was to remove mapped printers from those users that would no longer have access to that printer
Edited by sealeopard (2006-10-1511:11 PM)
_________________________
There are two types of vessels, submarines and targets.