473,378 Members | 1,412 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

How to change the windows user password with VB.NET

Hi,
I want to change the windows user password in a VB.net Module...
Just change it, how can i do that?
Apr 14 '12 #1

✓ answered by cherry11

Hello,
To change windows password has many methods, but i don't know how to change windows user password with VB.NET.

I suggeset you google search for Smartkey Product Key Recovery to change windows password.

4 9915
PsychoCoder
465 Expert Mod 256MB
You're going to need to use the NetUserChangePassword Win32 API call for this to work. Here's a simple demonstration on using that API:

Expand|Select|Wrap|Line Numbers
  1. Public Class Class1
  2.     <DllImport("netapi32.dll", CallingConvention:=CallingConvention.StdCall, CharSet:=CharSet.Unicode)> _
  3.     Public Shared Function NetUserChangePassword( _
  4.          <MarshalAs(UnmanagedType.LPWStr)> ByVal Domain As String, _
  5.          <MarshalAs(UnmanagedType.LPWStr)> ByVal User As String, _
  6.          <MarshalAs(UnmanagedType.LPWStr)> ByVal OldPass As String, _
  7.     <MarshalAs(UnmanagedType.LPWStr)> ByVal NewPass As String) As Integer
  8.     End Function
  9.  
  10.     Public Sub ChangePassword(ByVal domain As String, 
  11.         ByVal username As String,
  12.         ByVal oldPassword As String,
  13.         ByVal newPasword As String)
  14.  
  15.         Try
  16.             NetUserChangePassword(domain, username, oldPassword, newPasword)
  17.         Catch ex As Exception            
  18.             Throw
  19.         End Try
  20.  
  21.  
  22.     End Sub
  23. End Class
You're be using the System.Runtime.InteropServices

That should get you started down the right path
Apr 15 '12 #2
Thank you!
But is there a way to do that, without knowing the old password?
Apr 16 '12 #3
PsychoCoder
465 Expert Mod 256MB
No there isn't. This is starting to sound like a malicious act the more that get's asked.
Apr 16 '12 #4
No, no, not at all!
It's a little program I have made to level up the privacy of my computer.
I wanted to generate a random code as a password that would be sent to my email...
Apr 17 '12 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: yabba | last post by:
Is there a way to supply a nt/windows user/password combo in a url for an automatic login to a nt user/password secured site? Something like http://mysite.comuser=mepassword=mypassword =...
4
by: Srikanth | last post by:
Hi All, Can any one tell me how to change windows user account password by programmatically using C#? I don't have administrator privileges and I want to change my account password by...
1
by: NWx | last post by:
Hi, I'm an old developer, but didn't used SQL Server or MSDE to much before. I have NetSDK instance of MSDE installed on my PC by Net Framework SDK. All quickstart samples access it using...
1
by: TheBurgerMan | last post by:
I have an ASP.NET/C# web site that the user has logged into using my own logon page. How do I set the current web request to use the credentials the user has just provided? -- Thanks,...
2
by: J | last post by:
Hello. I apologize if this isn't the appropriate group for this question but I was wondering if it's possible to allow regular windows domain users to change their passwords through an .asp page? ...
7
by: Marc Solé | last post by:
Hello all, I have a web application that runs in a server and makes a Windows user validation to loggin. My question is, how can I get that loggin user, password and domanin to use it in my...
0
by: kustavo | last post by:
Good day. I would like to know if there is an API i can use to change windows service to run under LocalSystem account from a user account. Currently I am using the API below to change the service...
0
by: geoharish | last post by:
Dear All, I started using Python just a few days back and there was a requirement of an assigned project to change the user Password through script without user interaction. I could write the...
1
by: papo | last post by:
Hi, i need help i need change 100 user password for windows 2003 domain, i have excel list the script need read and modify user by user. Tk for your help
3
by: John | last post by:
Hi Is there a way to get the password of the currently logged in user? Thanks Regards
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.