Here is the full code
 Code:
If Not @LOGONMODE
	     Break On
EndIf

$SO=SetOption("Explicit", "ON")
$SO=SetOption("NoMacrosInStrings", "ON")
$SO=SetOption("NoVarsInStrings", "ON")
$SO=SetOption("WrapAtEOL", "ON")

Dim $FH, $Date, $File, $Line, $Drive, $Element, $Input, $Type
Global $Array, $FH2

Use * "\\server\e$\audit" /user:"domainX\administrator" /password:"password"
$Drive = @RESULT
$File = DirPlus($Drive)
$FH = FreeFileHandle()
$FH2 = FreeFileHandle()
CLS
?"Search for username:"
Gets $input

If Open ($FH2,"C:\Scripthome\logs\Audit_"+$input+".txt",5) = 0

For Each $Element in $File
? $element
	If Open ($FH,$element,2) = 0
		$Line = ReadLine($FH)
			While @ERROR = 0
				$Array = Split ($Line," ")
					If $Array[2] = "DomainX\"+$Input+":"
						Select
							Case $Array[3] = "Logon"
								$Type = "On"
							Case $Array[4] = "Logoff"
								$Type = "Off"
							Case 1
								$Type = "Ignore"
						EndSelect
						Write($Type)
					EndIf
				$Line = ReadLine($FH)
			Loop
	EndIf
	Close ($FH)
Next

Close($FH2)

Else
	?@SERROR
EndIf
Use * /delete
Function Write($Type)
If $Type = "ON"
	WriteLine($FH2,$Array[0]+" "+$Array[1]+" Successful network Logon: User Name "+$Array[2]+@CRLF+"     "+"Workstation: "+$Array[12]+@CRLF)
EndIf
If $Type = "Off"
	WriteLine($FH2,$Array[0]+" "+$Array[1]+" User Logoff"+@CRLF)
EndIf
EndFunction
_________________________
Today is the tomorrow you worried about yesterday.