Archive

Archive for January, 2010

Installing network printers from SharePoint

22/01/2010 1 comment

This is a cross-post from the good folk over at EndUserSharePoint.com

A good while ago, there was a lot of discussion on the Microsoft Technet forums about how to use SharePoint to allow end users to install network based printers.  A few ideas were batted back and forth and ultimately, it came down to uploading a bunch of links that pointed to each printer object on the closest server (i.e. \\servername\printername).

This worked fine and you could even add some custom columns to group them by office, floor number etc but it lacked some “finesse”.  I thought I’d go about making this into a much more user friendly and graphical experience and came up with a pretty simple way to display a floor plan of the office which the user could then use to locate their closest printer and install it with a click.  This is especially useful where staff members are visiting from other offices (and hence do not know the layout of the office and printer names).

So how is this achieved?  It’s actually pretty simple but can take some time to set up.  So let’s get cracking.

You will need:

  • Visio to create your floor plans.
  • Visio viewer installed on all client machines.
  • A small vbs script for each printer.  Note: you will need to ensure vbs files are allowed in your environment.
  • A document library to store the scripts and Visio diagram(s).

Scripts:

Let’s start by setting up the scripts.  Create a new txt file on your desktop and open it up.  Copy and Paste in the following snippet of code (remembering to change the path to the printer):

‘ Printers.vbs – Windows Logon Script.

Set objNetwork = CreateObject(“WScript.Network”)

objNetwork.AddWindowsPrinterConnection \\SERVERNAME\PRINTERNAME

Save this file as YOURPRINTERNAME.vbs.  Rinse and repeat for each printer.  Once they have been created, upload them all to your document library.  See, I told you it was easy!

Now we need to link these files to our floor plan.  But wait, we don’t have a floor plan yet!

Floor Plan:

To create your floor plan, fire up Visio and design it accordingly.  This part may take some time to get right, depending on how accurate you want to be and how experienced you are with Visio.

Hint: Your facilities department may already have access to existing Visio floor plans so check that route out first.

Once done, we now need to add some printer shapes to the appropriate places on your floor plan.  I’ve filled in my printer symbols with a blue colour so they stand out a bit from the other shapes (mainly because I couldn’t find any quality printer shapes to download and the stock ones are a bit ugly).

Now you need to turn those printer shapes into hyperlinks.  Do this by right-clicking the printer symbol and select Hyperlink from the menu.

Type in the URL to the relevant script in your document library, give it a useful description and click OK.  Repeat this for each printer shape on your diagram.  When you are happy, save the file and upload this into the same document library we created earlier.
Note that if you have multiple floors in your building, you can add each floor plan into its own page within your Visio file (remember to rename the pages as Floor 1, Floor 2 etc).

We’re nearly done so stay with me.  All that’s left is to display your floor plan in SharePoint and we’re good to go.

Configure SharePoint:

Browse to the SharePoint page where you want to display the floor plan and click on Site Actions | Edit Page.
Add our good friend, then content editor web part (CEWP) to this page.
Open the source editor of the web part and paste in the following code (changing the path to the Visio file accordingly):

 <OBJECT classid="CLSID:279D6C9A-652E-4833-BEFC-312CA8887857"
codebase="http://www.microsoft.com/downloads/info.aspx?na=90&p=&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=d88e4542-b174-4198-ae31-6884e9edd524&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2f6%2ff%2f5%2f6f569198-e7d0-49af-b162-54a11f38d301%2fvisioviewer.exe"
id="viewer1" width="100%" height="500">
<param name="BackColor" value="16777120">
<param name="AlertsEnabled" value="1">
<param name="ContextMenuEnabled" value="1">
<param name="GridVisible" value="0">
<param name="HighQualityRender" value="1">
<param name="PageColor" value="16777215">
<param name="PageVisible" value="1">
<param name="PropertyDialogEnabled" value="1">
<param name="ScrollbarsVisible" value="1">
<param name="ToolbarVisible" value="1">
<param name="SRC" value="http://PATH TO YOUR VISIO FILE">
<param name="CurrentPageIndex" value="0">
<param name="Zoom" value="-1">
</object>

Customise these parameters as you need and click OK.  The main points to customise here are the Height, BackColor and PageColor parameters as these will have the most impact on the look and feel of the webpart.

Now when the page refreshes, you should see your floor plan.  If you created multiple pages, then these will be shown at the bottom of the diagram.  Click one of your printer symbols to see it fire up the script and install the printer.

Note that the Visio viewer allows the user to zoom in and out and pan around the diagram so you get a pretty decent experience here and with SharePoint 2010 on the horizon the user experience will be even better due to the new Visio Services.

Categories: SharePoint