Event ID 1116 Printer Auto-Creation Failure. Reason: AddPrinter() failed with status 0x704

Event ID 1116 Printer Auto-Creation Failure. Reason: AddPrinter() failed with status 0x704

book

Article ID: CTX107445

calendar_today

Updated On:

Description

Client printers fail to autocreate when users log on. An event is written to the Event Log with ID 1116 from source MetaFrame Events. The event contains:

“Reason: AddPrinter() failed with status 0x704.” 

Converting hex 704 into decimal and using net helpmsg does not provide any additional information.
C:\Documents and Settings\Administrator.FTLRLAB>net helpmsg 1796
The specified port is unknown.

The user might be able to add a printer manually through the client network, but it is inaccessible. This autocreation failure and Event Log entry might also appear after installing a hotfix or hotfix rollup pack. Then Cause 2 and Resolution 2 might apply.

Environment

Caution! Using Registry Editor incorrectly can cause serious problems that might require you to reinstall your operating system. Citrix cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk. Be sure to back up the registry before you edit it.

Resolution

Important! Refer to the cause section and apply the corresponding solution based on cause.

Solution 1

Caution! Refer to the Disclaimer at the end of this article before using Registry Editor.

  1. Modify the following registry value:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Client Printer Port
    Value = Driver
    Data = cpmon.dll 

  2. Restart the Citrix printing service/print spooler.
    Note: If the key "Client Printer Port" does not exist or if the server or printing service has been restarted, the registry change will not take effect until the Citrix print services are restarted again. If still not present after Citrix print services are started, manually create the registry key and value.

Solution 2

When a hotfix or hotfix rollup pack is installed, it updates the files in their default location. Hotfix rollup pack or hotfix does not update any file copied to another location.

In case of ctxprn.dll, the default location is “Program Files (x86)\Citrix\system32”.

On most systems, “%SystemRoot%\system32” is higher in the PATH variable than “Program Files (x86)\Citrix\system32”. An older version from “%SystemRoot%\system32” of ctxprn.dll is identified for the update to be applied resulting in autocreation failure.

To resolve the autocreation failure issue, remove the additional copy of ctxprn.dll from “%SystemRoot%\system32”.


Problem Cause

The following two causes create the issue.

Cause 1

The Client Printer Port Monitor is set to the incorrect dll might be the cause of the issue.

On XenApp 5.0 and 6.x, this file is cpmon.dll. The file is indicated in the registry of the server in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\ClientPrinterPort\Driver. On servers that were upgraded from earlier version, this setting is not updated correctly and be defined as cpmmon.dll.

Cause 2

A mismatched version of ctxprn.dll might be an issue. To solve specific issues with custom applications, ctxprn.dll was copied from “Program Files (x86)\Citrix\system32” to “%SystemRoot%\system32”.

Issue/Introduction

This article conatins information on Event ID 1116 Printer autocreation failure. Reason: AddPrinter() failed with status 0x704 and provides workaround to resolve the issue.