高分求救,大家帮帮忙,很急,所以200分相送

漫步彩云之端 2003-08-25 03:50:12
帮帮忙,前段时间看了一网上的例子,FTP是创建上了,只是用户不知道怎么搞的弄不上,我的机器不是在域里的,是用的工作组,不知道有没有关系
Private Sub Command1_Click()
CreateUser "mygold.WORKGROUP", "DC=WORKGROUP", "testftp", "123", "test", "ftp"
CreateFtpSite "mygold", "WORKGROUP", "d:\", "NewFTPSite", 24, True, 2, "testftp", "123"
End Sub
Public Function CreateUser(ByVal strServerFullName As String, ByVal strDomainName As String, ByVal strLoginName As String, ByVal strPassword As String, ByVal strFirstName As String, ByVal strLastName As String) As Integer
Dim objUser As IADsUser
Dim objContainer As IADsContainer
Dim recip As String
Dim Child, objGroup As Object
recip = "CN=" & strLoginName
'得到指定的用户容器
MsgBox "LDAP://" + strServerFullName + "/CN=Users," + strDomainName
Set objContainer = GetObject("LDAP://" + strServerFullName + "/CN=Users," + strDomainName)
'检查要创建的用户是否存在
For Each Child In objContainer
If LCase(Right(Child.Name, Len(Child.Name) - 3)) = LCase(strLoginName) Then CreateUser = 1: Exit Function
Next
'创建用户
Set objUser = objContainer.Create("User", recip)
objUser.Put "samAccountName", strLoginName
objUser.Put "sn", strLastName
objUser.Put "givenName", strFirstName
objUser.Put "userPrincipalName", strLoginName
objUser.Put "userAccountControl", 66048
objUser.SetInfo
objUser.SetPassword strPassword
objUser.AccountDisabled = False
objUser.SetInfo
CreateUser = 0
End Function
这是我调试的代码,不知道错在哪

答完领分可以到
http://expert.csdn.net/Expert/topic/2180/2180448.xml?temp=.3670923
...全文
35 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
Primer2002cn 2003-12-09
  • 打赏
  • 举报
回复
先将程序在VB里面调用通过,AUTOMATION错误,这里有相似接口,如果需要的话MAIL吧?
msn:visualbasicme@sina.com.cn
mail:zhongxinchang@sohu.com
yllaji 2003-12-09
  • 打赏
  • 举报
回复
你的程序 在 VB里调试 有没有问题?

没有问题 但是 asp 调用时出问题的话

估计原因是 IIS 本身 是 guest权限的,不能建立用户。

解决方法:

将 IUSR_ 和 IWAM_ 加入 administrator 组
hohott 2003-08-28
  • 打赏
  • 举报
回复
没有足够权限
topmonkey 2003-08-28
  • 打赏
  • 举报
回复
Private Sub Command1_Click()
CreateUser "mygold.WORKGROUP", "DC=WORKGROUP", "testftp", "123", "test", "ftp"
CreateFtpSite "mygold", "WORKGROUP", "d:\", "NewFTPSite", 24, True, 2, "testftp", "123"
End Sub
Public Function CreateUser(ByVal strServerFullName As String, _
ByVal strDomainName As String, _
ByVal strLoginName As String, _
ByVal strPassword As String, _
ByVal strFirstName As String, _
ByVal strLastName As String) As Integer
Dim objUser As IADsUser
Dim objContainer As IADsContainer
Dim recip As String
Dim Child, objGroup As Object
recip = "CN=" & strLoginName
'得到指定的用户容器
MsgBox "LDAP://" + strServerFullName + "/CN=Users," + strDomainName
Set objContainer = GetObject("LDAP://" + strServerFullName + "/CN=Users," + strDomainName)
'检查要创建的用户是否存在
For Each Child In objContainer
If LCase(Right(Child.Name, Len(Child.Name) - 3)) = LCase(strLoginName) Then
CreateUser = 1
Exit Function
End If
Next
'创建用户
Set objUser = objContainer.Create("User", recip)
objUser.Put "samAccountName", strLoginName
objUser.Put "sn", strLastName
objUser.Put "givenName", strFirstName
objUser.Put "userPrincipalName", strLoginName
objUser.Put "userAccountControl", 66048
objUser.SetInfo
objUser.SetPassword strPassword
objUser.AccountDisabled = False
objUser.SetInfo
CreateUser = 0
End Function
bananasmiling 2003-08-28
  • 打赏
  • 举报
回复
这和域帐户没有多少区别啊..
最主要是你有没有这个权限去创建用户..
tiggle 2003-08-28
  • 打赏
  • 举报
回复
你是用域管理员权限登录的吗
ryuginka 2003-08-28
  • 打赏
  • 举报
回复
控件注册
tripofdream 2003-08-26
  • 打赏
  • 举报
回复
域服务器使用域,域成员应该使用机器名
漫步彩云之端 2003-08-26
  • 打赏
  • 举报
回复
是不是活动目录服务
漫步彩云之端 2003-08-26
  • 打赏
  • 举报
回复
我的机器已经加入到域里了,但还是提示一样的错误
加入域后我这么调函数,不知道对不对
CreateUser "mygold.caii.edu.cn", "DC=caii,DC=edu,DC=cn", "testftp", "123", "test", "ftp"
to:tigerwen01,你是指什么服务?
tigerwen01 2003-08-26
  • 打赏
  • 举报
回复
服务没有开启
漫步彩云之端 2003-08-26
  • 打赏
  • 举报
回复
出错提示是:
Automation error
The server is not operational
漫步彩云之端 2003-08-26
  • 打赏
  • 举报
回复
我的机器名是mygold,域是caii.edu.cn,但是我在域服务器上建的帐号是xygqlc
Primer2002cn 2003-08-25
  • 打赏
  • 举报
回复
出错提示是什么呢?

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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