Skip to content

Commit d588f6d

Browse files
authored
Merge pull request Azure#9843 from theheatDK/patch-6
Update New-AzOperationalInsightsWindowsEventDataSource.md
2 parents b92b3c7 + 0073305 commit d588f6d

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

src/OperationalInsights/OperationalInsights/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
-->
2020
## Upcoming Release
2121
* Fixed miscellaneous typos across module
22+
* Added an example for New-AzOperationalInsightsWindowsEventDataSource
23+
* Changed the description of the -Name parameter for New-AzOperationalInsightsWindowsEventDataSource
2224

2325
## Version 1.3.2
2426
* Updated default version for saved searches to be 1.

src/OperationalInsights/OperationalInsights/help/New-AzOperationalInsightsWindowsEventDataSource.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,34 @@ The **New-AzOperationalInsightsWindowsEventDataSource** cmdlet adds a data sourc
3232

3333
## EXAMPLES
3434

35+
### Example 1: Create system Windows event data source
36+
```
37+
$EventLogNames = @()
38+
$EventLogNames += 'Directory Service'
39+
$EventLogNames += 'Microsoft-Windows-EventCollector/Operational'
40+
$EventLogNames += 'System'
41+
$ResourceGroupName = 'MyResourceGroup'
42+
$WorkspaceName = 'MyWorkspaceName'
43+
44+
$Count = 0
45+
foreach ($EventLogName in $EventLogNames) {
46+
$Count++
47+
$null = New-AzOperationalInsightsWindowsEventDataSource `
48+
-ResourceGroupName $ResourceGroupName `
49+
-WorkspaceName $WorkspaceName `
50+
-Name "Windows-event-$($Count)" `
51+
-EventLogName $EventLogName `
52+
-CollectErrors `
53+
-CollectWarnings `
54+
-CollectInformation
55+
}
56+
57+
Get-AzOperationalInsightsDataSource `
58+
-ResourceGroupName $ResourceGroupName `
59+
-WorkspaceName $WorkspaceName `
60+
-Kind 'WindowsEvent'
61+
```
62+
3563
## PARAMETERS
3664

3765
### -CollectErrors
@@ -125,7 +153,7 @@ Accept wildcard characters: False
125153
```
126154
127155
### -Name
128-
Specifies a name for the data source.
156+
Specifies a name for the data source. The name is not exposed in the Azure Portal and any string can be used as long as it is unique.
129157
130158
```yaml
131159
Type: System.String

0 commit comments

Comments
 (0)