Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: domain user domain of client NT domain
I want WinBatch to retrieve the Domain the user is logged into, and I need to retrieve this information for both Win95 and NT users.
HOSTDOM = RegQueryValue(@REGMACHINE,"System\CurrentControlSet\Services\VxD\VNETSUP[Workgroup]") MASTDOM = RegQueryValue(@REGMACHINE,"System\CurrentControlSet\Services\MSNP32\NetworkProvider[AuthenticatingAgent]") USERNAME = RegQueryValue(@REGMACHINE,"Network\Logon[username]")
HOSTDOM=RegQueryValue(@REGMACHINE,"Software\Microsoft\WindowsNT\CurrentVersion\winlogon[CachePrimaryDomain]") MASTDOM=StrUpper(Environment("USERDOMAIN"))
This works fine in NT and I will try it in 95. Hope it helps!
CurrentDir=DirGet() DefaultPath=CurrentDir WinDir=DirWindows(0) SysDir=DirWindows(1) WinPath=DirWindows(0) WilHome=DirHome() NetlogonUNC=DirHome() :GetAuthenticatingServerInfo ServerString=(StrIndex(NetlogonUNC,"\",3,@fwdscan)-1) ServerUNC=StrSub(NetlogonUNC,1,ServerString) ServerName=StrSub(ServerUNC,3,(ServerString-2)) Message("Test","The Current Directory is %CurrentDir%%@crlf%The WIL Home Directory is %WilHome%.%@crlf%NetlogonUNC is %NetlogonUNC%%@crlf%Authenticating Server is %ServerName%.")
Article ID: W13653
Filename: Retrieve NT domain name that user is logged into.txt
File Created: 1999:04:15:16:55:28
Last Updated: 1999:04:15:16:55:28