Importing Microsoft Active Directory Print Management Printers into Micro Focus Service Desk 7.3


Do you manage printers with Microsoft Active Directory Print Management? Are you tired of manually creating and updating printer items in Micro Focus Service Desk? Even if you have done this, chances are good that this process quickly got out of hand. Manually keeping up with changes to printers can be exhausting and error prone. You are not alone in this pain.

The folks at Missoula County, MT were experiencing this pain with managing their printers in Service Desk. They really didn’t want to have to manage them in two places. They contacted me to find a solution. At first, we couldn’t come up with one. The trouble was that we could list the Print Management printers in LDAP, but Service Desk doesn’t read Items directly from LDAP. However, Items can be imported from a database. If there was only a way to get the LDAP objects into a database….

Well, it’s a good thing our customers are so smart! Ken Marshall at Missoula County figured out how to create a database view that reads the printer objects directly from LDAP dynamically. He provided the scripts to create the database view and the connector that ties the view into LDAP. From there, we were able to write a Service Desk AMIE import driver to import the printers from the database view.

Thus, it is possible to completely automate this process! Jason Knudson at Missoula County has been using this implementation for several months and reports that it is working flawlessly. He is also very anxious that I share it so we all can benefit. With his and Ken’s permission, I will walk through the required steps for creating the database connector and view. I will also detail the process for connecting Service Desk to this view.

The AMIE import functionality of Service Desk makes this possible. We will make use of the following for this article:

    • A Microsoft Active Directory Print Management environment with at least one printer defined


    • A Microsoft SQL Server database with a view that does a live LDAP query to Active Directory printers


    • A customized Service Desk AMIE import driver xml file


    • A Micro Focus Service Desk 7.3 server


Mark printers to show up in LDAP

    1. Open Active Directory Print Management


    1. Navigate to Print Servers > [server] > Printers


    1. Right click the printer


    1. Click List in Directory if that option is there
      NOTE: If the printer is already listed in the directory, the option will be Remove from Directory. If that is the option seen, then leave it.


Download and distribute files

    1. Download the file


    1. Unzip it to a temporary location


    1. Copy the ADSI-linked-server.sql and PrinterView.sql files to the SQL Server where the database will be created


    1. Copy the PrinterView-driver.xml file to the device where the Service Desk web portal will be accessed


Create an ADSI-linked server

NOTE: This is a structure that the PrinterView will use to connect to our Active Directory LDAP server.

    1. Open and login to SQL Server Management Studio


    1. Open ADSI-linked-server.sql


    1. Find Line 12. This is the line with sp_addlinkedsrvlogin near the beginning


    1. Replace DOMAIN\USER with the Active Directory domain and user we want to use to connect to Active Directory


    1. Replace ######## with the password for the Active Directory user


    1. Save the file


    1. Click Execute


Create the database for the PrinterView

    1. Right click Databases


    1. Select New Database


    1. Enter the Database name
      NOTE: For this article, I named this database MFSDPrinters.


    1. Click OK


Create the PrinterView

    1. Still in SQL Server Management Studio, open PrinterView.sql


    1. Find Line 25


    1. Replace with the IP address of your Active Directory LDAP server


    1. Save the file


    1. Click Execute


Create a SQL Server login to connect to the MFSDPrinters database

NOTE: An Active Directory user could also be used here. To do that, edit the User Mapping for the Active Directory user instead of creating a new Login.

    1. Expand the Security folder


    1. Right click Logins


    1. Select New Login...


    1. Enter a Login name
      NOTE: For this article, I named the login MFSDPrintersAdmin


    1. Select SQL Server authentication


    1. Enter a password


    1. Click User Mapping on the left hand side


    1. Check the box next to the MFSDPrinters database


    1. In the Database role membership box below, select db_datareader


    1. Click OK


Create the Category for the printers

    1. Login or switch to the Service Desk User portal


    1. Navigate to Configuration > Categories


    1. Click New


    1. Enter AD Printers in the Name field
      NOTE: It is important that the Category is named AD Printers. This is because it has to match the Category referenced in the AMIE driver xml file that was imported earlier.


    1. Click Save


Customize Category details (Optional)

NOTE: Even though this step isn't technically necessary, it will make the printer items cleaner.

    1. Navigate out and back into the AD Printers Category
      NOTE: This is to avoid a bug where the Category fields won't activate or deactivate properly.


    1. Open the AD Printers Category again


    1. Click Edit


    1. Select all but the first four fields


    1. Click the red x just to the right to disable the selected fields


    1. Rename the first four fields of the AD Printers Category


    1. Click Save

Rename a Category field

    1. Click the field name on the main Category page
      Example: Field1


    1. Click Edit


    1. Change the Field Label to the desired value


    1. Click Save

I renamed my AD Printers Category fields as follows:

    • Field1: Printer Name


    • Field2: Printer Location


    • Field3: Printer CN


    • Field4: Printer Driver Name


Configure the Printer Driver AMIE Import

    1. Login or switch to the Service Desk Admin console


    1. Navigate to Setup > AMIE > Customize


    1. Select Upload/Edit Configuration from the Operation dropdown


    1. Click the New button


    1. Click Browse next to Mapping File


    1. Navigate to the PrinterView-driver.xml file and select it


    1. Select SQLServer from the Database Type dropdown


    1. Enter MFSDPrinters for Database Name, MFSDPrintersAdmin for Username, Password, and dbo for Schema


    1. Click Import


    1. Navigate to AMIE > Setup


    1. Click New


    1. Select AD Printer Database v1.0 (Peter Sumsion) from the Type dropdown


    1. Enter the Host address for the database server


    1. (Optional) Set the items to automatically import by selecting Yes for the Auto Create New Items option


    1. (Optional) Select Daily, Weekly, or Monthly from the Frequency dropdown


    1. Click Test
      NOTE: If the web console hangs at this point, make sure the firewall rules allow the connection. If there is an error, double check the Database Name, Username, Password, and Schema.


    1. When the test returns a success message, click Save


Run the import and verify the Items

    1. Login or switch to the Service Desk Admin portal


    1. Navigate to Setup > AMIE > AD Printer Database v1.0 (Peter Sumsion)


    1. Click Import


    1. Click Done


    1. Click the yellow bell icon when it appears in the top portal menu
      NOTE: This import process can take a while if there are many printers in Active Directory Print Management. The import process can be monitored from Setup > Reports > System > Tasks.


    1. Open the Item import summary


    1. Verify that the right number of Items were imported


    1. Click Dismiss or Done


Look closer at the imported Items

    1. Login or switch to the Service Desk User portal


    1. Navigate to Configuration > Items
      NOTE: It may be helpful to search on the AD Printers Category. Otherwise, the items should simply show up in the Items list.



    • Deleting a printer from Print Management does NOT delete the printer from Service Desk. To remove the printer item from Service Desk, it must be removed manually.


    • If the @rmtpassword used in the ADSI-linked server setup expires, subsequent printer imports will show the following in the Item import summary:Item import completed System: AD Printer Database v1.0 (Peter Sumsion) Assets found: 0 Assets imported successfully: 0 AMIE Snapshots imported successfully: 0 Items added: 0 (0 Failures) Items updated: 0 (0 Failures)Querying the PrinterView manually from SQL Server will show the following error:

      Msg 7399, Level 16, State 1, Procedure PrinterView, Line 4
      The OLE DB provider "ADSDSOObject" for linked server "ADSI" reported an error. The provider indicates that the user did not have the permission to perform the operation.
      Msg 7321, Level 16, State 2, Procedure PrinterView, Line 4
      An error occurred while preparing the query "SELECT objectGUID, driverName, cn, location, printerName FROM 'LDAP://' WHERE objectClass = 'printQueue'" for execution against OLE DB provider "ADSDSOObject" for linked server "ADSI".

      If that happens, do the following:

        1. Update the value of @rmtpassword on line 7 of ADSI-linked-server.sql

        1. Highlight line 7

        1. Click Execute

        1. Run the printer import again from Service Desk



Using the steps outlined in this article, you should now have printer items from Active Directory Print Management showing up in Service Desk. This makes it easier to manage and open tickets for printers in your environment.

Because the PrinterView performs a live LDAP query to Active Directory Print Management, the Service Desk import is dynamic. As printers are added or updated from the Print Servers, subsequent imports from Service Desk will add or update the printer Items. This means that you can simply manage the printers in Active Directory instead of having to worry about manually creating the printers as Items in Service Desk.

I hope this makes it easier to manage printers in Service Desk. Thank YOU for using Micro Focus Service Desk!


How To-Best Practice
Comment List