Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
AddExtender("WWWNT34I.DLL") ;Specify file to write to handle = FileOpen("c:\iplist.txt","WRITE") servers = wntServerList("","",4096) count = ItemCount(servers,@tab) For x = 1 to count line = "" remoteMachine= ItemExtract(x,servers,@tab) ;Connect to remote machines registry (must have necessary permissions) ErrorMode(@off) regRemoteMachine=RegConnect(remotemachine, @REGMACHINE) ErrorMode(@cancel) if regRemoteMachine==0 line = StrCat("Error connecting to ",remoteMachine,@tab,IntControl (34, LastError(), 0, 0, 0)) FileWrite(handle,line) continue endif ;Get username ErrorMode(@off) key=RegOpenkey(regRemoteMachine, "Software\Microsoft\Windows NT\CurrentVersion\Winlogon") ErrorMode(@cancel) if key==0 line = StrCat("Error connecting to ",remoteMachine,@tab,IntControl (34, LastError(), 0, 0, 0)) FileWrite(handle,line) continue endif username=RegQueryValue(Key,"[DefaultUserName]") RegCloseKey(key) ;Get netadapter ErrorMode(@off) key=RegOpenkey(regRemoteMachine, "Software\Microsoft\Windows NT\CurrentVersion\NetworkCards") ErrorMode(@cancel) if key==0 line = StrCat("Error connecting to ",remoteMachine,@tab,IntControl (34, LastError(), 0, 0, 0)) FileWrite(handle,line) continue endif NxtAdapter=RegQueryKey(key,0) NetAdapter=RegQueryValue(Key,StrCat(NxtAdapter,"\[ServiceName]")) RegCloseKey(key) ;Get ipaddress defaultgateway and subnetmask. ErrorMode(@off) Key=RegOpenKey(regRemoteMachine, StrCat("System\CurrentControlSet\Services\",NetAdapter)) ErrorMode(@cancel) if Key==0 line = StrCat("Error connecting to ",remoteMachine,@tab,IntControl (34, LastError(), 0, 0, 0)) FileWrite(handle,line) continue endif ipaddr = RegQueryMulSz(Key,"Parameters\tcpip\[IPAddress]"," ") defgateway = RegQueryMulSz(Key,"Parameters\tcpip\[DefaultGateway]"," ") subnetmask = RegQueryMulSz(Key,"Parameters\tcpip\[SubnetMask]"," ") RegCloseKey(key) RegCloseKey(regRemoteMachine) ;Display results line = StrCat(remoteMachine,@tab,"Username: ",username,@tab, "IPAddress: ",ipaddr,@tab,"DefaultGateway: ",defgateway,@tab,"SubnetMask: ",subnetmask) FileWrite(handle,line) next FileClose(handle) exit
Article ID: W15979
File Created: 2004:03:30:15:42:06
Last Updated: 2004:03:30:15:42:06