How to check if Current User logged on with Smartcard

INSERTO
INSERTO used Ask the Experts™
on
How can i check (from Code) if the currenlty logged on user used a Smartcard to Logon?
Some C#/Vb.net code example would be nice, but c/c++ code is ok to.

If the User logged on via Smartcard the Function should return true, if he logged on with username and passwort only it sould return false.

Any help is appreciated
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Cryptographic Engineer
Commented:
Read this:
http://blogs.msdn.com/spatdsg/archive/2006/09/06/739854.aspx

Alternatively, you could move the workstations that should be SClogon only into their own OU and apply GPO to Force smartcard logon:enabled, along with lock or logout upon SC removal, etc.  From the sound of your question, I'm guessing this is probably too invasive for what you are trying to accomplish, however.

Author

Commented:
thanks for your hint
i'll check if the SMARTCARD environment variable is set in our environment

Author

Commented:
Because the Customer uses Windows 7 the SMARTCARD environment variable ist unfortunately not available.
Any other ideas?

Author

Commented:
we got it working by reading the server eventlog from the client.
but now we also need a solution for clients running "offline" e.g. running from home not reaching the domain controller.
are there local event log entries which could be used to evaluate if a smartcard was used for logon?


Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial