Coming Soon: GET:IT Endpoint Management 1-Day Conference on September 28th at 9:30 AM ET Coming Soon: GET:IT Endpoint Management 1-Day Conference on September 28th at 9:30 AM ET

Filtering Findstr results

Home Forums Scripting General Scripting Filtering Findstr results

Viewing 1 post (of 1 total)
  • Author
    Posts

  • chrispage
    Member
    #167424

    I am trying to extract the last word of a findstr results query

    The command I run
    findstr /i %1 x:itlogswho_when.txt | findstr /i %2[/CODE]
    the results I get
    [CODE]12/02/2018 10:17:58 SmithS Steve Smith B0K9VY1
    13/02/2018 09:29:13 SmithS Steve Smith B0K9VY1[/CODE]
    What i need from the results is that last word [I][B]B0K9VY1 [/B][/I]so i can run SCCM RemoteControl $computername

    (it will *always* be the last word on the last line of the results from my findstr query)[CODE]findstr /i %1 x:itlogswho_when.txt | findstr /i %2[/CODE]
    the results I get
    12/02/2018 10:17:58 SmithS Steve Smith B0K9VY1
    13/02/2018 09:29:13 SmithS Steve Smith B0K9VY1[/CODE]
    What i need from the results is that last word [I][B]B0K9VY1 [/B][/I]so i can run SCCM RemoteControl $computername

    (it will *always* be the last word on the last line of the results from my findstr query)[CODE]12/02/2018 10:17:58 SmithS Steve Smith B0K9VY1
    13/02/2018 09:29:13 SmithS Steve Smith B0K9VY1[/CODE]
    What i need from the results is that last word B0K9VY1 so i can run SCCM RemoteControl $computername

    (it will *always* be the last word on the last line of the results from my findstr query)

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

Live Webinar: Active Directory Security: What Needs Immediate Priority!Live on Tuesday, October 12th at 1 PM ET

Attacks on Active Directory are at an all-time high. Companies that are not taking heed are being punished, both monetarily and with loss of production.

In this webinar, you will learn:

  • How to prioritize vulnerability management
  • What attackers are leveraging to breach organizations
  • Where Active Directory security needs immediate attention
  • Overall strategy to secure your environment and keep it secured

Sponsored by: