Hoping someone may be able to provide some assistance. I am trying to search the netlogon.log file and look for the line below.
Domain\Administrator from Rdesktop (via DCNAMEHERE) Returns 0xC000006A
First I need it to find that and if it does to send an email. The email bit i can work on later but i am struggling to get it to find it in the file even though that line is present.
In regex the backslash is a special character. If you want to find one literally you have to escape it with a backslash. Another solution would be to use the parameter -SimpleMatch what tells Select-String NOT to use a regex search.
If you don’t want to think about escaping special characters you can use the .Escape() method of the [regex] type like this:
Thank you so much. That’s returned the data I wanted from the log. As they say every day is a school day and i you have passed some knowledge along. I have never worked with Select-Strings before.
The code i have below to complete this post is below. It now returns what i want.