为了达到个人帐户的统一,在登陆应用系统之前,要求输入合法的域用户名和口令,只有验证通过之后,才可以登陆应用程序,获取相应的权限。
我查找有Logonuser似乎可以实现,但是却没有SE_TCB_NAME privilege,看下面的注释:Res: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. 两个问题:
1、如果采用LogonUser,怎么配置SE_TCB_NAME权限;
2、是否有更好的方式实现域用户的验证?高分求教,多谢!
我查找有Logonuser似乎可以实现,但是却没有SE_TCB_NAME privilege,看下面的注释:Res: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. 两个问题:
1、如果采用LogonUser,怎么配置SE_TCB_NAME权限;
2、是否有更好的方式实现域用户的验证?高分求教,多谢!
你说的没错,登陆系统之后就验证了该用户的合法性。但是用该用户登录操作系统之后,就只能以该用户的身份登陆应用系统了。而不同的用户在应用系统的权限也是不一样的,换一句话,不同的用户在应用系统中拥有不同的功能。Windows NT 的密码相对来说,比别的系统的密码要安全。同时在整个企业有很多不同的系统在运行,难道一个人要为不同的系统定义不同的帐号和密码么?你自己想想这有没有效率?我要解决的办法,UP!
你的意思是不是这样:
在企业中(局域网中)可能会存在多个系统,如ERP、OA等等,你要让企业内所有用户统一登陆用户和密码,即只在登陆域(或局域网)时设置帐户和密码,其它系统自动分配相应权限?如果是这种想法,我认为很难实现,也没有意义。因为不同的系统有不同的权限分配,分配方法及复杂程度不一而足,岂能是一域帐户设置能做到的,
再者即使这样做了,有带来了什么方便呢?仅仅是少了相应系统的登陆用户名和密码而已,其权限分配工作还是得进行。
能具体说说是怎么实现的吗,我也要用。
请问ADSI在98下能通过吗?
小弟也碰到过这种情况,win2000和xp下没有任何问题,98下就不行了。安装了DSClient也不行。并且用微软的示例程序(VB版的)也不能通过。提示系统不支持。
98是登录到域中了的。
拜托指教!需要分尽管说,我愿以全部分相送!
或者是IMPORT ACTIVEX 控件,系统自动生成 ActiveDs_TLB.PAS
(记不清楚了,因为我在NT 4.0)我有一段源代码,就是怎么验证NT用户的(记得USE ActiveDs_TLB),不过用户不输入密码的话,也能通过验证,所以应该限制条件.procedure TfrmLogin.CheckCurrentVersion;
{***************************************
Purpose:
To Control The Client Version.
If Server Version Updated ,then Forece Client to update
,Otherwise forbid login Please Modify the Num same as the Server Num.
****************************************}
var
sSQL:string;
bNew:WordBool;//For Check NT User Account
szUsername,szPassword:string;
mPath: WideString;
mAdsObj: IADsOpenDSObject;
mResult: HRESULT;
pDisp:IDispatch;
//End
begin
dmMain.sckMain.AppServer.CheckVersion(5,bNew);
if bNew then
begin
Try
Screen.Cursor:=-11;
with dmMain.cdPublic do
begin
sSQL:='Select * from mfg_int_user where userid='''+UpperCase(edtUserId.text)+'''';
CommandTExt:=sSQL;
Open;
if RecordCount=0 then
begin
Application.MessageBox('Invalid User Id,Please check and try again','Warning',MB_OK+MB_ICONStop);
Close;
Exit;
end else
begin
szUsername:=edtUserid.text;
szPassword:=edtPassword.text;
mPath:='WinNT:';
mResult := ADsGetObject(PWideChar(mPath),
IID_IADsOpenDSObject,
IUnknown(mAdsObj));
if (SUCCEEDED(mResult)) then
begin
try
pDisp:=mAdsObj.OpenDSObject('WinNT://CODE1',szUsername,szPassword,
ADS_SECURE_AUTHENTICATION); Except
on E: Exception do
begin
Application.MessageBox(Pchar(E.Message),'Warning',MB_OK+MB_ICONStop);
Close;
Exit;
end;
end;
end;
isGroup:=FieldByName('isGroup').asstring;
pitem:=FieldByName('pitem').asstring;
Close;
end; end;
if (UserID<>'') then
dmMain.sckMain.AppServer.Unregisterserver(Userid,LoginTime);
GetComputerNameIP;
Userid:=UpperCase(edtUserid.Text);
ModalResult:=mrOk;
Finally
Screen.Cursor:=crDefault;
end;
end
else
Application.MessageBox('Please Update the Application to New Version!Otherwise you can''t use it','Warning',MB_OK+MB_ICONStop);
end;