Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

Thanks so much for having a place for us propeller heads to hang out and chat.

Geography

Where in the world do Tek-Tips members come from?
mzielinski1234 (IS/IT--Management)
26 Apr 12 7:38
Hello everyone,

I have an application which depends on EZ 100 PU smart card reader. The application may be installed as a service or run from command line. I created a service user for the application, installed it and configured logon account to this user. Application was unable to enumerate readers when I started it as a service.
Then I tried to start it in interactive mode. I used exactly the same user, same binary and it worked perfectly.

So, the question is - is anyone aware of any possible limitations, security settings or policies that may cause service not to be able to access hardware (or maybe drivers?). I'm pretty sure it has nothing to do with user permissions or hardware drivers, as that problem happens only when application is run as service.

Cheers,
Mike
Titleist (MIS)
26 Apr 12 17:52
You need to grant that account "Log on as a Service" rights through the Administrative Tools, Local Security Policy. It's found in the Local Policies/User Rights Assignments screen.

John
mzielinski1234 (IS/IT--Management)
27 Apr 12 3:57
John,

you are right, that is required, and thank you for the answer. However the reason was completely different - I found it myself, but probably others might use the solution as well, so here it is:

"SCardEstablishContext API is returning that error because it gets an Access Denied error when trying to open an event called "Global\Microsoft Smart Card Resource Manager Started" with OpenEvent API. The default security for that event on Vista and Windows 7 specifies that only SYSTEM, LOCAL SERVICE and INTERACTIVE users have access to it. NETWORK SERVICE or non-interactive users won't be able to access the event."

It's just a part of larger article which can be found here:
SCardEstablishContext fails with SCARD_E_NO_SERVICE error

Mike

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close