NT添加帐号/修改密码/改变用户组及权限的方法,可以加到1000分(50分)

  • 主题发起人 主题发起人 smilboy
  • 开始时间 开始时间
S

smilboy

Unregistered / Unconfirmed
GUEST, unregistred user!
添加帐号/修改密码/改变用户组及权限的方法

以及如何打开关闭服务

设置IIS的根目录

请附原程序
可以加到1000分
 
nttools
http://www.torry.net/vcl/system/nt/nt.zip
 
可以使用netuseradd在WINNT中添加用户

type USER_INFO_1=record
usri1_name:pwidechar;
usri1_password:pwidechar;
usri1_password_age:dword;
usri1_priv:dword;
usri1_home_dir:pwidechar;
usri1_comment:pwidechar;
usri1_flags:dword;
usri1_script_path:pwidechar;
end;
buffer=^USER_INFO_1;
.....
procedure TForm1.Button1Click(Sender: TObject);
var buf:buffer;
error:pchar;
begin
getmem(buf,sizeof(USER_INFO_1));
with buf^ do
begin
usri1_name:='123e';
usri1_password:='123456789';
usri1_password_age:=0;
usri1_priv:=1;
usri1_home_dir:=nil;
usri1_comment:=nil;
usri1_flags:=1;
usri1_script_path:=nil;
end;
//netuseradd(nil,1,pointer(buf),
showmessage(inttostr(netuseradd(nil,1,pointer(buf),0)));
freemem(buf);
end;
 
或者是winexecute 也可以
看net.exe 的帮助文件(只能在nt下使用)

比如:
net user whaoye 123 /add //添加一个用户whaoye密码为add
net localgroup administrators whaoye /add //把whaoye 添加到administrators组里
net group mygroup /add //添加一个mygroup 的用户组。


配合 winexecute就可以搞定了
 
那还有修改密码/改变用户组及权限的方法呢?
 
改密码: net user whaoye 12345
把密码改为12345了。

删除组:net localgroup 组名 /delete
 
高手太多
 
用ADSI(Active Directory Service Interfaces)比较好,看看MSDN
 
to ypy:
能详细讲进吗?
 
我怎么用这段代码不认识netuseradd呢?
 
多人接受答案了。
 
后退
顶部