Michael Howes
2007-06-27 19:41:48 UTC
In our application the user needs to log on and to do so they need a
local windows account.
I do this calling LogonUser. I use the token to create a
WindowsIdentity and also use WindowsPrincipal to check if the user is a
Power User.
I keep this WindowsIdentity around in the application.
There is an area of the application that does some user management but
the user needs to be a administrator. Most of the work is done using
DirectoryEntry and the initial call to the machine needs name and
password of an administrator.
Is there any way to get the password from the WindowsIdentity and pass
in the name/password from the WindowsIdentity to the DirectoryEntry
constructor?
I can use WindowsPrincipal to check if the user is an administrator
and if they are I shouldn't prompt the user to logon again if they try
and go into the user manager area.
Or do I need to keep the password around after they logon?
thanks
mike
local windows account.
I do this calling LogonUser. I use the token to create a
WindowsIdentity and also use WindowsPrincipal to check if the user is a
Power User.
I keep this WindowsIdentity around in the application.
There is an area of the application that does some user management but
the user needs to be a administrator. Most of the work is done using
DirectoryEntry and the initial call to the machine needs name and
password of an administrator.
Is there any way to get the password from the WindowsIdentity and pass
in the name/password from the WindowsIdentity to the DirectoryEntry
constructor?
I can use WindowsPrincipal to check if the user is an administrator
and if they are I shouldn't prompt the user to logon again if they try
and go into the user manager area.
Or do I need to keep the password around after they logon?
thanks
mike