Hi,
I want to change the windows user password in a VB.net Module...
Just change it, how can i do that?
I want to change the windows user password in a VB.net Module...
Just change it, how can i do that?
Public Class Class1
<DllImport("netapi32.dll", CallingConvention:=CallingConvention.StdCall, CharSet:=CharSet.Unicode)> _
Public Shared Function NetUserChangePassword( _
<MarshalAs(UnmanagedType.LPWStr)> ByVal Domain As String, _
<MarshalAs(UnmanagedType.LPWStr)> ByVal User As String, _
<MarshalAs(UnmanagedType.LPWStr)> ByVal OldPass As String, _
<MarshalAs(UnmanagedType.LPWStr)> ByVal NewPass As String) As Integer
End Function
Public Sub ChangePassword(ByVal domain As String,
ByVal username As String,
ByVal oldPassword As String,
ByVal newPasword As String)
Try
NetUserChangePassword(domain, username, oldPassword, newPasword)
Catch ex As Exception
Throw
End Try
End Sub
End Class
Comment