Skip to content

Commit 861e078

Browse files
davidsmatlaksdwheeler
authored andcommitted
Fixes #4018, Fixes #4019. Updated Description and ComputerName parameter for Get-EventLog. (#4059)
* updated content, style * Updated based on review comments
1 parent e46ae5b commit 861e078

File tree

4 files changed

+181
-169
lines changed

4 files changed

+181
-169
lines changed

reference/3.0/Microsoft.PowerShell.Management/Get-EventLog.md

Lines changed: 45 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
ms.date: 1/18/2019
2+
ms.date: 3/26/2019
33
schema: 2.0.0
44
locale: en-us
55
keywords: powershell,cmdlet
@@ -19,9 +19,10 @@ computers.
1919
### LogName (Default)
2020

2121
```
22-
Get-EventLog [-LogName] <string> [[-InstanceId] <long[]>] [-ComputerName <string[]>] [-Newest
23-
<int>] [-After <datetime>] [-Before <datetime>] [-UserName <string[]>] [-Index <int[]>] [-EntryType
24-
<string[]>] [-Source <string[]>] [-Message <string>] [-AsBaseObject] [<CommonParameters>]
22+
Get-EventLog [-LogName] <string> [[-InstanceId] <long[]>] [-ComputerName <string[]>] [-Newest <int>]
23+
[-After <datetime>] [-Before <datetime>] [-UserName <string[]>] [-Index <int[]>]
24+
[-EntryType <string[]>] [-Source <string[]>] [-Message <string>] [-AsBaseObject]
25+
[<CommonParameters>]
2526
```
2627

2728
### List
@@ -32,14 +33,16 @@ Get-EventLog [-ComputerName <string[]>] [-List] [-AsString] [<CommonParameters>]
3233

3334
## DESCRIPTION
3435

35-
The `Get-EventLog` cmdlet gets events and event logs on the local and remote computers.
36+
The `Get-EventLog` cmdlet gets events and event logs from local and remote computers. By default,
37+
`Get-EventLog` gets logs from the local computer. To get logs from remote computers, use the
38+
**ComputerName** parameter.
3639

37-
You can use the cmdlet's parameters and property values to search for events. This cmdlet gets
40+
You can use the `Get-EventLog` parameters and property values to search for events. The cmdlet gets
3841
events that match the specified property values.
3942

40-
The cmdlets that contain the EventLog noun work only on classic event logs. To get events from logs
41-
that use the Windows Event Log technology in Windows Vista and later Windows versions, use
42-
`Get-WinEvent`.
43+
PowerShell cmdlets that contain the `EventLog` noun work only on Windows classic event logs such as
44+
Application, System, or Security. To get logs that use the Windows Event Log technology in Windows
45+
Vista and later Windows versions, use `Get-WinEvent`.
4346

4447
## EXAMPLES
4548

@@ -149,16 +152,16 @@ Index Time EntryType Source InstanceID Message
149152
```
150153

151154
The `Get-EventLog` cmdlet uses the **LogName** parameter to specify the System log. The
152-
**InstanceID** parameter selects the events with the specified Instance ID. The **Source**
153-
parameter specifies the event property.
155+
**InstanceID** parameter selects the events with the specified Instance ID. The **Source** parameter
156+
specifies the event property.
154157

155158
### Example 6: Get events from multiple computers
156159

157160
This command gets the events from the System event log on three computers: Server01, Server02, and
158-
the local computer known as localhost.
161+
Server03.
159162

160163
```powershell
161-
Get-EventLog -LogName System -ComputerName Server01, Server02, localhost
164+
Get-EventLog -LogName System -ComputerName Server01, Server02, Server03
162165
```
163166

164167
The `Get-EventLog` cmdlet uses the **LogName** parameter to specify the System log. The
@@ -167,8 +170,8 @@ to get the event logs.
167170

168171
### Example 7: Get all events that include a specific word in the message
169172

170-
This command gets all the events in the System event log that contain a specific word in the
171-
event's message. It's possible that your specified **Message** parameter's value is included in the
173+
This command gets all the events in the System event log that contain a specific word in the event's
174+
message. It's possible that your specified **Message** parameter's value is included in the
172175
message's content but isn't displayed on the PowerShell console.
173176

174177
```powershell
@@ -217,8 +220,8 @@ Container :
217220
The `Get-EventLog` cmdlet uses the **LogName** parameter to specify the System event log. The
218221
**Newest** parameter selects the most recent event object. The object is stored in the `$A`
219222
variable. The object in the `$A` variable is sent down the pipeline to the `Select-Object` cmdlet.
220-
`Select-Object` uses the **Property** parameter with an asterisk (`*`) to select all of the
221-
object's properties.
223+
`Select-Object` uses the **Property** parameter with an asterisk (`*`) to select all of the object's
224+
properties.
222225

223226
### Example 9: Get events from an event log using a source and event ID
224227

@@ -238,11 +241,11 @@ Outlook 63 1073741887 The Exchange web service request succeeded.
238241
```
239242

240243
The `Get-EventLog` cmdlet uses the **LogName** parameter to specify the Application event log. The
241-
**Source** parameter specifies the application name, Outlook. The objects are sent down the
242-
pipeline to the `Where-Object` cmdlet. For each object in the pipeline, the `Where-Object` cmdlet
243-
uses the variable `$_.EventID` to compare the Event ID property to the specified value. The objects
244-
are sent down the pipeline to the `Select-Object` cmdlet. `Select-Object` uses the **Property**
245-
parameter to select the properties to display in the PowerShell console.
244+
**Source** parameter specifies the application name, Outlook. The objects are sent down the pipeline
245+
to the `Where-Object` cmdlet. For each object in the pipeline, the `Where-Object` cmdlet uses the
246+
variable `$_.EventID` to compare the Event ID property to the specified value. The objects are sent
247+
down the pipeline to the `Select-Object` cmdlet. `Select-Object` uses the **Property** parameter to
248+
select the properties to display in the PowerShell console.
246249

247250
### Example 10: Get events and group by a property
248251

@@ -259,9 +262,9 @@ Count Name
259262
4 NT AUTHORITY\NETWORK SERVICE
260263
```
261264

262-
The `Get-EventLog` cmdlet uses the **LogName** parameter to specify the System log. The
263-
**UserName** parameter includes the asterisk (`*`) wildcard to specify a portion of the user name.
264-
The event objects are sent down the pipeline to the `Group-Object` cmdlet. `Group-Object` uses the
265+
The `Get-EventLog` cmdlet uses the **LogName** parameter to specify the System log. The **UserName**
266+
parameter includes the asterisk (`*`) wildcard to specify a portion of the user name. The event
267+
objects are sent down the pipeline to the `Group-Object` cmdlet. `Group-Object` uses the
265268
**Property** parameter to specify that the **UserName** property is used to group the objects and
266269
count the number of objects for each user name. The **NoElement** parameter removes the group
267270
members from the output. The objects are sent down the pipeline to the `Select-Object` cmdlet.
@@ -299,9 +302,9 @@ event type. The date and time range is set by the **After** parameter and `$Begi
299302

300303
### -After
301304

302-
Gets events that occurred after a specified date and time. The **After** parameter date and time
303-
are excluded from the output. Enter a **DateTime** object, such as the value returned by the
304-
`Get-Date` cmdlet.
305+
Gets events that occurred after a specified date and time. The **After** parameter date and time are
306+
excluded from the output. Enter a **DateTime** object, such as the value returned by the `Get-Date`
307+
cmdlet.
305308

306309
```yaml
307310
Type: DateTime
@@ -372,15 +375,16 @@ Accept wildcard characters: False
372375

373376
### -ComputerName
374377

375-
Specifies a remote computer. If a **ComputerName** is not specified, `Get-EventLog` uses the local
376-
computer.
378+
This parameter specifies a remote computer's NetBIOS name, Internet Protocol (IP) address, or a
379+
fully qualified domain name (FQDN).
377380

378-
Type the NetBIOS name, an Internet Protocol (IP) address, or a fully qualified domain name (FQDN)
379-
of a remote computer. To specify the local computer, type the computer name, a dot (`.`), or
380-
localhost.
381+
If the **ComputerName** parameter isn't specified, `Get-EventLog` uses the default, which is the
382+
local computer. If you need to specify the local computer, the parameter accepts a dot (`.`), the
383+
loopback IP **127.0.0.1**, or **localhost**.
381384

382-
This parameter does not rely on Windows PowerShell remoting. You can use the **ComputerName**
383-
parameter of `Get-EventLog` even if your computer is not configured to run remote commands.
385+
The **ComputerName** parameter doesn't rely on Windows PowerShell remoting. You can use
386+
`Get-EventLog` with the **ComputerName** parameter even if your computer is not configured to run
387+
remote commands.
384388

385389
```yaml
386390
Type: String[]
@@ -421,8 +425,8 @@ Accept wildcard characters: False
421425

422426
### -Index
423427

424-
Specifies the index values to get from the event log. The parameter accepts a comma-separated
425-
string of values.
428+
Specifies the index values to get from the event log. The parameter accepts a comma-separated string
429+
of values.
426430

427431
```yaml
428432
Type: int[]
@@ -438,8 +442,8 @@ Accept wildcard characters: False
438442

439443
### -InstanceId
440444

441-
Specifies the Instance IDs to get from the event log. The parameter accepts a comma-separated
442-
string of values.
445+
Specifies the Instance IDs to get from the event log. The parameter accepts a comma-separated string
446+
of values.
443447

444448
```yaml
445449
Type: long[]
@@ -540,7 +544,7 @@ Accept wildcard characters: True
540544
### -UserName
541545

542546
Specifies, as a string array, user names that are associated with events. Enter names or name
543-
patterns, such as User01, User*, or Domain01\User*. Wildcards are permitted.
547+
patterns, such as `User01`, `User*`, or `Domain01\User*`. Wildcards are permitted.
544548

545549
```yaml
546550
Type: String[]
@@ -558,8 +562,7 @@ Accept wildcard characters: True
558562

559563
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
560564
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
561-
-WarningAction, and -WarningVariable. For more information, see
562-
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
565+
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
563566

564567
## INPUTS
565568

reference/4.0/Microsoft.PowerShell.Management/Get-EventLog.md

Lines changed: 45 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
ms.date: 1/18/2019
2+
ms.date: 3/26/2019
33
schema: 2.0.0
44
locale: en-us
55
keywords: powershell,cmdlet
@@ -19,9 +19,10 @@ computers.
1919
### LogName (Default)
2020

2121
```
22-
Get-EventLog [-LogName] <string> [[-InstanceId] <long[]>] [-ComputerName <string[]>] [-Newest
23-
<int>] [-After <datetime>] [-Before <datetime>] [-UserName <string[]>] [-Index <int[]>] [-EntryType
24-
<string[]>] [-Source <string[]>] [-Message <string>] [-AsBaseObject] [<CommonParameters>]
22+
Get-EventLog [-LogName] <string> [[-InstanceId] <long[]>] [-ComputerName <string[]>] [-Newest <int>]
23+
[-After <datetime>] [-Before <datetime>] [-UserName <string[]>] [-Index <int[]>]
24+
[-EntryType <string[]>] [-Source <string[]>] [-Message <string>] [-AsBaseObject]
25+
[<CommonParameters>]
2526
```
2627

2728
### List
@@ -32,14 +33,16 @@ Get-EventLog [-ComputerName <string[]>] [-List] [-AsString] [<CommonParameters>]
3233

3334
## DESCRIPTION
3435

35-
The `Get-EventLog` cmdlet gets events and event logs on the local and remote computers.
36+
The `Get-EventLog` cmdlet gets events and event logs from local and remote computers. By default,
37+
`Get-EventLog` gets logs from the local computer. To get logs from remote computers, use the
38+
**ComputerName** parameter.
3639

37-
You can use the cmdlet's parameters and property values to search for events. This cmdlet gets
40+
You can use the `Get-EventLog` parameters and property values to search for events. The cmdlet gets
3841
events that match the specified property values.
3942

40-
The cmdlets that contain the EventLog noun work only on classic event logs. To get events from logs
41-
that use the Windows Event Log technology in Windows Vista and later Windows versions, use
42-
`Get-WinEvent`.
43+
PowerShell cmdlets that contain the `EventLog` noun work only on Windows classic event logs such as
44+
Application, System, or Security. To get logs that use the Windows Event Log technology in Windows
45+
Vista and later Windows versions, use `Get-WinEvent`.
4346

4447
## EXAMPLES
4548

@@ -149,16 +152,16 @@ Index Time EntryType Source InstanceID Message
149152
```
150153

151154
The `Get-EventLog` cmdlet uses the **LogName** parameter to specify the System log. The
152-
**InstanceID** parameter selects the events with the specified Instance ID. The **Source**
153-
parameter specifies the event property.
155+
**InstanceID** parameter selects the events with the specified Instance ID. The **Source** parameter
156+
specifies the event property.
154157

155158
### Example 6: Get events from multiple computers
156159

157160
This command gets the events from the System event log on three computers: Server01, Server02, and
158-
the local computer known as localhost.
161+
Server03.
159162

160163
```powershell
161-
Get-EventLog -LogName System -ComputerName Server01, Server02, localhost
164+
Get-EventLog -LogName System -ComputerName Server01, Server02, Server03
162165
```
163166

164167
The `Get-EventLog` cmdlet uses the **LogName** parameter to specify the System log. The
@@ -167,8 +170,8 @@ to get the event logs.
167170

168171
### Example 7: Get all events that include a specific word in the message
169172

170-
This command gets all the events in the System event log that contain a specific word in the
171-
event's message. It's possible that your specified **Message** parameter's value is included in the
173+
This command gets all the events in the System event log that contain a specific word in the event's
174+
message. It's possible that your specified **Message** parameter's value is included in the
172175
message's content but isn't displayed on the PowerShell console.
173176

174177
```powershell
@@ -217,8 +220,8 @@ Container :
217220
The `Get-EventLog` cmdlet uses the **LogName** parameter to specify the System event log. The
218221
**Newest** parameter selects the most recent event object. The object is stored in the `$A`
219222
variable. The object in the `$A` variable is sent down the pipeline to the `Select-Object` cmdlet.
220-
`Select-Object` uses the **Property** parameter with an asterisk (`*`) to select all of the
221-
object's properties.
223+
`Select-Object` uses the **Property** parameter with an asterisk (`*`) to select all of the object's
224+
properties.
222225

223226
### Example 9: Get events from an event log using a source and event ID
224227

@@ -238,11 +241,11 @@ Outlook 63 1073741887 The Exchange web service request succeeded.
238241
```
239242

240243
The `Get-EventLog` cmdlet uses the **LogName** parameter to specify the Application event log. The
241-
**Source** parameter specifies the application name, Outlook. The objects are sent down the
242-
pipeline to the `Where-Object` cmdlet. For each object in the pipeline, the `Where-Object` cmdlet
243-
uses the variable `$_.EventID` to compare the Event ID property to the specified value. The objects
244-
are sent down the pipeline to the `Select-Object` cmdlet. `Select-Object` uses the **Property**
245-
parameter to select the properties to display in the PowerShell console.
244+
**Source** parameter specifies the application name, Outlook. The objects are sent down the pipeline
245+
to the `Where-Object` cmdlet. For each object in the pipeline, the `Where-Object` cmdlet uses the
246+
variable `$_.EventID` to compare the Event ID property to the specified value. The objects are sent
247+
down the pipeline to the `Select-Object` cmdlet. `Select-Object` uses the **Property** parameter to
248+
select the properties to display in the PowerShell console.
246249

247250
### Example 10: Get events and group by a property
248251

@@ -259,9 +262,9 @@ Count Name
259262
4 NT AUTHORITY\NETWORK SERVICE
260263
```
261264

262-
The `Get-EventLog` cmdlet uses the **LogName** parameter to specify the System log. The
263-
**UserName** parameter includes the asterisk (`*`) wildcard to specify a portion of the user name.
264-
The event objects are sent down the pipeline to the `Group-Object` cmdlet. `Group-Object` uses the
265+
The `Get-EventLog` cmdlet uses the **LogName** parameter to specify the System log. The **UserName**
266+
parameter includes the asterisk (`*`) wildcard to specify a portion of the user name. The event
267+
objects are sent down the pipeline to the `Group-Object` cmdlet. `Group-Object` uses the
265268
**Property** parameter to specify that the **UserName** property is used to group the objects and
266269
count the number of objects for each user name. The **NoElement** parameter removes the group
267270
members from the output. The objects are sent down the pipeline to the `Select-Object` cmdlet.
@@ -299,9 +302,9 @@ event type. The date and time range is set by the **After** parameter and `$Begi
299302

300303
### -After
301304

302-
Gets events that occurred after a specified date and time. The **After** parameter date and time
303-
are excluded from the output. Enter a **DateTime** object, such as the value returned by the
304-
`Get-Date` cmdlet.
305+
Gets events that occurred after a specified date and time. The **After** parameter date and time are
306+
excluded from the output. Enter a **DateTime** object, such as the value returned by the `Get-Date`
307+
cmdlet.
305308

306309
```yaml
307310
Type: DateTime
@@ -372,15 +375,16 @@ Accept wildcard characters: False
372375

373376
### -ComputerName
374377

375-
Specifies a remote computer. If a **ComputerName** is not specified, `Get-EventLog` uses the local
376-
computer.
378+
This parameter specifies a remote computer's NetBIOS name, Internet Protocol (IP) address, or a
379+
fully qualified domain name (FQDN).
377380

378-
Type the NetBIOS name, an Internet Protocol (IP) address, or a fully qualified domain name (FQDN)
379-
of a remote computer. To specify the local computer, type the computer name, a dot (`.`), or
380-
localhost.
381+
If the **ComputerName** parameter isn't specified, `Get-EventLog` uses the default, which is the
382+
local computer. If you need to specify the local computer, the parameter accepts a dot (`.`), the
383+
loopback IP **127.0.0.1**, or **localhost**.
381384

382-
This parameter does not rely on Windows PowerShell remoting. You can use the **ComputerName**
383-
parameter of `Get-EventLog` even if your computer is not configured to run remote commands.
385+
The **ComputerName** parameter doesn't rely on Windows PowerShell remoting. You can use
386+
`Get-EventLog` with the **ComputerName** parameter even if your computer is not configured to run
387+
remote commands.
384388

385389
```yaml
386390
Type: String[]
@@ -421,8 +425,8 @@ Accept wildcard characters: False
421425

422426
### -Index
423427

424-
Specifies the index values to get from the event log. The parameter accepts a comma-separated
425-
string of values.
428+
Specifies the index values to get from the event log. The parameter accepts a comma-separated string
429+
of values.
426430

427431
```yaml
428432
Type: int[]
@@ -438,8 +442,8 @@ Accept wildcard characters: False
438442

439443
### -InstanceId
440444

441-
Specifies the Instance IDs to get from the event log. The parameter accepts a comma-separated
442-
string of values.
445+
Specifies the Instance IDs to get from the event log. The parameter accepts a comma-separated string
446+
of values.
443447

444448
```yaml
445449
Type: long[]
@@ -540,7 +544,7 @@ Accept wildcard characters: True
540544
### -UserName
541545

542546
Specifies, as a string array, user names that are associated with events. Enter names or name
543-
patterns, such as User01, User*, or Domain01\User*. Wildcards are permitted.
547+
patterns, such as `User01`, `User*`, or `Domain01\User*`. Wildcards are permitted.
544548

545549
```yaml
546550
Type: String[]
@@ -558,8 +562,7 @@ Accept wildcard characters: True
558562

559563
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
560564
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
561-
-WarningAction, and -WarningVariable. For more information, see
562-
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
565+
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
563566

564567
## INPUTS
565568

0 commit comments

Comments
 (0)