I'm trying to figure how to pull the computers workgroup name using VB.NET. Any help would be great.
MaddTechwf
0
Junior Poster in Training
Recommended Answers
Jump to PostI stumbled accross this.
Don't know much about it but it brings back the workgroup name.
You have to add a reference to System.Managment.
Dim mos = New System.Management.ManagementObjectSearcher("root\CIMV2", "SELECT * FROM Win32_ComputerSystem") For Each mo As System.Management.ManagementObject In mos.Get() MsgBox(mo.Item("WorkGroup")) Next
Jump to PostI came accross the NetGetJoinInformation Windows API.
You can try this class. It works on my end.Imports System.Runtime.InteropServices Public Class WorkGroupInfo Private WorkGroup As String = String.Empty Private IsWorkGroup As Boolean Sub New(ByVal ComputerName As String) Dim namebuffer As IntPtr Dim status As NetSetup_Join_Status …
All 6 Replies
ShahanDev
41
Junior Poster
MaddTechwf
0
Junior Poster in Training
ShahanDev
41
Junior Poster
MaddTechwf
0
Junior Poster in Training
Unhnd_Exception
Unhnd_Exception
MaddTechwf
commented:
Perfect code snippet to get Workgroup
+1
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.