|
This is great! Thanks for your help, it got me going and now the I've been able to add the script below to check each user when they logon to determine who is on my network with a static address.
Thanks again.
Dave
dim $card,$int,$,$sk,$cardkey,$checkDHCP,$INFIP
$int="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces"
$card="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards"
$=0
$sk=enumkey($card,$)
while @error=0
$=$+1
$cardkey = $int+"\"+readvalue($card+"\"+$sk,"ServiceName")
$checkDHCP = Readvalue($cardkey,"EnableDHCP")
$INFIP= Readvalue($cardkey,"IPAddress")
$IPCompare=LEFT($INFIP,3)
IF $checkDHCP=0 AND $IPCompare="10."
IF OPEN(1, "\\LVOTT244\FIXME\DHCPCHECK.txt",3) = 0
$text = ReadLine(1)
While @ERROR = 0
$text = $text + ReadLine(1)
Loop
CLOSE(1)
IF INSTR(UCASE($TEXT),@HOSTNAME) = 0
IF OPEN(1, "\\LVOTT244\FIXME\DHCPCHECK.txt",4) = 0
;$hostname = $text + CHR(13) + CHR(10) + @HOSTNAME + " " + @FULLNAME + CHR(13) +CHR(10)
$hostname = @HOSTNAME + " " + @FULLNAME + " " + @IPADDRESS0 +CHR(13) +CHR(10)
WRITELINE(1,$hostname)
CLOSE(1)
;? "File contents: " + $hostname
else
;? "Error opening file: \\LVOTT244\FIXME\DHCPCHECK.txt for writing"
;? "Error Code: " + @ERROR + " - " + @SERROR
ENDIF
ENDIF
ELSE
;? "Error opening file: \\LVOTT244\FIXME\DHCPCHECK.txt for reading"
;? "Error Code: " + @ERROR + " - " + @SERROR
ENDIF
ENDIF
$sk=enumkey($card,$)
loop
Edited by Dave (2004-05-06 03:17 PM)
|