473,388 Members | 1,426 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,388 software developers and data experts.

Change current users password?

I am looking for a way to allow the currently logged in user to change
his/her password. Is there an API I can interop to in c#?

Tia!
Nov 16 '05 #1
2 3540
Ram
You want to change it's password where - on WinNT? ActiveDirectory?

--Ram
"news.microsoft.com" <no**@none.com> wrote in message
news:#C**************@TK2MSFTNGP11.phx.gbl...
I am looking for a way to allow the currently logged in user to change
his/her password. Is there an API I can interop to in c#?

Tia!

Nov 16 '05 #2

"Ram" <ni***@bezeqint.net> wrote in message
news:OM**************@TK2MSFTNGP11.phx.gbl...
You want to change it's password where - on WinNT? ActiveDirectory?

--Ram


Both. I figgured out the code last night. Hopefully this will help someone
else!
// Allows password change for domain or local system
[DllImport("netapi32.dll", CharSet=CharSet.Auto)]
private extern static int NetUserChangePassword(
[MarshalAs(UnmanagedType.LPWStr)] string domainName, // set to null for
local machine/domain
[MarshalAs(UnmanagedType.LPWStr)] string userName, // set to null for
local user
[MarshalAs(UnmanagedType.LPWStr)] string oldPass,
[MarshalAs(UnmanagedType.LPWStr)] string newPass);
Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Max | last post by:
Hi, What is the best way to change passwords via php? I was first thinking of using the chpasswd function, but even though I added an entry for apache to be able to run chpassword vi visudo,...
2
by: Danny | last post by:
Hello I am looking for an asp change password solution. I know there are very efficient ways of doing it and perhaps you have some samples or ideas. Basically I would like the user to be able...
12
by: Arno R | last post by:
Hi there, I just distributed an application in which I (try to) change db.properties depending on CurrentUser() For instance I set the property's AllowBypassKey and AllowBuiltinToolbars to False...
10
by: Fabrizio | last post by:
(Sorry for the crosspost, but I really don't know which is the right newsgroup!) Hi all, I try to change the password to a user that as to change the password at first logon: try {
5
by: Ram | last post by:
Hey, I'v managed to set the "User Must Change Password At Next Logon" flag on the LDAP protocol, Using the - "pwdLastSet" property - by setting it to - "0" (for on) or - "-1" (for off). The...
6
by: Evgeny Zoldin | last post by:
Hi ALL. I have the configuration: 1. WinXP PRO with MS IIS 5.0 and installed ASP.NET 2. ASP.NET application A configured to authenticate only users from local Users group. I would like to de...
0
by: Yannick Béot | last post by:
Hi, I'm trying to make an application that allow a user, through a web form to change its password On a click event, here is the code DirectoryEntry usr = new DirectoryEntry( theUserDN,...
6
by: Jan | last post by:
Hi: I have created a secured database for a client. For various reasons, I don't want the client to have full persmissions for the database; they aren't in the admins group. I have instead tried...
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? ...
1
by: eighthman11 | last post by:
Hi everyone: I created a custom toolbar called Password, so users can change their password. I used the Command "User and Group Accounts". I know the user can not change anything in the Tab...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.