Re: IsInRole always return fasle on secure remoting call (Framework 2.0)

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks for your reply.

I am calling the IsInRole within a Windows Service which is running under a
account with enough privileges to query AD.

In Fact, if the remote caller is the same that the account running the
service then
WindowsPrincipal aWinPrinc = new
WindowsPrincipal(WindowsIdentity.GetCurrent());

InRole = aWinPrinc.IsInRole("KVSHQ\\Domain Users"); // WORKS (return true)


InRole = System.Threading.Thread.CurrentPrincipal.IsInRole("KVSHQ\\Domain
Users"); // DO NOT WORK (return false)

In this case the identity of the window service and the current principal of
the current thread are the same, but the IsInRole returns different result.

What I do not underatand is why if the second call fails to resolve
IsInRole, why no exception is thrown, instead it returns false which is the
wrong result!!

What I am missing?

Thanks for your help.

Cheers,

Eric


.



Relevant Pages

  • RE: IsInRole always return fasle on secure remoting call (Framework 2.0)
    ... Did you call the IsInRole() method in a Windows Service application? ... Windows Service application may be running with a local system or network ... service account, which may not has enough permission to query AD or domain. ...
    (microsoft.public.dotnet.distributed_apps)
  • RE: can a service map a network share to a drive letter
    ... account your mapping drive Windows Service runs and how do you use the Task ... Scheduler(what account does it run). ... If your Windows Service runs under Local System, ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.framework)
  • Re: Windows Service Cannot Move Files
    ... Are you sure that the account has write access to the directory and files? ... The windows service can see the original files, ... XP there is a network version of the system account you can use. ... The files are on the network, so we though the local system ...
    (microsoft.public.dotnet.languages.vb)
  • Re: IsInRole performance issue
    ... create a new class that implements IPrincipal with your IsInRole ... > -Create a domain account. ... > your domain controller. ...
    (microsoft.public.dotnet.security)
  • Re: IsInRole performance issue
    ... create a new class that implements IPrincipal with your IsInRole ... > -Create a domain account. ... > your domain controller. ...
    (microsoft.public.dotnet.framework.aspnet.security)