Return my workgroup/domain -- VB.NET

Is there a line of code to return my current workgroup/domain in VB.NET?
Who is Participating?
Mikal613Connect With a Mentor Commented:


Imports System
Imports System.Security

Private Function GetUserName() As String
        Return Principal.WindowsIdentity.GetCurrent.Name()
        ' This will return 'domain\username' so just parse the Info
    End Function
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.