Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
So I guess the overall goal is...what is the simplest way to determine if a pc is in the domain or not.
Apparently you can use the Win32 Network function wntLsaPolGet to retrieve domain information. Check the value of the security identifier (SID) field. If the value is NULL, the computer is either a stand-alone computer or part of a workgroup. If the Name field points to a string that matches the local workstation name, the computer is a stand-alone computer. Otherwise, the Name field points to the workgroup name.
If the SID pointer has a value, the computer is part of a domain. The domain name is stored in the Name field.
Try this code...
AddExtender("wwwnt34i.dll") sid=wntLsaPolGet("","PrimaryDomain",2) name=wntLsaPolGet("","PrimaryDomain",1) If sid=="" Message("Workgroup",name) Else Message("Domain",StrCat(name,@CRLF,sid)) EndIf
Article ID: W16042
File Created: 2004:03:30:15:42:28
Last Updated: 2004:03:30:15:42:28