Access denied when switching printer programatically

  • Thread starter Thread starter Moshe
  • Start date Start date
M

Moshe

Client - XP, Terminal Server W2k with latest SP.
Client has HP 4000 attached to LPT1
Client logges into TS as regular domain user and runs a VB app that we
developed. The app is sending jobs to the "Default printer" with no
problems.
On certain printouts the app uses windows API call to switch to a
shared printer installed on TS print a job and then switch back to the
"default printer". Error - "Acccess is Denied" twice (Probably one
when switching to the shared and one when trying to switch back)
When from the same client computer, the user is logging in as a domain
user who is also part of the TS local administrators - no errors.
The shared printer had "Everyone" with "print" and "manage document"
allowed.
I tried to change the security of the shared printer and add
"Everyone" Manage printer for testing only as this not a good idea. At
this point loggin in as a regular domain user, the app was able to
switch to the shared printer and print job was printed OK on the
shared, but when the app tried to switch back to the default printer
which is the the local printer of that user - error "Access is
denied". Looking at printers in that session, the shared printer was
tagged as the default printer.
I also noticed that when the user is logging without even starting our
app the event viewer shows the following:
Event id 9, Source: Print user NT AUTHORITY\SYSTEM: .....(the printer
name and computer name)/Session 3 was set.
Event id 2 Source Print, user NT AUTHORITY\SYSTEM: .....(the printer
name and computer name)/Session 3 was created.
Event id 9 Source: Print, user NT AUTHORITY\SYSTEM: .....(the printer
name and computer name)/Session 3 was set. (3-4 more times with same
data)
Event id 1110 Source: TermServDevices, User: N/A: Error processing
ntprint.inf. If the file on the system is corrupt, you can restore it
from the installation media.
Event id 1111 with same source and user: Driver HP LaserJet 4000
Series PCL6 required for printer HP LaserJet 4000 Series PCL6 is
unknown. Contact the administrator to install the driver before you
log in again.
Event ID 1106 same source and user: The printer could not be
installed.
All message in the same minute
What are we doing worng, what is going on
Thanks
Moshe
 
What the Events indicate is this:
The "HP LaserJet 4000 Series PCL6" driver name is unknown on the
server (which probably means that the driver name is slightly
different on the server, something like "HP LaserJet 4000").

Upon logon, the server tries to search the file ntprint.inf, to
check if you have provided a drive name mapping. Now here comes
the next problem: this file is either corrupt or contains a syntax
error.
Have you been editing this file before? If not, you might have to
copy a fresh one from your installation CD, and then edit it to
add the driver name mapping that you need. Something like:

"HP LaserJet 4000 Series PCL6" = "HP LaserJet 4000"

For details, check:

239088 - Windows 2000 Terminal Services Server Logs Events 1111,
1105, and 1106
http://support.microsoft.com/?kbid=239088

--
Vera Noest
MCSE, CCEA, Microsoft MVP - Terminal Server
http://hem.fyristorg.com/vera/IT
--- please respond in newsgroup ---

(e-mail address removed) (Moshe) wrote in
 
Hi Vera,
I read the article and I will ask the system admin to take care of the
driver name.
As far as corrupeted file, well can it be becuase of the other error? As we
don't get it on other printers that the driver is correct.
For the issue of access denied, do you have any idea why it is happing? Why
we set the security on the printer to Everyone / Manage Printer, we don't
get the error? Does switching default printers requires any additional
rights then just "Print"?
The same code works OK on citrix for example, so I tend to believe that this
is not the code but rather some setting on Termianl server
Thanks and Happy Thanks giving
Moshe
 
Back
Top