473,387 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to logon Windows in .NET

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.
Nov 15 '05 #1
3 6322
The process calling LogonUser requires the SE_TCB_NAME privilege.
Read remark section for LogonUser function in MSDN

Vlado

"LongRunner" <ja**@flexsystem.com> wrote in message
news:et**************@TK2MSFTNGP11.phx.gbl...
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.

Nov 15 '05 #2
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

"LongRunner" <ja**@flexsystem.com> wrote in message
news:ez**************@TK2MSFTNGP11.phx.gbl...
Thx for your reply. In fact, i know the process require the SE_TCB_NAME.
However, i don't know how to set it. Also, I perfer use the >NET classes to perform this action more than the WINAPI. Does .NET provided class to do it?

<Vladimír Lehock? <le*****@gmx.net>> ¦b¶lĄó
news:uY****************@tk2msftngp13.phx.gbl ¤¤Ľ¶Ľg...
The process calling LogonUser requires the SE_TCB_NAME privilege.
Read remark section for LogonUser function in MSDN

Vlado

"LongRunner" <ja**@flexsystem.com> wrote in message
news:et**************@TK2MSFTNGP11.phx.gbl...
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.



Nov 15 '05 #3
Check out the System.Security.Principal namespace... the
System.Security.Principal.WindowsIdentity class in particular should
get you where you need to be.

"LongRunner" <ja**@flexsystem.com> wrote in message news:<ez**************@TK2MSFTNGP11.phx.gbl>...
Thx for your reply. In fact, i know the process require the SE_TCB_NAME.
However, i don't know how to set it. Also, I perfer use the >NET classes to
perform this action more than the WINAPI. Does .NET provided class to do it?

Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: W Akthar | last post by:
Hi All, I have written a windows service which runs a small windows application. This windows application queries a sql server database and depending on these results, sets appointments in...
4
by: \Rob\ | last post by:
On a domain controller, the ASPNET (v1.1) worker process (aspnet.wp.exe) runs under the IWAM_machinename acount (IIS 5). I have expressly denied this user the logon locally right in the domain...
10
by: et | last post by:
I have an asp.net program that uses a connection string, using integrated security to connect to a sql database. It runs fine on one server, but the other server gives me the error that "Login...
0
by: PhilHip | last post by:
I've written a Windows service in VB.Net that accesses the global address list to obtain all the entries to store them in a local database. The GAL is accessed using the MS Exchange profile on the...
0
by: bonita | last post by:
I come across the error "CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed." After I move my asp.net code from the development platform (XP professional) to the production web...
0
by: robpimentel | last post by:
Hi, I've been using DB2 for about 1 week, so please bear with me. DB2 Connect Enterprise Edition v8.1 FixPack 5 Windows Server 2003 Standard Edition SP1 Here is an error that continues to...
2
by: Robert Scheer | last post by:
Hi. I need to write a service that writes to a database the time of the logon and logoff of the users. Our users logs on Active Directory and some can also log as local administrators. The...
8
by: HDI | last post by:
Hi, We are working with Office 2003 and for our access apps we logon with the classic access security. The username and password is the same as windows logon. Is it possible that access check...
5
by: drummerpunk10 | last post by:
Sorry if this is off topic, I haven't really used this forum a lot so I don't know where to put it. Anyways I have a game application that runs off a list games and users on a file, that I built in...
1
by: =?Utf-8?B?ZGpjYXNlbGV5?= | last post by:
I'm trying to write a service that will sit on the domain controller (or, if this proves to be impossible, to be rolled to all connecting Windows machines). It needs to get notification of each...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.