whoami?

From: Ric (Ricky_at_Rios.org)
Date: 08/10/03


Date: Sat, 9 Aug 2003 19:41:56 -0700


Using

AppDomain.CurrentDomain.SetPrincipalPolicy
(PrincipalPolicy.WindowsPrincipal);
WindowsPrincipal principal = (WindowsPrincipal)
Thread.CurrentPrincipal;
WindowsIdentity identity = (WindowsIdentity)
principal.Identity;
MessageBox.Show("You Are "+ identity.Name);

In this example, "identity.Name" holds my username as user
of my local PC.

If at the same time I'm logged in to a W200x server with a
different username, how do I get this last one?



Relevant Pages

  • Re: whoami?
    ... You should be able to get it by running that code on the server. ... know if there's a way to get that from the client, ... > WindowsIdentity identity = ... "identity.Name" holds my username as user ...
    (microsoft.public.dotnet.security)
  • Re: searching what groups a user belong from AD but errorThe Kerberos subsystem encountered an error
    ... It does work when i use that but i want users to type in a username and hit ... using on the WindowsIdentity object uses Kerberos protocol transition (S4U ... Co-author of "The .NET Developer's Guide to Directory Services ... string username = aduser.Text; ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: ActiveDirectory authentication - more issues
    ... User is prompted for username & password. ... authenticated via ActiveDirectory and IsInRole hits ActiveDirectory. ... no -you are doing forms authentication. ... I do not get a WindowsIdentity but instead a FormsIdentity. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Getting GROUPS from Active Directory by inputing an AD username
    ... But whan i want to do is to have a textbox and when i input a AD username ... i would like to retrieve the groups they belong to. ... WindowsIdentity that hangs off Context.User... ... I'm thinking of doing the same but against Active Directory. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Checking to see if a user is a domain Administrator
    ... I've been looking at the WindowsIdentity and WindowsPrincipal.IsInRoleoptions since... ... > Jonny wrote: ... >> I need to verify that a provided username is a Domain Administrator. ...
    (microsoft.public.dotnet.languages.csharp)