Subscribe to Windows IT Pro
August 13, 2002 12:00 AM

Administering Printer Locations

Windows IT Pro
InstantDoc ID #26050
Rating: (0)
Downloads
26050.zip

Scripting an administrative Web interface for the printer mapping utility

In "A Printer Mapping Utility" April 2002, InstantDoc ID 24368, I described how to display printer locations within your organization by placing printer icons on floor-plan maps. Map positions result from x and y coordinates (pixel offsets) for the Location attribute of each networked printer. Manually calculating pixel offsets for more than a few printers is time-consuming; maintaining pixel offsets in a large network in which printers might move weekly is challenging. To address these obstacles, you can use a script that runs in a Web browser to administer printer locations. In the second article in my series, "The Code Behind the Printer Mapping Utility," May 2002, InstantDoc ID 24598, I discussed the details of the PrintersMap.asp script. In this article, the third and last in the series, I discuss how to configure an administrative Web interface for the printer mapping utility, install and configure the utility, and prepare and run the script. Finally, I detail how the script works.

Configuring Printers
First, click a floor map to specify pixel offsets, as Figure 1 shows. The x and y coordinates, separated by "x" and in parentheses (e.g., 120 x 300), will appear in the Map position text box. Next, select a printer that you want to reposition from the Select a printer share list. The printer's location information, if any, will appear in the Printer location text box. With both the Printer location and Map position text boxes populated, you can click either Append or Replace to insert a value in the New location text box: Click Append to concatenate the value in the Map position text box to the value in the Printer location text box, and click Replace to insert the value in the Map position text box into the New location text box. If necessary, you can edit the value in the New location text box. If you click Append and the data in the Printer location text box contains the previous coordinate value along with the new coordinate value, you'll want to edit the value in the New location text box.

When the value in the New location text box is correct, click Update to apply the location change. When a Microsoft Internet Explorer (IE) message box appears, click Retry to see the updated printer map.

To save space, Figure 1 shows only a small portion of the floor map. However, make sure that you view the entire floor map when you select printer coordinates. If you don't view the entire page, the pixel offset values will be incorrect.

This script relies on both client-side JScript and server-side VBScript code. HTML and Active Server Pages (ASP) render the pages, and Dynamic HTML (DHTML) provides advanced form features. Windows Management Instrumentation (WMI) and Active Directory Service Interfaces (ADSI) provide read and write access to printer information.

Installing and Configuring the Interface
After you configure the printer mapping environment, which I outlined in detail in "A Printer Mapping Utility" and "The Code Behind the Printer Mapping Utility," copy the following files from the Windows Scripting Solutions Web site (http://www.winscriptingsolutions.com) to the Main directory, which is a subdirectory of the PrintersMap virtual directory:

  • defaultadmin.htm*the initial print-server selection page
  • printersmapadmin.asp*the printer mapping administration script
  • stylesheet.css (updated for the administrative interface)*the style sheet that replaces the original style sheet in the Img directory
  • bigmask.gif*an image that the coordinate mapping feature uses to obtain x and y coordinates

Related Content:

ARTICLE TOOLS

Comments
  • darren
    8 years ago
    Jan 22, 2004

    If a user isn’t a member of the Administrators group, I found that the printer map page will not come up. I tried changing the permissions in IIS and NT file systems and gave users full control on the printer map directories, but it still does not work.



    The only time I can see the printer map is if I specify Integrated Windows
    Authentication on IIS without anonymous access AND if I’m a member of the Administrators group on the print server. I even tried changing the permissions in the registry for the /root/cimv2 key in the registry without any effect. I also tried adding the users to all the user rights in Local Policy. This had no effect either. The error message I receive is: Error in CIMV2 connect string: -2147217405.



    Does this mean all users have to be administrators on the print server in order to see the map? I don't want to have to give all users administrative privileges on the print server.

    A note from Ethan: The good news is that all your users do not need to have Administrator permissions. I think the issue is probably your access settings to the CIMV2 namespace. Try the following:



    1. Open the Computer Management console on one of your print servers.

    2. Expand the Services and Applications node.

    3. Select the WMI Control control.

    4. Right-click the WMI Control node and then click Properties.

    5. From the WMI Control Properties dialog box, click Security.

    6. Expand the Root node and click CIMV2.

    7. Click the Security button.

    8. Assign the Everyone group Remote Enable permission or, for a more secure solution, add a group to which your users are members and then grant the group the Remote Enable permission.



    I suggest that you use only IIS Integrated authentication for
    security but I suppose you could also add the IIS anonymous user account to the group that you grant remote enable permission.


  • darren
    8 years ago
    Jan 22, 2004

    We have about 12 printers in a single floor. I went through the scripts and got as far as the printer objects showing up on the floor map in the correct locations. The part that's not working for me is when I click on the printer icon, it brings up a broken link for all the printers. If I move the mouse cursor over the printer, the display shows http://print_server/share name. Looking at the status bar on the browser, the following is displayed: http//print_server/share. If the queues were to be displayed, shouldn't the path be \\\\print_server\\share?



    If this is incorrect, how can I query the http://print_server/printers/ directory for the correct printer when clicking a specific printer icon in the floor map?

    A note from Ethan: I don't know if this will help, but take a look at the Microsoft article “Cannot Install IIS 5.1 Printers Virtual Directory Subcomponent through Add/Remove Windows Components” (http://support.microsoft.com/default.aspx?scid=kb;en-us;304544).



    Also, in Internet Explorer (IE), you should be able to type http://print_server/printer_share_name, where print_server is the name of your print server and share_name is the name of the printer share. IIS on the print server will redirect the request to the appropriate URL. I successfully tested this on a Windows 2000 Server with Service Pack 3 installed and with the configuration change suggested in the Microsoft article I mentioned.

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.