Cannot detect USB Printer non admin account

Hi All

When calling the GetZebraDriverPrinters method in UsbDiscoverer on Windows .Net I am finding that it only detects printers when the application is running with administrator permissions or with a local admin account. As soon as I run it under a domain account that has restrictions that cannot be overridden then I find that it cannot detect a local printer even though the user is able to see the printer installed via its driver and send test prints from the Control Panel's Devices and Printers window.

Does the LinkOS SDK make use of a different mechanism that is impacted by the user account's privilege level and how can I override this?

Kind regards

Dmitry Prokhorov
Hello Peter,Are you able to

Hello Peter,

Are you able to communicate with printer using ZebraDesigner tool that is running it under a domain account? Could you please to check it.

Dmitry Prokhorov

Software Engineer, Kutir Mobility

Posted on behalf of Zebra Technologies

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


PETER ING
Hi DmitryI have tried with

Hi Dmitry

I have tried with Zebra Designer on the same workstation with the same account and Zebra Designer is able to see the Printer.

Kind regards

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Dmitry Prokhorov
Hi Peter,In case Zebra

Hi Peter,

In case Zebra Designer is working ok with the same account it looks like a cause of your problem not in the LinkOS SDK.

Dmitry Prokhorov

Software Engineer, Kutir Mobility

Posted on behalf of Zebra Technologies

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Javier Molina
Peter,What version of Windows

Peter,

What version of Windows and of the LinkOS SDK are you using?

Javier Molina

Technical Architect, Kutir Mobility

Posted on behalf of Zebra Technologies

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Ruth Neessen
Hi there,i have the same

Hi there,

i have the same problem. I'm using windows 10 and zebra link_os sdk v2, our printer is GK420t. We need to print via usb, because the our working place is not connected to the network.

I tried it in Java and in C#: if I am logged in as admin, I can print without problems from my Java or C# program. But once a standard user with restricted privileges is logged in under windows (which is usually the case), I can no longer print. The getZebraDriverPrinters() method still returns the printer, but a connection can no longer be established.

However, via the normal Windows Print dialog it is possible to print a test page, even with the restricted user.

Is there a solution?

Yours sincerely,

Ruth Neeßen

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Dmitry Prokhorov
Hello Ruth,Could you please

Hello Ruth,

Could you please to check a version of your Link OS SDK and update it to most recent one?

It could be already fixed issue.

Dmitry Prokhorov

Software Engineer, Kutir Mobility

Posted on behalf of Zebra Technologies

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Ruth Neessen
Hello, Dmitry,Thank you so

Hello, Dmitry,

Thank you so much for your answer. I removed the old library and downloaded the SDK again. The problem still exists. Do you have any idea how to solve it? We need the software quite urgently.

Thanks a lot!

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Masood Sujau
Any Solution

Did you manage to find a solution? I am having the same issue.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Alexander Palchikov
Hello Masood,It's mainly a

Hello Masood,

It's mainly a Windows security issue.  Windows is blocking use of the USB HID interface to non admin users.  There may be settings in the account that can be adjusted to allow for direct USB, but there isn't much that can be done in the SDK.  The only other option is to switch the connection type to Driver rather than direct USB.  There are limitations to the driver interface, mainly speed, but it will allow for USB connections that should be able to get past the Windows security properly.

 

Alexander Palchikov
Software Engineer, Kutir Mobility
Posted on behalf of Zebra Technologies

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Masood Sujau
Using driver instead of Usb

Hi Alexander

Thanks for your response. What class should I be using to use the driver and avoid the windows security issue?

I can manually create DiscoveredPrinterDriver objects by using the code below:

List<DiscoveredPrinterDriver> printers = new List<DiscoveredPrinterDriver>();
string query = "SELECT * from Win32_Printer";
ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
ManagementObjectCollection collection = searcher.Get();
foreach (ManagementObject printer in collection)
{
string name = printer.Properties["Name"].Value.ToString();
string driverName = printer.Properties["DriverName"].ToString();
string port = printer.Properties["PortName"].ToString();

var driver = new DiscoveredPrinterDriver(name, driverName, new List<string>() { port });
printers.Add(driver);
}

but when the user picks a printer and then tries to connect to get the status I get an can not connect error for local accounts

DiscoveredPrinterDriver discoveredPrinter = User picked printer from the above list

Connection connection = discoveredPrinter.GetConnection();
connection.Open();
if (connection.Connected)
{
var printer = ZebraPrinterFactory.GetInstance(PrinterLanguage.ZPL, connection);
PrinterStatus status = printer.GetCurrentStatus();

}

Is there another way to connect and get the status? Can you please point me at some documentation for using driver based connections?

Cheers
Masood

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Alexander Palchikov
Hi Masood,I’ve tested it on

Hi Masood,

I’ve tested it on my Windows PC and you’re right, I can’t find and connect to my printer.
Fortunately, I’ve found a workaround that worked for me.
I used a demo of LinkOs SDK (“PATH_TO_SDK\PC-.NET\v2.15.2634\demos-desktop\Release”).
In “Discovery” tab I found my printer using “USB Direct”.
Then I copied printer name from left side block and pasted it to “Symbolic Name” field on “Connectivity” tab.
After that my PC managed to connect to the printer and print a test label.

I hope this will help you.
Also, be sure you use the latest version of SDK: LinkOS SDK

 

Alexander Palchikov
Software Engineer, Kutir Mobility
Posted on behalf of Zebra Technologies

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments