amset

.info
.co.uk - exchange consultancy
.net - internet based solutions

Broadband - Exchange
Login Scripts - Net Admin
Outlook - Windows Mobile
Windows

Contact - Advertise

AddThis Social Bookmark Button

Network Admin

Branding "System Properties"
with Your Own Information
... Win XP, 2000 and older
... Vista

Changing ISPs Plan

Changing Internal
IP Addresses Plan

Custom Text on the
"Workstation Locked" Screen

Downloading a Complete
Internet Explorer Installation

Group Policy Admin

Login Scripts

Limiting the Number of Logins a User Can Make

MRTG Statistics

Recovery Console

Reset Administrator Password

Run As

Subnet Masks

Uptime Statistics

Using NetMeeting for
Remote Control

Viewing Printers in a
Web Browser

Accessing Printers using a Web Browser

One of the more useful features of the tight integration between Windows 2000, Active Directory and IIS is the ability to list all printers installed on a printer server in a web browser.

Once connected to the web page you can view the status of the printer - such as the queue and the basic properties of the printer. You can even connect to the printer, without having to go through the tiresome "Add Printers" wizard, making it a quick and easy way to deploy printers to users.

The feature is enabled as default on Windows 2000 Servers, but needs to be added to Windows 2003 Servers.
Once added you can view it in the same way: http://<servername>/printers.

Adding the Feature to Windows 2003 Servers

If you are running Windows 2003 Server then you need to add the feature to the default web site before it can be viewed. You can use the same technique to put the capability on to its own web server allowing you to publish a simple URL to the users such as "http://printers.domain.com/" .

  1. Create a new web site or virtual directory to point to the path "C:\WINNT\Web\printers" on Windows 2000 and "C:\Windows\Web\Printers" in Windows 2003 Server.
    The only permissions required are "Read". Write, Script Source and Directory Browsing are not required and should be disabled. Security is your decision - this application works with both.
  2. Once created, adjust the "Documents" properties of the web site or virtual directory so that the file name "ipp_0001.asp" is the default and is at the top of the list.

On Windows 2003 Server you may have to adjust the settings to allow "Scripts Only" under execute permissions to allow the pages to generate correctly.
Also ensure that support for ASP pages has been enabled on the default web site (it is disabled by default).

If you have created a new site for printers, rather than using the existing default site, then you should review the end of this article about a modification required for the web code to ensure that it works correctly.

Connecting to Printers

Once the web site is created, you can browse to it and see a listing of all printers installed on the machine.

However you may want to use different web sites depending on whether or not the user is on the LAN.

LAN users should continue to use http://<server-name>/printers

Remote users would use the new site, for example http://printers.domain.com/

Once the list is shown, simply click on the required printer and you should see "Connect" in bold on the left. Click on that link and the printer will be installed on to the machine viewing the web site.

Changing the Number of Printers Shown on the Page

If you want to change the number of printers shown on the page, you need to adjust the code slightly. Take a backup of the file before modifying it.

In "C:\WINNT\Web\printers" you need to modify the file "ipp_0001.asp"

Open the file in a text editor such as notepad. Don't use an HTML editor as it may modify the coding in ways that will stop the page from loading.

Find the line:

Const iPrinterLength = 10

Change the number 10 to any number that you like. Depending on the speed of the server and the number of printers that you have, you may want to try various numbers to find what works for you without becoming a performance hit - particularly on a dedicated printer server.

Troubleshooting the "Get ADSI Printers" error Message

If you have setup this feature then try to access the server using a format other than "http://<server-name>/printers" (such as a Full Qualified Domain name like http://<server-name.domain.com/printers/) you will probably get an error message similar to the one below.
The error will also occur if you create a new site which is pointing directly to the printers virtual directory.

Get ADSI Printers
80070034

This is caused by the web services not recognising the address that you are trying to access. To resolve it, you need to modify the ASP pages that Windows uses for this feature. This is not required on Windows 2003 Servers where the code has been adjusted.

Modifications Required

In "C:\WINNT\Web\printers" you need to modify two files: "ipp_0001.asp" and "ipp_0004.asp".

Open these files in a text editor such as notepad. Don't use an HTML editor as it may modify the coding in ways that will stop the page from loading.

In both files, find the line:

If strComputer = "localhost" Or strComputer = "127.0.0.1" Then

Copy the last "Or strComputer = "127.0.0.1" " and paste it after the 127.0.0.1 so that it look like this:

If strComputer = "localhost" Or strComputer = "127.0.0.1" Or strComputer = "127.0.0.1"

Then modify the 127.0.0.1 that you have just copied to be the Full Qualified Domain Name (FQDN) that you want to use. For example, we are using "printers.amset.info"

If strComputer = "localhost" Or strComputer = "127.0.0.1" Or strComputer = "printers.amset.info"

Then save the file.

Refreshing the page should indicate that the error message is no longer present.

Sponsored Links

Last Page Update:
12/01/2007

Back to the Top
Contact Us - Advertise on amset.info
Netadmin Index - Home Page


Broadband - Exchange - Login Scripts - Network Admin - Outlook - Windows Mobile - Windows


© Amset IT Solutions Ltd. 1998 - 2008. All rights reserved. Reproduction of any content on this web site is prohibited without express written consent. Use of this web site is subject to our terms and conditions. All trademarks and registered trademarks are property of their respective owners. This site is not endorsed or recommended by any company or organisation mentioned on this site. This site is to provide guidance only and as such we cannot be held responsible for any consequences of following the advice given.