|
-
Jun 24th, 2001, 10:22 AM
#1
Thread Starter
Addicted Member
-
Jun 24th, 2001, 02:27 PM
#2
Hey,
Why Don't U Use ADSI ?
There is function of the User object - "SetPassword".
Much Easier and the differences in the speed are minors.
-
Jun 24th, 2001, 02:34 PM
#3
Thread Starter
Addicted Member
How?
How can I use ADSI and what is it?
-
Jun 24th, 2001, 03:05 PM
#4
Hey,
ADSI is Actice Directory Service Interface.
It's few dll's that make the access to the network, the domain, computers, services and users real easy.
U can manage all your network with ADSI.
U Add a reference to "Active DS Type Library".
U define var as IadsUser, and when U'll right "MyVar." , U'll see it's properties.
-
Jun 27th, 2001, 02:30 PM
#5
Whoever wrote the api declaration did a poor job. BTW, there are some mistakes in the API viewer, but mostly they are correct.
Here is an example of using the NetUserChangePassword api.
Code:
Private Declare Function NetUserChangePassword Lib "netapi32.dll" (ByVal Domain As String, ByVal User As String, ByVal OldPass As String, ByVal NewPass As String) As Long
Private Sub Command1_Click()
Dim retVal As Long
Dim sDomain As String
Dim sUser As String
Dim sOldPass As String
Dim sNewPass As String
sDomain = vbNullString ' use the logon domain
sUser = StrConv("test123", vbUnicode) ' use vbNullString to change the currently logged on user's password
sOldPass = StrConv("test123", vbUnicode)
sNewPass = StrConv("123test", vbUnicode)
retVal = NetUserChangePassword(sDomain, sUser, sOldPass, sNewPass)
End Sub
PS if you want you can change the declaration to Public if you use a bas module for it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|