yet another change password thread

  • Thread starter Thread starter a_hartmann_andersen
  • Start date Start date
A

a_hartmann_andersen

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
 
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.

| 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
|
 
I've lost my adminstor password.
Any way I can change it without knowing the present one?

thanks


Nicholas Paldino said:
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/micr...ogrammatically&rnum=10&hl=en#57914ef0e7e9b721

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

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
 
There is a way, and not a single one:

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

Netter said:
I've lost my adminstor password.
Any way I can change it without knowing the present one?

thanks


Nicholas Paldino said:
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/micr...ogrammatically&rnum=10&hl=en#57914ef0e7e9b721

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

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
 
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 said:
There is a way, and not a single one:

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

Netter said:
I've lost my adminstor password.
Any way I can change it without knowing the present one?

thanks


Nicholas Paldino said:
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/micr...ogrammatically&rnum=10&hl=en#57914ef0e7e9b721

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

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
 
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 said:
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 said:
There is a way, and not a single one:

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

Netter said:
I've lost my adminstor password.
Any way I can change it without knowing the present one?

thanks


in message 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/micr...ogrammatically&rnum=10&hl=en#57914ef0e7e9b721

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

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
 

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

Back
Top