Hi,
You need to append a backtick (`) character to each line of a command if it's split into multiple lines. Please see if this works.
$Events = Get-WinEvent -Logname security -FilterXPath "Event[System[(EventID=4624)]]and Event[EventData[Data[@Name='LmPackageName']='NTLM V1']]" | Select-Object `
@{Label='Time';Expression={$_.TimeCreated.ToString('g')}}, `
@{Label='UserName';Expression={$_.Properties[5].Value}}, `
@{Label='WorkstationName';Expression={$_.Properties[11].Value}}, `
@{Label='LogonType';Expression={$_.properties[8].value}}, `
@{Label='ImpersonationLevel';Expression={$_.properties[20].value}}
$Events | Out-GridView
Best Regards,
Ian Xue
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.