468,790 Members | 1,897 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,790 developers. It's quick & easy.

Obtaining the password of an active directory user

Hi people, Does anyone have some idea how to get the password of an active
directory user?

I tried using the DirectorySearcher object to find the user and the
DirectoryEntry.Password property to get the value, but always returns "null"
and I'm totally sure that the password is not null

thanks

Nov 22 '05 #1
10 22323
Mario,

You can not get someones password with code.

Ken
----------------
"Mario Rodriguez" <mr********@avantica.net> wrote in message
news:uF**************@tk2msftngp13.phx.gbl...
Hi people, Does anyone have some idea how to get the password of an active
directory user?

I tried using the DirectorySearcher object to find the user and the
DirectoryEntry.Password property to get the value, but always returns "null" and I'm totally sure that the password is not null

thanks

Nov 22 '05 #2
Mario,

You can not get someones password with code.

Ken
----------------
"Mario Rodriguez" <mr********@avantica.net> wrote in message
news:uF**************@tk2msftngp13.phx.gbl...
Hi people, Does anyone have some idea how to get the password of an active
directory user?

I tried using the DirectorySearcher object to find the user and the
DirectoryEntry.Password property to get the value, but always returns "null" and I'm totally sure that the password is not null

thanks

Nov 22 '05 #3
I am not 100% sure but I believe that the password is stored only after it
has been encrypted and the encryption is one way.

To validate a user it takes the password they enter in, encrypts it and then
compares the encrypted results to make sure they match.

This is why the only option an admin has for a person that forgot their
password it to rest it to something instead of telling the user what it is
currently set to.

"Mario Rodriguez" <mr********@avantica.net> wrote in message
news:uF**************@tk2msftngp13.phx.gbl...
Hi people, Does anyone have some idea how to get the password of an active
directory user?

I tried using the DirectorySearcher object to find the user and the
DirectoryEntry.Password property to get the value, but always returns "null" and I'm totally sure that the password is not null

thanks

Nov 22 '05 #4
I am not 100% sure but I believe that the password is stored only after it
has been encrypted and the encryption is one way.

To validate a user it takes the password they enter in, encrypts it and then
compares the encrypted results to make sure they match.

This is why the only option an admin has for a person that forgot their
password it to rest it to something instead of telling the user what it is
currently set to.

"Mario Rodriguez" <mr********@avantica.net> wrote in message
news:uF**************@tk2msftngp13.phx.gbl...
Hi people, Does anyone have some idea how to get the password of an active
directory user?

I tried using the DirectorySearcher object to find the user and the
DirectoryEntry.Password property to get the value, but always returns "null" and I'm totally sure that the password is not null

thanks

Nov 22 '05 #5
On Sat, 3 Apr 2004 12:39:01 -0600, "Mario Rodriguez" <mr********@avantica.net> wrote:

¤ Hi people, Does anyone have some idea how to get the password of an active
¤ directory user?
¤
¤ I tried using the DirectorySearcher object to find the user and the
¤ DirectoryEntry.Password property to get the value, but always returns "null"
¤ and I'm totally sure that the password is not null

The documentation is somewhat misleading. The Password property is used for validating user
credentials and not for retrieving a use's password from AD.
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Nov 22 '05 #6
On Sat, 3 Apr 2004 12:39:01 -0600, "Mario Rodriguez" <mr********@avantica.net> wrote:

¤ Hi people, Does anyone have some idea how to get the password of an active
¤ directory user?
¤
¤ I tried using the DirectorySearcher object to find the user and the
¤ DirectoryEntry.Password property to get the value, but always returns "null"
¤ and I'm totally sure that the password is not null

The documentation is somewhat misleading. The Password property is used for validating user
credentials and not for retrieving a use's password from AD.
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Nov 22 '05 #7
My situation is the following:

1- I need to change the user password programatically, without the Active
Directory Snap-in (MMC)
2- The application is going to be used by an administrator that shouldn't
know the users passowords
3- I tried with setting the Password property of the DirectoryEntry object
and doesn't throws any exception, but never really change the password, so I
tried
with directoryEntry.Invoke("ChangePassword", new object[] {oldPwd,newPwd });

and works fine, but I have to give the current password

If someone can give any idea how to do that I'll thank you a lot
"Paul Clement" <Us***********************@swspectrum.com> wrote in message
news:1s********************************@4ax.com...
On Sat, 3 Apr 2004 12:39:01 -0600, "Mario Rodriguez" <mr********@avantica.net> wrote:
¤ Hi people, Does anyone have some idea how to get the password of an active ¤ directory user?
¤
¤ I tried using the DirectorySearcher object to find the user and the
¤ DirectoryEntry.Password property to get the value, but always returns "null" ¤ and I'm totally sure that the password is not null

The documentation is somewhat misleading. The Password property is used for validating user credentials and not for retrieving a use's password from AD.
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)

Nov 22 '05 #8
My situation is the following:

1- I need to change the user password programatically, without the Active
Directory Snap-in (MMC)
2- The application is going to be used by an administrator that shouldn't
know the users passowords
3- I tried with setting the Password property of the DirectoryEntry object
and doesn't throws any exception, but never really change the password, so I
tried
with directoryEntry.Invoke("ChangePassword", new object[] {oldPwd,newPwd });

and works fine, but I have to give the current password

If someone can give any idea how to do that I'll thank you a lot
"Paul Clement" <Us***********************@swspectrum.com> wrote in message
news:1s********************************@4ax.com...
On Sat, 3 Apr 2004 12:39:01 -0600, "Mario Rodriguez" <mr********@avantica.net> wrote:
¤ Hi people, Does anyone have some idea how to get the password of an active ¤ directory user?
¤
¤ I tried using the DirectorySearcher object to find the user and the
¤ DirectoryEntry.Password property to get the value, but always returns "null" ¤ and I'm totally sure that the password is not null

The documentation is somewhat misleading. The Password property is used for validating user credentials and not for retrieving a use's password from AD.
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)

Nov 22 '05 #9
You should Invoke "SetPassword" to reset a password.

.....
directoryEntry.Invoke("SetPassword", new object[] {newPasswd});

Willy.

"Mario Rodriguez" <mr********@avantica.net> wrote in message
news:u1**************@tk2msftngp13.phx.gbl...
My situation is the following:

1- I need to change the user password programatically, without the Active
Directory Snap-in (MMC)
2- The application is going to be used by an administrator that shouldn't
know the users passowords
3- I tried with setting the Password property of the DirectoryEntry object
and doesn't throws any exception, but never really change the password, so
I
tried
with directoryEntry.Invoke("ChangePassword", new object[]
{oldPwd,newPwd });

and works fine, but I have to give the current password

If someone can give any idea how to do that I'll thank you a lot
"Paul Clement" <Us***********************@swspectrum.com> wrote in message
news:1s********************************@4ax.com...
On Sat, 3 Apr 2004 12:39:01 -0600, "Mario Rodriguez"

<mr********@avantica.net> wrote:

¤ Hi people, Does anyone have some idea how to get the password of an

active
¤ directory user?
¤
¤ I tried using the DirectorySearcher object to find the user and the
¤ DirectoryEntry.Password property to get the value, but always returns

"null"
¤ and I'm totally sure that the password is not null

The documentation is somewhat misleading. The Password property is used

for validating user
credentials and not for retrieving a use's password from AD.
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)


Nov 22 '05 #10
You should Invoke "SetPassword" to reset a password.

.....
directoryEntry.Invoke("SetPassword", new object[] {newPasswd});

Willy.

"Mario Rodriguez" <mr********@avantica.net> wrote in message
news:u1**************@tk2msftngp13.phx.gbl...
My situation is the following:

1- I need to change the user password programatically, without the Active
Directory Snap-in (MMC)
2- The application is going to be used by an administrator that shouldn't
know the users passowords
3- I tried with setting the Password property of the DirectoryEntry object
and doesn't throws any exception, but never really change the password, so
I
tried
with directoryEntry.Invoke("ChangePassword", new object[]
{oldPwd,newPwd });

and works fine, but I have to give the current password

If someone can give any idea how to do that I'll thank you a lot
"Paul Clement" <Us***********************@swspectrum.com> wrote in message
news:1s********************************@4ax.com...
On Sat, 3 Apr 2004 12:39:01 -0600, "Mario Rodriguez"

<mr********@avantica.net> wrote:

¤ Hi people, Does anyone have some idea how to get the password of an

active
¤ directory user?
¤
¤ I tried using the DirectorySearcher object to find the user and the
¤ DirectoryEntry.Password property to get the value, but always returns

"null"
¤ and I'm totally sure that the password is not null

The documentation is somewhat misleading. The Password property is used

for validating user
credentials and not for retrieving a use's password from AD.
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)


Nov 22 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Mario Rodriguez | last post: by
reply views Thread by Kooki | last post: by
reply views Thread by Kooki | last post: by
7 posts views Thread by Vio | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
2 posts views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.