Adaptable to printer deployment (2)

Source: Internet
Author: User

Continued: Suitable for printer deployment (1)

Details:

The management of printer deployment is mainly based on files. The following describes how to useComputer Group,Printer listAndPrinter configuration informationTo describe the internal management status of the enterprise and understand the definition of these files, is a key step to determine the successful use of this script.

ManagementComputer Group

In reality, computer functions can be described in groups, just like managing computers and users in LDAP and having the same functions/purposes, or users with the same management background are divided into the same group. Similarly, the management of printers is also done in groups. Computers in a printer group have the same printer configuration, and computers with different print configurations are divided into different groups.

The script uses the default file nameGroups. iniTo describe the computer group, the file format is very simple, a line represents the definition of a computer group, the first is the group name, followed by the computer name, they use ASCII code comma "," separate; # The user comments a line, which must start at the beginning of each line; empty lines are ignored.

OneGroups. iniFile example:

# --------------------------------------------------# File Name: Groups.ini# Porpose: This is the group list file.#     Please modifythis file every time computer group#     is changed ornew computer arrived or old computer#     isdicommissioned.# Format:#     Group andcomputername separated by comma ",".# Created: Aug 20, 2008 Tony Liu# --------------------------------------------------Office, W857-1283Office, W999-002Office, W999-003Office, W999-004Lib, W218-732Mobile, W218-642Mobile, w218-645

ManagementPrinter list

As mentioned above, each group of computers has the same printer installed. We use a file to define all the printers to be installed in a group. The group name of each computer is defined above. Each group has a group name. We use the group name of each group as the file name, for example, there are three groups: office, Lib, and mobile, we define a printer list for each group.

The printer list is simpler. Each printer name occupies one line. The first printer is the default printer. # The symbol user comments a line, which must start at each line. Empty lines are ignored.

The following is an example of a lib group:

#-----------------------------------------# Lib group printer list.#-----------------------------------------P218LIB3P218LIB2(Color)P218BAS1P218WRM1

 

The following is an example of an office group:

#-----------------------------------------# Office group printer list.#-----------------------------------------P218OFF1P218LIB2(Color)P218LIB3

Based on the introduction of the above two sections, we have a printer management method profile, which groups computers with the same printer configuration and stores the list in groups. in the INI file, create a printer list file for each group, which lists the printers to be installed in this group.

In fact, you can also use the location information of the computer in the LDAP service to group each computer and enter the group name in the location field. Because the implementation of each system is different, the LDAP description is different. This function is available in the script, but you need to modify the LDAP string according to your network configuration environment.

 

ConfigurationPrinter configuration information

Finally, I came here to talk about the group, the printer list, and the specific description of the printer? For example, the printer driver, printer IP address, and so on.

The specific description of each printer is defined in the printer configuration information printerconfig. ini file. Each line defines a printer. Each line consists of fields in a predefined order. Each field is separated by a comma (,). optional fields can be blank, but separators cannot be omitted, the leading and trailing spaces and tabs of each field are ignored. # The symbol is used to annotate a line, which must start at the beginning of each line. Empty lines are ignored.

The order of each field is defined as follows:

1. System Platform definition: x32 defines that the printer configuration is used by a 32-bit system, and x64 is used by a 64-bit system.

2. Printer name: printer name, which corresponds to the printer name listed in the printer list file.

3. IP Address: the IP address of the printer. You can also use the DNS name.

4. inf file: This defines the location of the printer driver and the printer description inf file it uses.

5. printer model: the driver name of the printer. The previous "Preparation" section describes how to find it.

6. Location: to help you find the printer, you can define the "location" information for each installed printer. This is an optional field.

7. Note: This is also an optional field. The administrator can add additional notes, such as color printing and double-sided printing.

8. Forbidden User Group: This field is optional and is used to restrict users in a group to access the printer. (This function can be extended to more and more flexible syntaxes in the future to adapt to more complex environments .)

For the system platform definition field, the administrator can define different printer names to distinguish between 64-bit and 32-bit systems. The problem is that different printer names are required and must be distinguished manually. With this field definition, a 32-bit or 64-bit system can be defined using the same printer name for ease of management and user use. Remember, each printer must have a 32-bit and 64-bit print driver.

The following is an example:

#--------------------------------------------------------------------------------------------# File Name: PrinterConfig.ini# Purpose:#     This is theprinters Configuration file, Please modify this file whenever a printer is#     changed, suchlike, location moved, model changed, decommissioned, IP changed and etc.## Format:#     Each linedefines only one printer information. It includes:#       PrinterName,IP,DriverInfFile,PrinterModel,Location, Comment, DenyGroup#     Each field isseparated by a comma ",".#     The maximumnumber of printers is 500. #     Linesstarting with # are comments.##     Specificationof each field:#         OSPlatform: “x32” is for x86 system, “x64” for x64 system.#       PrinterName:#            Theprinter name shows in the Printers and Faxes list in XP.#        IP:#            Avalid IP address. if IP=0.0.0.0 then use PrinterName as IP, the PrinterName#            mustbe defined in DNS.#        Driver'sInf File:#            Theprinter INF file UNC name, it must be in the driver path.#            Ifthis field="" then system will not install any driver, it assumesdriver#            whichis defined in DriverName field is system defned model.#        PrinterModel:#            Theprinter driver name for this printer.#        Locations:#           Optional, it shows the printer location in the printer Property'sLocation field.#        Comment:#           Optional, it shows the printer comment in the printer Property'sComments field.#        DenyGroup:#           Optional, if this printer won't be accessed by studentput the studentsgroup#           SID(not group name) here, otherwise leave it blank.#            Usepsgetsid utility to fetch a user group SID, for example:#               PsGetSid cbeedu\110-students_G## Created: Aug 20, 2008 Tony Liu# Modified:#     Aug 28, 2008Tony Liu: Added IP=0.0.0.0#     Dec 04, 2010Tony Liu: Reorganizing comments.#     dec 07, 2010Tony Liu: Redefined printer information fields.#     dec 16, 2010Tony Liu: Added DenyGroup option.#     May 31, 2012Tony Liu: Support OS Platform#--------------------------------------------------------------------------------------------# ---------------------x32----------------------------x32, P374OFF2, 10.23.130.22,  .\Driver\HPUPDPCL6_x86\hpcu118c.inf, HPUniversal Printing PCL 6, Main Office, For Office Staff, S-1-5-21-73586283-606747145-725345543-105551x32, P374CPY1, 10.23.130.13,  .\Driver\KyoceraPCL6_x86\OEMsetup.inf,Kyocera Classic Universaldriver PCL6, Workroom, Kyocera MFP,x32, P374RM1, 10.23.130.11,.\Driver\HPUPDPCL6_x86\hpcu118c.inf, HP Universal Printing PCL 6, room 1, ForAll students and staff,x32, P374UP1, 10.23.130.21,.\Driver\HPUPDPCL6_x86\hpcu118c.inf, HP Universal Printing PCL 6, Upstairs copyroom, For All students and staff,x32, P374OFF3, 10.23.130.24,.\Driver\HPUPDPCL6_x86\hpcu118c.inf, HP Universal Printing PCL 6, Main Office,For All students and staff, # ---------------------x64----------------------------x64, P374OFF2, 10.23.130.22,  .\Driver.x64\HPUPDPCL6_x64\hpcu118u.inf, HPUniversal Printing PCL 6, Main Office, For Office Staff, S-1-5-21-73586283-606747145-725345543-105551x64, P374CPY1, 10.23.130.13,  .\Driver.64\KyoceraPLC6_x64\OEMsetup.inf,Kyocera Classic Universaldriver PCL6, Workroom, Kyocera MFP,x64, P374RM1, 10.23.130.11,.\Driver.x64\HPUPDPCL6_x64\hpcu118u.inf, HP Universal Printing PCL 6, room 1,For All students and staff,x64, P374UP1, 10.23.130.21,.\Driver.x64\HPUPDPCL6_x64\hpcu118u.inf, HP Universal Printing PCL 6, Upstairscopy room, For All students and staff,x64, P374OFF3, 10.23.130.24,.\Driver.x64\HPUPDPCL6_x64\hpcu118u.inf, HP Universal Printing PCL 6, MainOffice, For All students and staff,

Branch Management

When running this script, you can define the location. That is to say, each branch can have a printer with the same name, a group with the same name, or a computer name, this location information is used to add the information to the front of all the above control files. For example, all the control files of the branch named 310 start with 310 _, that is, 310_printerconfig.ini, 310_groups.ini,
310_office.txt, 310_mobile.txt, and so on, so that administrators can easily manage different branches in a centralized manner.

 

Command Line

The basic command line is:

Cscript APD. vbs options

Options can be:

/L code: Define branch code

/Q: In quiet mode, no running information is output.

/S: delete itself after completion

/D: delete all TCP/IP printers, suitable for redeployment.

Place the VBSCRIPT script file and all related files in a network shared folder,

My configuration is as follows: all 32-bit drivers are placed in the driver sub-folder, 64-bit drivers are placed in the driver. x64 sub-folder, and other files and scripts are themselves placed in this folder.

Command Line example:

Cscript setupipprinter. vbs/l218/Q/D or cscript setupipprinter. vbs /?

Others:

Subinacl.exeis used to set the permission for the printer. psgetsid.exe is used to obtain the SID of a user/user group in the LDAP service.

 

Source code:

See google code: http://code.google.com/p/adaptable-printer-deployment/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.