Hola amigos:
NetName() nos devuelve el nombre de la PC, NetName(.t.) el nombre del usuario; alguna funcion para obtener el nombre del GRUPO DE TRABAJO ??
Salu2
Grupo de Trabajo
- Willi Quintana
- Posts: 1025
- Joined: Sun Oct 09, 2005 10:41 pm
- Location: Cusco - Perú
- Contact:
Re: Grupo de Trabajo
Here is one of the ways to retrieve your PC's WorkGroup/Domain name
Please note :-
WMI is not available before Windows 2000 (unless it is installed separately).
Microsoft's document states that if the computer is not joined to a domain, the domain property of the Win32_ComputerSystem class is the name of the workgroup.
Regards
Anser
Code: Select all | Expand
#Include "FiveWin.ch"
//-----------------------//
Function Main()
Local oLoc,oWmi,oList,oItem
oLoc:= CreateObject( "wbemScripting.SwbemLocator" )
oWmi:= oLoc:ConnectServer()
If oWmi == NIL
? "Sorry!! No Wmi"
Return
Endif
oList := oWmi:ExecQuery("Select * from Win32_ComputerSystem")
FOR EACH oItem IN oList
cComputerDomain = oItem:Domain
If oItem:PartOfDomain
? "Computer Domain: " + cComputerDomain
Else
? "Workgroup: " + cComputerDomain
EndIf
Next
Return NIL
Please note :-
WMI is not available before Windows 2000 (unless it is installed separately).
Microsoft's document states that if the computer is not joined to a domain, the domain property of the Win32_ComputerSystem class is the name of the workgroup.
Regards
Anser
- Willi Quintana
- Posts: 1025
- Joined: Sun Oct 09, 2005 10:41 pm
- Location: Cusco - Perú
- Contact: