-
Notifications
You must be signed in to change notification settings - Fork 0
/
Get-DscError.html
147 lines (119 loc) · 6.05 KB
/
Get-DscError.html
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>PowerShell - Get-DscError - Carbon</title>
<link href="silk.css" type="text/css" rel="stylesheet" />
<link href="styles.css" type="text/css" rel="stylesheet" />
</head>
<body>
<ul id="SiteNav">
<li><a href="index.html">Get-Carbon</a></li>
<li><a href="about_Carbon_Installation.html">-Install</a></li>
<li><a href="documentation.html">-Documentation</a></li>
<li><a href="about_Carbon_Support.html">-Support</a></li>
<li><a href="releasenotes.html">-ReleaseNotes</a></li>
<li><a href="http://pshdo.com">-Blog</a></li>
<li><a href="https://github.com/webmd-health-services/Carbon/">-Project</a></li>
</ul>
<h1>Get-DscError</h1>
<div class="Synopsis">
<p>Gets DSC errors from a computer's event log.</p>
</div>
<h2>Syntax</h2>
<pre class="Syntax"><code>Get-DscError [-ComputerName <String[]>] [-StartTime <DateTime>] [-EndTime <DateTime>] [<CommonParameters>]
</code></pre>
<pre class="Syntax"><code>
</code></pre>
<pre class="Syntax"><code>Get-DscError [-ComputerName <String[]>] [-StartTime <DateTime>] [-EndTime <DateTime>] -Wait [-WaitTimeoutSeconds <UInt32>] [<CommonParameters>]</code></pre>
<h2>Description</h2>
<div class="Description">
<p>The DSC Local Configuration Manager (LCM) writes any errors it encounters to the <code>Microsoft-Windows-DSC/Operational</code> event log, in addition to some error messages that report that encountered an error. This function gets just the important error log messages, skipping the superflous ones that won't help you track down where the problem is.</p>
<p>By default, errors on the local computer are returned. You can return errors from another computer via the <code>ComputerName</code> parameter.</p>
<p>You can filter the results further with the <code>StartTime</code> and <code>EndTime</code> parameters. <code>StartTime</code> will return entries after the given time. <code>EndTime</code> will return entries before the given time.</p>
<p>If no items are found, nothing is returned.</p>
<p>It can take several seconds for event log entries to get written to the log, so you might not get results back. If you want to wait for entries to come back, use the <code>-Wait</code> switch. You can control how long to wait (in seconds) via the <code>WaitTimeoutSeconds</code> parameter. The default is 10 seconds.</p>
<p>When getting errors on a remote computer, that computer must have Remote Event Log Management firewall rules enabled. To enable them, run</p>
<pre><code>Get-FirewallRule -Name '*Remove Event Log Management*' |
ForEach-Object { netsh advfirewall firewall set rule name= $_.Name new enable=yes }
</code></pre>
<p><code>Get-DscError</code> is new in Carbon 2.0.</p>
</div>
<h2>Related Commands</h2>
<ul class="RelatedCommands">
<li><a href="Write-DscError.html">Write-DscError</a></li>
</ul>
<h2> Parameters </h2>
<table id="Parameters">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required?</th>
<th>Pipeline Input</th>
<th>Default Value</th>
</tr>
<tr valign='top'>
<td>ComputerName</td>
<td><a href="http://msdn.microsoft.com/en-us/library/system.string.aspx">String[]</a></td>
<td class="ParamDescription"><p>The computer whose DSC errors to return.</p></td>
<td>false</td>
<td>false</td>
<td></td>
</tr>
<tr valign='top'>
<td>StartTime</td>
<td><a href="http://msdn.microsoft.com/en-us/library/system.datetime.aspx">DateTime</a></td>
<td class="ParamDescription"><p>Get errors that occurred after this date/time.</p></td>
<td>false</td>
<td>false</td>
<td></td>
</tr>
<tr valign='top'>
<td>EndTime</td>
<td><a href="http://msdn.microsoft.com/en-us/library/system.datetime.aspx">DateTime</a></td>
<td class="ParamDescription"><p>Get errors that occurred before this date/time.</p></td>
<td>false</td>
<td>false</td>
<td></td>
</tr>
<tr valign='top'>
<td>Wait</td>
<td><a href="http://msdn.microsoft.com/en-us/library/system.management.automation.switchparameter.aspx">SwitchParameter</a></td>
<td class="ParamDescription"><p>Wait for entries to appear, as it can sometimes take several seconds for entries to get written to the event log.</p></td>
<td>true</td>
<td>false</td>
<td>False</td>
</tr>
<tr valign='top'>
<td>WaitTimeoutSeconds</td>
<td><a href="http://msdn.microsoft.com/en-us/library/system.uint32.aspx">UInt32</a></td>
<td class="ParamDescription"><p>The time to wait for entries to appear before giving up. Default is 10 seconds. There is no way to wait an infinite amount of time.</p></td>
<td>false</td>
<td>false</td>
<td>10</td>
</tr>
</table>
<h2>Return Values</h2>
<div class="ReturnValues">
<p><a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.eventing.reader.eventlogrecord.aspx">System.Diagnostics.Eventing.Reader.EventLogRecord</a>. </p>
</div>
<h2>EXAMPLE 1</h2>
<pre><code>Get-DscWinEvent</code></pre>
<p>Demonstrates how to get all the DSC errors from the local computer.</p>
<h2>EXAMPLE 2</h2>
<pre><code>Get-DscError -ComputerName 10.1.2.3</code></pre>
<p>Demonstrates how to get all the DSC errors from a specific computer.</p>
<h2>EXAMPLE 3</h2>
<pre><code>Get-DscError -StartTime '8/1/2014 0:00'</code></pre>
<p>Demonstrates how to get errors that occurred <em>after</em> a given time.</p>
<h2>EXAMPLE 4</h2>
<pre><code>Get-DscError -EndTime '8/30/2014 11:59:59'</code></pre>
<p>Demonstrates how to get errors that occurred <em>before</em> a given time.</p>
<h2>EXAMPLE 5</h2>
<pre><code>Get-DscError -StartTime '8/1/2014 2:58 PM' -Wait -WaitTimeoutSeconds 5</code></pre>
<p>Demonstrates how to wait for entries that match the specified criteria to appear in the event log. It can take several seconds between the time a log entry is written to when you can read it.</p>
<div class="Footer">
Copyright 2012 - 2018 <a href="http://pshdo.com">Aaron Jensen</a>.
</div>
</body>
</html>