Click here to Skip to main content
11,707,254 members (46,386 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: VB.NET
How to get work group name of my system. I dont want retrieve system name I need WorkGroup name
Example my system name is Computer1. My work group name is Computer Tech. I want to retrieve the name Computer Tech

Thanks in advance
Posted 8-Apr-13 0:00am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Try this:[^][^][^][^]

[EDIT #1][^]

Dim mos As System.Management.ManagementObjectSearcher
Dim moc As System.Management.ManagementObjectCollection
Dim mo As System.Management.ManagementObject
Dim prop As System.Management.PropertyData = Nothing
Dim FSO As Object = Nothing
Dim txtstream As Object = Nothing
Dim MyString As String = String.Empty
mos = New System.Management.ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapterConfiguration")
moc = mos.Get()
For Each mo In moc

Above code returns information about Win32_NetworkAdapterConfiguration. Look for DNSDomain.
Usha Muhunthan at 8-Apr-13 6:37am
All the links return only the computer name Computer1 not WorkGroup Name Computer Tech
Maciej Los at 8-Apr-13 8:19am
See updated answer.
Usha Muhunthan at 8-Apr-13 8:31am
Its shows 5 errors those all about Type not defined
1. System.Management.ManagementObjectSearcher
2. System.Management.ManagementObjectCollection
3. System.Management.ManagementObject
4. System.Management.PropertyData = Nothing
5. System.Management.ManagementObjectSearcher

Sholud i use any Imports or anything else
Maciej Los at 8-Apr-13 8:38am
Just add a reference to System.Managment namespace.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 145
1 OriginalGriff 141
2 chainerlt 110
3 Mika Wendelius 80
4 Maciej Los 80
0 OriginalGriff 9,178
1 Sergey Alexandrovich Kryukov 8,562
2 CPallini 5,189
3 Maciej Los 4,806
4 Mika Wendelius 3,706

Advertise | Privacy | Mobile
Web02 | 2.8.150819.1 | Last Updated 8 Apr 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100