logonUser所需的SE_TCB_NAME权限在哪里设置?请帮

gsoft 2004-08-16 09:54:53
LogonUser 有一些限制,在Windows NT and Windows 2000, 调用LogonUser的进程必须有SE_TCB_NAME 权限 (在User Manager中, 这是"Act as part of the Operating System" 权限)。

请问上面所提的权限在哪里设置,我尝试在 程序->管理工具->计算机管理->本地用户和->用户 里找但没有找到,请高手指点,谢谢

请高手帮忙,这个函数我周围没有用过,直接调用logonUser会提示'客户没有所需的特权'
...全文
644 24 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
24 条回复
切换为时间正序
请发表友善的回复…
发表回复
ju1 2004-08-17
  • 打赏
  • 举报
回复
privilege 是权限的意思啊
gsoft 2004-08-17
  • 打赏
  • 举报
回复
上面这句话是指有效策略选项不必enabled吗?
gsoft 2004-08-16
  • 打赏
  • 举报
回复
你用的delphi是哪个版本?
gsoft 2004-08-16
  • 打赏
  • 举报
回复
那是为什么呢?

我增加这个权限后,发现administrator的本策略设置为enabled,但有效策略设置项目为disabled,而且无法使它变成enabled的,与这个有关吗,我看帮助是这样写的
Remarks

The process that calls LogonUser must have the SE_TCB_NAME privilege. The privilege does not need to be enabled. The LogonUser function enables the privilege as necessary. The function fails if the calling process does not have the SE_TCB_NAME privilege, and GetLastError returns the error code ERROR_PRIVILEGE_NOT_HELD. For more information about privileges, see Privileges.

应该是没有关吧
jinjazz 2004-08-16
  • 打赏
  • 举报
回复
"以操作系统方式操作"
=====================================================比如xxx是我的密码
var handle:Thandle;
begin

if LogonUser('administrator' , '.' , 'xxx', LOGON32_LOGON_INTERACTIVE ,LOGON32_PROVIDER_DEFAULT , handle) then
begin
ShowMessage('创建用户成功');
end
else
begin
ShowMessage(SysErrorMessage(GetLastError()));//提示‘客户没有所需的特权'
end;
end;

=========================================================
我的机器显示成功的
gsoft 2004-08-16
  • 打赏
  • 举报
回复
to 楼上太感谢你了

我现在把这个权限指给administrator了,也重新启动了,但是logonUser还是返回false,
syserrorMessage(getLastError)提示‘客户没有所需的特权'
源代码如下:
if LogonUser('administrator' , '.' , 'aaa', LOGON32_LOGON_INTERACTIVE , LOGON32_PROVIDER_DEFAULT , handle) = true then
begin
ShowMessage('创建用户成功');
end
else
begin
ShowMessage(SysErrorMessage(GetLastError()));//提示‘客户没有所需的特权'
end;

这是为什么?谢谢
jinjazz 2004-08-16
  • 打赏
  • 举报
回复
以操作系统操作...
,必须重新启动
gsoft 2004-08-16
  • 打赏
  • 举报
回复
to 楼上,SE_TCB_NAME 在管理工具-本地安全策略-本地策略-用户权利指派这里也没有找到呀,中文权限名是什么?
谢谢
jinjazz 2004-08-16
  • 打赏
  • 举报
回复
win2000 server
管理工具-本地安全策略-本地策略-用户权利指派
gsoft 2004-08-16
  • 打赏
  • 举报
回复
我试试,感谢楼上我试试
fei19790920 2004-08-16
  • 打赏
  • 举报
回复
这个我研究过,可惜没有成功,下面是转贴:
如果是机器的网络密码(如WinNT或Win2000):
可用:
登录计算机的方法
WinExec(Pchar('net use \\computername password /user:username',sw_Hide);
注销计算机的方法
WinExec(Pchar('net use \\computername /delete',sw_Hide);
===============================================
如果是共享文件夹的密码:
可用:
var NRW: TNetResource;
begin
with NRW do
begin
dwType:= RESOURCETYPE_ANY;
lpLocalName:=PChar(LocalDriver);
lpRemoteName:=PChar(ShareName);
lpProvider:='';
end;
result := WNetAddConnection2(NRW, PChar(Password), PChar(UserName), CONNECT_UPDATE_PROFILE);
end;
gsoft 2004-08-16
  • 打赏
  • 举报
回复
logonUser api 函数是用过验证用户的
我现在是想通过程序从客户端访问服务器上的共享文件夹中的文件,从csdn上查了一些资料,最后知道是用logonUser这个api函数,但是调用这个api函数,需要有SE_TCB_NAME个权限,而我不知道在哪里给用户授予这个权限

对不起我上面没有说清楚
fei19790920 2004-08-16
  • 打赏
  • 举报
回复
我要知道你到底想干什么
gsoft 2004-08-16
  • 打赏
  • 举报
回复
请帮忙呀.............
gsoft 2004-08-16
  • 打赏
  • 举报
回复
高手快来呀
gsoft 2004-08-16
  • 打赏
  • 举报
回复
The process that calls LogonUser must have the SE_TCB_NAME privilege. The privilege does not need to be enabled. The LogonUser function enables the privilege as necessary. The function fails if the calling process does not have the SE_TCB_NAME privilege, and GetLastError returns the error code ERROR_PRIVILEGE_NOT_HELD. For more information about privileges, see Privileges.


The privilege does not need to be enabled.这句话是什么意思?
gsoft 2004-08-16
  • 打赏
  • 举报
回复
我感觉好象应该和delphi版本没有关系是windows的事
ju1 2004-08-16
  • 打赏
  • 举报
回复
微软接口没开好 偶们焦头烂额!
gsoft 2004-08-16
  • 打赏
  • 举报
回复
环境一样呀,我是瑞星
奇怪了
再给贴子加点分,
jinjazz 2004-08-16
  • 打赏
  • 举报
回复
本地用户,win2000 server,sp4,诺顿,
加载更多回复(4)

1,184

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧