0
Regexを使用する代わりに、イベントログエントリのテキストメッセージブロックのサブ文字列を取得できますか?イベントログエントリのメッセージブロック値を取得する
:Account Name
Client Address, but with out the ::ffff:
Failure Code
私のコードのこの部分の下にあるテキストを返します:私は右の値のみが欲しい
Kerberos pre-authentication failed.
Account Information:
Security ID: HO\administrators$
Account Name: administrators$
Service Information:
Service Name: krbtgt/HO.FOSLTD.CO.ZA
Network Information:
Client Address: ::ffff:10.250.1.12
Client Port: 51933
Additional Information:
Ticket Options: 0x40000000
Failure Code: 0x18
Pre-Authentication Type: 2
:
これは、テキストのブロックがどのように見えるかです
$sSecurityID = $Item.SubString($Item.IndexOf("Account Information"))
$sSecurityID = $sSecurityID.SubString($sSecurityID.IndexOf("Account Name"))
$sSecurityID = $sSecurityID.TrimStart("Account Name:")
$sSecurityID = $sSecurityID.Trim()
出力:
OrtheaE
Service Information:
Service Name: krbtgt/ho
Network Information:
Client Address: ::ffff:172.26.50.11
Client Port: 20697
Additional Information:
Ticket Options: 0x40810010
Failure Code: 0x18
Pre-Authentication Type: 2