高分求救,大家帮帮忙,很急,所以200分相送
帮帮忙,前段时间看了一网上的例子,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