Getting the Workgroup for a PC 
Author Message
 Getting the Workgroup for a PC

I need to get the Workgroup name for a program that will run under
Windows NT and 2000. I have found some references to getting the Domain
name but not so far for Workgroup.

Can anyone provide me with code or a pointer to what I need to do. I
usually use delphi 4 but now have access to Delphi 6 if that will help.

Thanks
Dave



However beautiful the strategy, you should occasionally look at the results.



Sat, 17 Jul 2004 04:09:46 GMT  
 Getting the Workgroup for a PC
Have a look at my GetDomainName function. You can find it in my
WNetResources sample, available on my site.

++++++++++++++++++++
Monte Hansen
http://KillerVB.com
++++++++++++++++++++


Quote:
> I need to get the Workgroup name for a program that will run under
> Windows NT and 2000. I have found some references to getting the Domain
> name but not so far for Workgroup.

> Can anyone provide me with code or a pointer to what I need to do. I
> usually use Delphi 4 but now have access to Delphi 6 if that will help.

> Thanks
> Dave



> However beautiful the strategy, you should occasionally look at the

results.


Sat, 17 Jul 2004 12:30:53 GMT  
 Getting the Workgroup for a PC
Query the registry, the location is:
HKLM\Software\Microsoft\Windows NT\Current Version\Winlogon
DefaultDomainName: REG_SZ: yourdomainname
This is the same location for domain name or workgroup name.

Try the NetWkstaGetInfo() API with the WKSTA_INFO_100 structure to
determine the Workgroup name.

ACC: How to Retrieve Workgroup Information Under Win32        [accvba]
http://support.microsoft.com/support/kb/articles/q148/8/35.asp

Best Regards,

Alick Ye
Microsoft Support

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. Copy right, 2002 Microsoft Corporation.
All rights reserved.



Sun, 22 Aug 2004 16:57:12 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. get pc names for current workgroup

2. Listing domain and workgroup PC nodes available

3. Workgroups and PCs

4. Programmatically list PC's in workgroup

5. Getting a list of Computer's on a network and or a list of Workgroups

6. Getting collections of domains/workgroups etc.

7. Getting names of workgroups

8. Getting workgroup info.

9. Getting the workgroup name

10. Getting current workgroup or domain name

11. Newbie : Pocket PC/Handheld PC/Palm PC

12. Remotly getting the MAC of a PC on the network

 

 
Powered by phpBB® Forum Software