Cool Solutions

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



By:

February 3, 2017 8:55 am

Reads:1,156

Comments:0

Score:Unrated

Print/PDF

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
  2. Navigate to Print Servers > [server] > Printers
  3. Right click the printer
  4. 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 MFSD-AD-Printers.zip file
  2. Unzip it to a temporary location
  3. Copy the ADSI-linked-server.sql and PrinterView.sql files to the SQL Server where the database will be created
  4. 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
  2. Open ADSI-linked-server.sql
  3. Find Line 12. This is the line with sp_addlinkedsrvlogin near the beginning
  4. Replace DOMAIN\USER with the Active Directory domain and user we want to use to connect to Active Directory
  5. Replace ######## with the password for the Active Directory user
  6. Save the file
  7. Click Execute

 

Create the database for the PrinterView

  1. Right click Databases
  2. Select New Database
  3. Enter the Database name
    NOTE: For this article, I named this database MFSDPrinters.
  4. Click OK

 

Create the PrinterView

  1. Still in SQL Server Management Studio, open PrinterView.sql
  2. Find Line 25
  3. Replace 0.0.0.0 with the IP address of your Active Directory LDAP server
  4. Save the file
  5. 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
  2. Right click Logins
  3. Select New Login…
  4. Enter a Login name
    NOTE: For this article, I named the login MFSDPrintersAdmin
  5. Select SQL Server authentication
  6. Enter a password
  7. Click User Mapping on the left hand side
  8. Check the box next to the MFSDPrinters database
  9. In the Database role membership box below, select db_datareader
  10. Click OK

 

Create the Category for the printers

  1. Login or switch to the Service Desk User portal
  2. Navigate to Configuration > Categories
  3. Click New
  4. 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.
  5. 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.
  2. Open the AD Printers Category again
  3. Click Edit
  4. Select all but the first four fields
  5. Click the red x just to the right to disable the selected fields
  6. Rename the first four fields of the AD Printers Category
  7. Click Save

Rename a Category field

  1. Click the field name on the main Category page
    Example: Field1
  2. Click Edit
  3. Change the Field Label to the desired value
  4. 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
  2. Navigate to Setup > AMIE > Customize
  3. Select Upload/Edit Configuration from the Operation dropdown
  4. Click the New button
  5. Click Browse next to Mapping File
  6. Navigate to the PrinterView-driver.xml file and select it
  7. Select SQLServer from the Database Type dropdown
  8. Enter MFSDPrinters for Database Name, MFSDPrintersAdmin for Username, Password, and dbo for Schema
  9. Click Import
  10. Navigate to AMIE > Setup
  11. Click New
  12. Select AD Printer Database v1.0 (Peter Sumsion) from the Type dropdown
  13. Enter the Host address for the database server
  14. (Optional) Set the items to automatically import by selecting Yes for the Auto Create New Items option
  15. (Optional) Select Daily, Weekly, or Monthly from the Frequency dropdown
  16. 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.
  17. 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
  2. Navigate to Setup > AMIE > AD Printer Database v1.0 (Peter Sumsion)
  3. Click Import
  4. Click Done
  5. 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.
  6. Open the Item import summary
  7. Verify that the right number of Items were imported
  8. Click Dismiss or Done

 

Look closer at the imported Items

  1. Login or switch to the Service Desk User portal
  2. 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.

 

Gotchas

  • 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://10.0.0.206’ 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
    2. Highlight line 7
    3. Click Execute
    4. Run the printer import again from Service Desk

 

Summary

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!

0 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 5 (0 votes, average: 0.00 out of 5)
You need to be a registered member to rate this post.
Loading...

Tags: , , ,
Categories: End-user How-to, Endpoint Management, Service Desk, Technical

0

Disclaimer: This content is not supported by Micro Focus. It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test it thoroughly before using it in a production environment.

Comment

RSS