0

I want to grab the value listed under "Caller Computer Name" and put it in a variable so that I can use it to get the IP address of the computer in another command.

This is the code I am using to pull the data:

$event= Get-EventLog -LogName Security -ComputerName $DC -InstanceId 4740 -Newest 1
Todd Welch
  • 1,776
  • 2
  • 17
  • 23

1 Answers1

-1

You can access the property MachineName directly like this:

$machine_name= (Get-EventLog -LogName Security -ComputerName $DC -InstanceId 4674 -Newest 1).MachineName
Ranadip Dutta
  • 8,857
  • 3
  • 29
  • 45