473,397 Members | 2,077 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,397 software developers and data experts.

yet another change password thread

Hi Guys

Here is the problem: Im bored changing the local administrator password
for a set of servers in a domain.
So I though that I would write myself a little tool in C# to do that.

I found bits and pices but the subject, but not anything solid. Ofcause
its out there :-) can anybody help me out on this.

Thanks!

/Anders

Apr 2 '06 #1
6 2174
Anders,

You can just call the NetUserChangePassword API through the P/Invoke
layer. Here is a thread archived on google which gives more information:

http://groups.google.com/group/micro...914ef0e7e9b721

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<a_*****************@yahoo.dk> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
Hi Guys

Here is the problem: Im bored changing the local administrator password
for a set of servers in a domain.
So I though that I would write myself a little tool in C# to do that.

I found bits and pices but the subject, but not anything solid. Ofcause
its out there :-) can anybody help me out on this.

Thanks!

/Anders

Apr 2 '06 #2
Check the System.DirectoryServices namespace classes.
Here's a sample, note that you need the existing password in order to be ale
to change a password!!

...
string account = "Administrator";
using(DirectoryEntry AD = new DirectoryEntry("WinNT://" +
Environment.MachineName + ",computer")
{
DirectoryEntry user = AD.Children.Find(account, "User");
object[] password = new object[] {"myoldpwd", "mynewpwd"};
object ret = user.Invoke("ChangePassword", password );
user.CommitChanges();
}
....

Willy.

<a_*****************@yahoo.dk> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
| Hi Guys
|
| Here is the problem: Im bored changing the local administrator password
| for a set of servers in a domain.
| So I though that I would write myself a little tool in C# to do that.
|
| I found bits and pices but the subject, but not anything solid. Ofcause
| its out there :-) can anybody help me out on this.
|
| Thanks!
|
| /Anders
|
Apr 4 '06 #3
I've lost my adminstor password.
Any way I can change it without knowing the present one?

thanks
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:O4**************@TK2MSFTNGP12.phx.gbl...
Anders,

You can just call the NetUserChangePassword API through the P/Invoke
layer. Here is a thread archived on google which gives more information:

http://groups.google.com/group/micro...914ef0e7e9b721

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<a_*****************@yahoo.dk> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
Hi Guys

Here is the problem: Im bored changing the local administrator password
for a set of servers in a domain.
So I though that I would write myself a little tool in C# to do that.

I found bits and pices but the subject, but not anything solid. Ofcause
its out there :-) can anybody help me out on this.

Thanks!

/Anders


Apr 23 '06 #4
There is a way, and not a single one:

http://www.google.sk/search?hl=sk&q=...password&meta=

" Netter" <ne**********@a-znet.com> wrote in message
news:eW**************@TK2MSFTNGP02.phx.gbl...
I've lost my adminstor password.
Any way I can change it without knowing the present one?

thanks
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:O4**************@TK2MSFTNGP12.phx.gbl...
Anders,

You can just call the NetUserChangePassword API through the P/Invoke
layer. Here is a thread archived on google which gives more information:

http://groups.google.com/group/micro...914ef0e7e9b721

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<a_*****************@yahoo.dk> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
Hi Guys

Here is the problem: Im bored changing the local administrator password
for a set of servers in a domain.
So I though that I would write myself a little tool in C# to do that.

I found bits and pices but the subject, but not anything solid. Ofcause
its out there :-) can anybody help me out on this.

Thanks!

/Anders



Apr 23 '06 #5
I've looked and never found anything I understood that seemed like it would
work to change it.

I was hoping that I might be able to chang it even if I could not retreive
the old one.
thanks
"Lebesgue" <le******@gmail.com> wrote in message
news:uu**************@TK2MSFTNGP04.phx.gbl...
There is a way, and not a single one:

http://www.google.sk/search?hl=sk&q=...password&meta=

" Netter" <ne**********@a-znet.com> wrote in message
news:eW**************@TK2MSFTNGP02.phx.gbl...
I've lost my adminstor password.
Any way I can change it without knowing the present one?

thanks
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:O4**************@TK2MSFTNGP12.phx.gbl...
Anders,

You can just call the NetUserChangePassword API through the P/Invoke
layer. Here is a thread archived on google which gives more
information:

http://groups.google.com/group/micro...914ef0e7e9b721

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<a_*****************@yahoo.dk> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
Hi Guys

Here is the problem: Im bored changing the local administrator password
for a set of servers in a domain.
So I though that I would write myself a little tool in C# to do that.

I found bits and pices but the subject, but not anything solid. Ofcause
its out there :-) can anybody help me out on this.

Thanks!

/Anders



Apr 23 '06 #6
You can, just choose one of the results from the query I've given you. Most
of the solutions are in form of a tiny unix based operating system which is
able to read from protected parts of the windows registry, and effectively
change the password by setting the administrator password hash in registry.

" Netter" <ne**********@a-znet.com> wrote in message
news:uF**************@TK2MSFTNGP03.phx.gbl...
I've looked and never found anything I understood that seemed like it
would work to change it.

I was hoping that I might be able to chang it even if I could not retreive
the old one.
thanks
"Lebesgue" <le******@gmail.com> wrote in message
news:uu**************@TK2MSFTNGP04.phx.gbl...
There is a way, and not a single one:

http://www.google.sk/search?hl=sk&q=...password&meta=

" Netter" <ne**********@a-znet.com> wrote in message
news:eW**************@TK2MSFTNGP02.phx.gbl...
I've lost my adminstor password.
Any way I can change it without knowing the present one?

thanks
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:O4**************@TK2MSFTNGP12.phx.gbl...
Anders,

You can just call the NetUserChangePassword API through the P/Invoke
layer. Here is a thread archived on google which gives more
information:

http://groups.google.com/group/micro...914ef0e7e9b721

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<a_*****************@yahoo.dk> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
> Hi Guys
>
> Here is the problem: Im bored changing the local administrator
> password
> for a set of servers in a domain.
> So I though that I would write myself a little tool in C# to do that.
>
> I found bits and pices but the subject, but not anything solid.
> Ofcause
> its out there :-) can anybody help me out on this.
>
> Thanks!
>
> /Anders
>



Apr 23 '06 #7

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

Similar topics

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...
2
by: MLH | last post by:
What's the simplest way to allow a user of an A97 app to change password?
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...
4
by: James | last post by:
I succesfully pass username , domain and password via this function (taken from MSDN) Private Declare Auto Function LogonUser Lib "advapi32.dll" (ByVal lpszUsername As , _ ByVal lpszDomain As...
10
by: dana lees | last post by:
Hello, I am developing a C# asp.net application. I have a webform which contains 2 dropdowns and a textbox with type="password". On "SelectedIndexChanged" event of the first dropdown, there is...
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? ...
0
by: shellegreen | last post by:
Hello, I need help with some password changes that I have to do in some iPAQs. The company that I work has 3 models of iPAQ and 3 different versions of Windows Mobile (Microsoft Pocket PC...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.