up vote 0 down vote favorite
share [g+] share [fb]

I am writing a script and want to check whether the user is currently logged into the local machine or to the windows domain. I specifically want to get the name of the domain, as the script may be used on multiple domains and multiple workstations.

link|improve this question

50% accept rate
feedback

1 Answer

up vote 1 down vote accepted

I guess you could use the Registry Functions on HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Domain to grab the name.

link|improve this answer
1  
Perfect! One caveat: the registry value for Domain is empty if logged on to the local machine, so I just had to check for that case and use the built-in A_ComputerName variable. – mwolfe02 Jan 5 '10 at 16:46
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.