Finding Logged in User / Domain using System.Security

Use the name space System.Security.Principal.WindowsPrincipal

To Identify the Domain name

SystemInformation.UserDomainName To Identify the user id Dim wp As New System.Security.Principal.WindowsPrincipal (System.Security.Principal.WindowsIdentity.GetCurrent())

 

MsgBox(wp.Identity.Name)

 

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish