How to use NetUserChangePassword and NetUserSetInfo in VB.net

R

Rody Reulen

I would like to set the user password with one of the following API calls.

NetUserChangePassword
NetUserSetInfo

This is real brainteaser for me. I try to use VB script and also ADSI, but I
prefer to use these two API calls.

I am using a Windows 2000 Server and a Windows 2000 Client. Can
someone provide me with a little Visual Basic .dotnet example to start with.

Thanks in advance.

Kind regards,

Rody
 
M

Mattias Sjögren

Rody,

I don't have any sample code, but can provide the Declares you need if
that's any help.

Declare Unicode Function NetUserChangePassword Lib "netapi32"
(domainname As String, username As String, oldpassword As String,
newpassword As String) As Integer

For NetUserSetInfo, you'd have to say which information level you want
to work with.



Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top