I'v made a script that creates a text file using psloggedon. The output looks similar to this:
Does anyone know how to filter this, or cut it down to only look like this:
I was thinking it would be somewhat similar to what I've have been shown here before...this is just and example I know its not right...
Code:
Users logged on via resource shares:
11/21/2007 12:57:34 PM DOMAIN\user
Connecting to Registry of \\PC...
Users logged on locally:
Error: could not retrieve logon time
NT AUTHORITY\LOCAL SERVICE
Error: could not retrieve logon time
NT AUTHORITY\NETWORK SERVICE
10/26/2007 10:57:07 AM DOMAIN\user
Error: could not retrieve logon time
NT AUTHORITY\SYSTEM
Does anyone know how to filter this, or cut it down to only look like this:
Code:
PCNAME
NT AUTHORITY\NETWORK SERVICE
10/26/2007 10:57:07 AM DOMAIN\user
Error: could not retrieve logon time
I was thinking it would be somewhat similar to what I've have been shown here before...this is just and example I know its not right...
Code:
PSLOG = WshShell.Run("%comspec% /c ""C:\psloggedon.exe"" \\" & strComputer & " >>C:\Results.txt", 0, True)
PSLOG = Left(PSLOG , Len(PSLOG) - 17)