Groups | Blog | Home
all groups > dotnet framework > may 2007 >

dotnet framework : How to get username/password info of a windows service user accoun


Andrew
5/30/2007 12:04:02 PM
Hello, friends,

In windows service, after specifying username/password in installer like the
follows:

this.serviceProcessInstaller1.Password = "12345";
this.serviceProcessInstaller1.Username = "prodDomain\\appUser";

and installing this window service, I believe this windows service will be
run under the specified user account each time it is started.

Then the question is: If I want to retrieve username/password info in this
windows service itself, how can I do it?

Henning Krause [MVP - Exchange]
5/31/2007 12:00:00 AM
Hello,

you can't. All you can get is the username - via
WindowsIdentity.GetCurrent().

Best regards,
Henning Krause

[quoted text, click to view]
-pb-
5/31/2007 2:34:28 AM
Hi,

You cannot get password of any windows account. If you want to service
account information then try using it via
CredentialCache.DefaultNetworkCredentials. Password will never be
exposed from .Net.

On 31 May, 07:11, "Henning Krause [MVP - Exchange]"
[quoted text, click to view]

AddThis Social Bookmark Button