-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
This doc says Get-EventLog takes IP addresses for the -ComputerName parameter, however, at least it's true that the "loopback address," i.e., 127.0.0.1 which is well-known, does not work, as is shown in the PowerShell session below.
I have no way of testing, on the computer I am currently working on, whether other IP addresses work, but I am surprised that 127.0.0.1 is not accepted. Either the IP-address functionality is broken completely in this cmdlet and the docs are wrong, or it just won't take the Loopback address (which it should, to mean the same computer it's being run on), or the docs are plain wrong in that IP addresses just are not accepted by the -ComputerName parameter.
PS > $PSVersionTable.PSVersion
Major Minor Build Revision
----- ----- ----- --------
5 1 17763 316
PS > Get-EventLog -LogName Security -ComputerName "127.0.0.1"
Get-EventLog : The network path was not found.
At line:1 char:1
+ Get-EventLog -LogName Security -ComputerName "127.0.0.1"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-EventLog], IOException
+ FullyQualifiedErrorId : System.IO.IOException,Microsoft.PowerShell.Commands.GetEventLogCommand
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: bf280305-63b5-a41b-fe39-4c50484029c6
- Version Independent ID: 8fd10e62-dee2-56fd-e3c1-07c07f8854a3
- Content: Get-EventLog (Microsoft.PowerShell.Management)
- Content Source: reference/5.1/Microsoft.PowerShell.Management/Get-EventLog.md
- Product: powershell
- GitHub Login: @daxian-dbw
- Microsoft Alias: dongbow