-
Notifications
You must be signed in to change notification settings - Fork 81
/
Copy path6-WindowsEventLog_RegisterEventSource_Config.ps1
88 lines (80 loc) · 2.54 KB
/
6-WindowsEventLog_RegisterEventSource_Config.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<#PSScriptInfo
.VERSION 1.0.0
.GUID 857f9f25-082e-4274-9efd-0908f49bb516
.AUTHOR DSC Community
.COMPANYNAME DSC Community
.COPYRIGHT Copyright the DSC Community contributors. All rights reserved.
.TAGS DSCConfiguration
.LICENSEURI https://github.com/dsccommunity/ComputerManagementDsc/blob/master/LICENSE
.PROJECTURI https://github.com/dsccommunity/ComputerManagementDsc
.ICONURI
.EXTERNALMODULEDEPENDENCIES
.REQUIREDSCRIPTS
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES First version.
.PRIVATEDATA 2016-Datacenter,2016-Datacenter-Server-Core
#>
#Requires -module ComputerManagementDsc
<#
.DESCRIPTION
Example script that registers MyEventSource as an event
source on the Application log.
#>
Configuration WindowsEventLog_RegisterEventSource_Config
{
Import-DSCResource -ModuleName ComputerManagementDsc
Node localhost
{
WindowsEventLog Application
{
LogName = 'Application'
RegisteredSource = 'MyEventSource'
}
}
}
<#
.DESCRIPTION
Example script that registers MyEventSource as an event
source with a message resource file on the Application log.
#>
Configuration WindowsEventLog_RegisterEventSource_Config
{
Import-DSCResource -ModuleName ComputerManagementDsc
Node localhost
{
File MyEventSourceMessageDll
{
Ensure = 'Present'
Type = 'File'
SourcePath = '\\PULLSERVER\Files\MyEventSource.dll'
DestinationPath = 'C:\Windows\System32\MyEVentSource.dll'
}
WindowsEventLog Application
{
LogName = 'Application'
RegisteredSource = 'MyEventSource'
MessageResourceFile = 'C:\Windows\System32\MyEventSource.dll'
DependsOn = '[File]MyEventSourceMessageDll'
}
}
}
<#
.DESCRIPTION
Example script that registers MyEventSource as an event
source with all resource files on the Application log.
#>
Configuration WindowsEventLog_RegisterEventSource_Config
{
Import-DSCResource -ModuleName ComputerManagementDsc
Node localhost
{
WindowsEventLog Application
{
LogName = 'Application'
RegisteredSource = 'MyEventSource'
CategoryResourceFile = 'C:\Windows\System32\MyEventSource.Category.dll'
MessageResourceFile = 'C:\Windows\System32\MyEventSource.Messages.dll'
ParameterResourceFile = 'C:\Windows\System32\MyEventSource.Parameters.dll'
}
}
}