How to logon Windows in .NET

L

LongRunner

Hi, I am writing an application that contains a logon function. I want to
use the Windows Logon account to logon my application. Does .NET provide
classes for me to do it? In fact, i am using the WINAPI LogonUser to do this
but i found that the function cannot work in Window2000, It return Error
code:1314 "A required privilege is not held by the client."
And i don't know how to fix it.

Can tell me how to do it in .NET? And can teach me how to solve my error.
Thx a lot of.
 
V

Vladimír Lehocký

The process calling LogonUser requires the SE_TCB_NAME privilege.
Read remark section for LogonUser function in MSDN

Vlado
 
V

Vladimír Lehocký

The account under which impersonating process is running must have "Act As
Part Of The Operating System" (SE_TCB_NAME) privilege. That privilege you
must set manualy in Local Security Policy mmc snap-in. You can find it under
LocalPolicies/User Righs Assignments
 
C

Chris Hornberger

Check out the System.Security.Principal namespace... the
System.Security.Principal.WindowsIdentity class in particular should
get you where you need to be.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top