我正在寻找使用powershell从文本块中恢复主机名。该块如下:从文本块中提取单个字
The computer attempted to validate the credentials for an account.
Authentication Package: MICROSOFT_AUTHENTICATION_PACKAGE_V1_0
Logon Account: svc.sXXX.d.fdb
Source Workstation: DIXXXEF01
Error Code: 0x0
正如你可以看到它的一个多行文本块。目前我正试图减少5安全日志的绒毛。我希望使用powershell regrex命令或类似的东西来恢复登录帐户和源工作站。
任何想法?谢谢。
ISJ
试试这个: $ account ='登录帐号:' $ workstation ='源工作站:' $ textBlock | Where-Object {$ _ -like“$ account *” - 或$ _ -like“$ workstation *”} | Foreach-Object IF($ _ -like“$ account *”){$ _。Trim($ account)}; IF($ _ -like“$ workstation *”){$ _Trim($ workstation)} } 不知道它会工作,由于大小(5GB),可能需要使用流或什么,我没有我害怕Powershell的这种体验。如果它起作用,它会看起来像这样: svc.sXXX.d.fdb DIXXXEF01 –