Click here to Skip to main content
15,881,424 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I'm working on a webservice to manage Printers (local and remotely) using C#.

I am able to connect to my own machine (Windows 7) Printers using this and it works like a charm:

C#
PrintServer localPrintServer = new PrintServer(@"\\myMachineName");

But I am getting an exception if I try the same thing for a remote server (Windows Server 2008 R2):

C#
PrintServer ServerPrintServer1 = new PrintServer(@"\\myServerName");

An exception occurred while creating the PrintServer object. Win32 error: The printer name is invalid.

I've already installed the Print Server Feature in my Windows Server as you can see here: http://runto.it/gXBOIn

The Windows Server is accessible from my machine:

*C:\Users\Tomas>ping winad1 Pinging winad1.london.gbs [192.168.42.12] with 32 bytes of data:
Reply from 192.168.42.12: bytes=32 time=3ms TTL=128
Reply from 192.168.42.12: bytes=32 time=1ms TTL=128
Ping statistics for 192.168.42.12: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 1ms, Maximum = 3ms, Average = 2ms C:\Users\Tomas>*


Any suggestions?

Thank you in advance :)
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900