LogonUser()在2003里面可以顺利调用,但是在2000里面缺少SE_TCB_NAME权限。资料上的说明建议从一个采用本地用户帐号运行的服务里面去调用,我不太理解,我的目标是能在WIONDOWS 2000上也能调用这个函数,请教该怎么弄。。
The LogonUser API has been available and documented since Windows NT 3.51, and is commonly used to verify user credentials. This API is available on Windows NT, Windows 2000, and Windows XP. Unfortunately, there are some restrictions on using LogonUser that are not always convenient to satisfy. The first and biggest of these restrictions is that on Windows NT and Windows 2000, the process that is calling LogonUser must have the SE_TCB_NAME privilege (in User Manager, this is the "Act as part of the Operating System" right). The SE_TCB_NAME privilege is very powerful and should not be granted to any arbitrary user just so that they can run an application that needs to validate credentials. The recommended method is to call LogonUser from a service that is running in the local system account, because the local system account already has the SE_TCB_NAME privilege.

解决方案 »

  1.   

    MS 建议你仅在Service里使用LogonUser吧,因为一般情况下服务是按 本地用户 这个账号执行的, 而这个账号默认有 SE_TCB_NAME权限
      

  2.   

    老大,那我该怎么做?搞个WINDOWS 服务还是WEB SERVICE?
      

  3.   

    看你做什么了啊,你要么给运行 LogonUser 的程序的帐户在策略管理器里加上这个权力,要么开个服务让这个服务来做LogonUser如果是用Web Service的话,你可能应当给ASP.NET这个用户加这个权力