使用active ds type library和wmi,适用于win2000 http://www.ourfly.com/bbs/dispbbs.asp?boardID=5&ID=169下载下面是增加的 Dim dso As IADsOpenDSObject username = frmdomainlogin.Text1.Text password = frmdomainlogin.Text2.Text DomainName = frmdomainlogin.Combo1.TextDim container As IADsContainer Dim containername As String Dim user As IADsUser Dim newuser As String containername = frmdomainlogin.Combo1.TextIf frmdomainlogin.Check1.Value = 1 Then Set container = GetObject("WinNT://" & containername) Else Set dso = GetObject("WinNT:") Set container = dso.OpenDSObject("WinNT://" & containername, username, password, 0) End Ifnewuser = Text1.Text Set user = container.Create("User", newuser) user.SetInfo
http://www.ourfly.com/bbs/dispbbs.asp?boardID=5&ID=169下载下面是增加的
Dim dso As IADsOpenDSObject
username = frmdomainlogin.Text1.Text
password = frmdomainlogin.Text2.Text
DomainName = frmdomainlogin.Combo1.TextDim container As IADsContainer
Dim containername As String
Dim user As IADsUser
Dim newuser As String
containername = frmdomainlogin.Combo1.TextIf frmdomainlogin.Check1.Value = 1 Then
Set container = GetObject("WinNT://" & containername)
Else
Set dso = GetObject("WinNT:")
Set container = dso.OpenDSObject("WinNT://" & containername, username, password, 0)
End Ifnewuser = Text1.Text
Set user = container.Create("User", newuser)
user.SetInfo
http://expert.csdn.net/Expert/topic/2848/2848880.xml?temp=.7908441