Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: netgetcon
If the server and the client are both nt4 sp3 then the DOS environment variable LOGONSERVER=\\servername. But you will have problems if you have a mixed environment (3.51 servers or non sp3 nt4).
One of the funky things I have found is that 95 maps drive Z: to the netlogon share of the DC that is authenticating you. Here is some code from my logon script to extract that information. Works quite well!
AddExtender("www9534I.dll") AddExtender("wwnet34I.dll") username=w95UserInfo(0) NetLogonUNC=netGetCon("Z:") ServerString=(StrIndex(NetlogonUNC,"\",3,@fwdscan)-1) ServerUNC=StrSub(NetlogonUNC,1,ServerString) ServerName=StrSub(ServerUNC,3,(ServerString-2)) logonserver="%ServerName%" Message(ProgVer,"username = %username%%LF%ServerString =%ServerString%%LF%ServerUNC = %ServerUNC%%LF%ServerName =%ServerName%%LF%logonserver = %logonserver%")
netlogon=w95GetCon("Z:") logon_server=ItemExtract(3, netlogon, "\")However, once login is complete, the drive mapping to the Z: drive is broken. The connection however will remain for a short time and can be determined by viewing all network resources...
netlogon=w95Resources("DOMAIN", 1, 0, 0) For x=1 To ItemCount(netlogon, @Tab) logon=ItemExtract(x, netlogon, @Tab) If StrIndexNc(logon, "NETLOGON", 1, FWDSCAN) != 0 Then logon_server=ItemExtract(3, logon, "\") Break EndIf Next x
AddExtender("WWNET34I.DLL") w_directory = Environment("windir") file = "\\stealth\norton\updater.exe" drive = "U:" done = 0 system = winmetrics(-4) nt_logon_ser = Environment("LOGONSERVER") nt_logon_ser = strcat(nt_logon_ser, "\netlogon") if system == 5 log_ser = netGetCon("Z:") ErrorMode(@off) ; See warnings LastError() rslt0 = NetAddDrive(@DEFAULT,@DEFAULT,"%log_ser%", drive, @false) err=LastError() ErrorMode(@cancel) dirchange(drive) AddExtender("%drive%\WWW9534I.DLL") endif
Article ID: W13495
Filename: Sample Code Extracts Authenticating Server Name.txt
File Created: 2001:03:01:13:43:08
Last Updated: 2001:03:01:13:43:08