主题:  利用HostManage组件在线管理Windows用户

host001

职务:普通成员
等级:1
金币:0.0
发贴:10
#12003/9/27 14:07:11
组件下载地址http://www.w120.com/buy/down.htm
文章转自http://www.w120.com/product/readme04.htm

设定Windows用户属性:用户全名abc.com,用户名abc.com,用户密码abc.com,所属用户组Guests

添加Windows用户
<%
Dim obj
Dim b
set obj = server.createobject("HostManage.SiteManage")
b = obj.PostNTUser("adduser","abc.com","abc.com","abc.com","Guests")
if b then
response.write "成功"
else
response.write "失败"
end if
set obj = nothing
%>


编辑Windows用户
<%
Dim obj
Dim b
set obj = server.createobject("HostManage.SiteManage")
b = obj.PostNTUser("edituser","abc.com","abc.com","abc.com","Guests")
if b then
response.write "成功"
else
response.write "失败"
end if
set obj = nothing
%>


删除windows用户
<%
Dim obj
Dim b
set obj = server.createobject("HostManage.SiteManage")
b = obj.PostNTUser("deluser","abc.com","abc.com","abc.com","Guests")
if b then
response.write "成功"
else
response.write "失败"
end if
set obj = nothing
%>

把windows用户添加到Windows组里
<%
Dim obj
Dim b
set obj = server.createobject("HostManage.SiteManage")
b = obj.PostNTUser("addusertogroup","abc.com","abc.com","abc.com","Guests")
if b then
response.write "成功"
else
response.write "失败"
end if
set obj = nothing
%>

从Windows组里删除Windows用户
<%
Dim obj
Dim b
set obj = server.createobject("HostManage.SiteManage")
b = obj.PostNTUser("delusertogroup","abc.com","abc.com","abc.com","Guests")
if b then
response.write "成功"
else
response.write "失败"
end if
set obj = nothing
%>



janlay

职务:管理员
等级:7
金币:28.0
发贴:7244
#22003/9/27 14:57:27
警告楼上的,不要来发广告了,你提供的代码没有任何价值。如果需要的话,我可以免费提供我写的管理 window 系统用户的程序及文档!