Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 8583

Retrieve words from text file.

$
0
0

Below is an example of text lines from a log file.  How can I capture the domain\userid after the word (User) & the computer name after the word (Machine).

Thank you in advance!

 

\log-2014-08-06.txt:220:2014-08-06T07:43:17.149-05:00 INFO  (0CE8-0D54) <DesktopControlJMS> [DesktopTracker]User domain\userid reconnected to machine Machine1 for desktop Machine1 - session allocated at August 5, 2014 3:23:08 PM CDT, disconnected for 907 mins 44 secs

\log-2014-08-06.txt:227:2014-08-06T07:45:19.464-05:00 INFO  (0CE8-0D54) <DesktopControlJMS> [DesktopTracker]User domain\userid reconnected to machine Computer3 for desktop Computer3 - session allocated at August 5, 2014 3:23:08 PM CDT, disconnected for 1 mins 43 secs


Viewing all articles
Browse latest Browse all 8583

Latest Images

Trending Articles



Latest Images