all groups > dotnet myservices > august 2007 >
You're in the

dotnet myservices

group:

windows Service Identity.Name...--Help Needed



windows Service Identity.Name...--Help Needed SenthilVel
8/3/2007 12:00:00 AM
dotnet myservices:
Hi ,
i have a windows Service which is running with the Local System account.

This windows service will be strarted\stopped by a ASP.Net web Application.

i also wanted to know the Logged in user name whenever my Service is
started\ stopped .

i am using this :
Thread.CurrentPrincipal = new
WindowsPrincipal(WindowsIdentity.GetCurrent());

struserName = Thread.CurrentPrincipal.Identity.Name;

when i Deploy my windows Service in my servers - win 2003 , i always get the
Logged in user name as -- NT ADMIN .. but i am expecting the logged in user
name of that 2003 machine..

any reasons why Thread.CurrentPrincipal.Identity.Name gets NT ADMIN always
??

any help much appreciated !

Thanks

Senthil


AddThis Social Bookmark Button