<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Uhrzeit &#8211; Haikos Blog</title>
	<atom:link href="https://www.hertes.net/tag/uhrzeit/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.hertes.net</link>
	<description>Blog von Haiko Hertes zu allen Themen rund um Microsoft, Cloud und Datacenter</description>
	<lastBuildDate>Mon, 02 Jul 2018 21:13:11 +0000</lastBuildDate>
	<language>de</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>PowerShell &#8211; Windows Client oder Windows Server als NTP Server benutzen</title>
		<link>https://www.hertes.net/2018/06/powershell-windows-client-oder-windows-server-als-ntp-server-benutzen/</link>
					<comments>https://www.hertes.net/2018/06/powershell-windows-client-oder-windows-server-als-ntp-server-benutzen/#comments</comments>
		
		<dc:creator><![CDATA[Haiko]]></dc:creator>
		<pubDate>Thu, 28 Jun 2018 19:41:17 +0000</pubDate>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Windows Client]]></category>
		<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[NTP]]></category>
		<category><![CDATA[Uhrzeit]]></category>
		<category><![CDATA[W32Time]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Zeitserver]]></category>
		<guid isPermaLink="false">https://www.hertes.net/?p=3683</guid>

					<description><![CDATA[Sicherlich ist den Meisten bekannt, dass Windows seit vielen Generationen out-of-the-box als NTP-Client genutzt werden kann &#8211; also die Uhrzeit von einem NTP-Server beziehen kann. Aber dass sowohl Windows Server (seit WS2003) als auch Windows Client (seit Win XP) auch mit Bordmitteln als NTP-Server genutzt werden können, dürfte weitgehend unbekannt sein. Das Ganze lässt sich in einigen wenigen Schritten erreichen: Windows Zeitdienst W32Time auf automatischen Start setzen W32Time als NTP-Server konfigurieren (Registrierungsschlüssel) W32Time Dienst neustarten Firewall auf udp/123 für Verbindungen von außen öffnen Natürlich kann man das sehr effizient mittels PowerShell erledigen. Dazu habe ich ein einfaches Script geschrieben: #&#8230;]]></description>
										<content:encoded><![CDATA[<p>Sicherlich ist den Meisten bekannt, dass Windows seit vielen Generationen out-of-the-box als NTP-Client genutzt werden kann &#8211; also die Uhrzeit von einem NTP-Server beziehen kann. Aber dass sowohl Windows Server (seit WS2003) als auch Windows Client (seit Win XP) auch mit Bordmitteln als NTP-Server genutzt werden können, dürfte weitgehend unbekannt sein. Das Ganze lässt sich in einigen wenigen Schritten erreichen:</p>
<ul>
<li>Windows Zeitdienst W32Time auf automatischen Start setzen</li>
<li>W32Time als NTP-Server konfigurieren (Registrierungsschlüssel)</li>
<li>W32Time Dienst neustarten</li>
<li>Firewall auf udp/123 für Verbindungen von außen öffnen</li>
</ul>
<p>Natürlich kann man das sehr effizient mittels PowerShell erledigen. Dazu habe ich ein einfaches Script geschrieben:</p>
<pre lang="PowerShell">
# This script makes a Windows 10 PC acting as a NTP server 

#Enable autostart for W32Time Service
Set-Service -Name W32Time -StartupType Automatic

# Configure W32Time Service to act as a NTP server
Set-ItemProperty -Path HKLM:\System\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer -Name Enabled -Value 1

# Update W32Time service
w32tm.exe /config /update

# Restart W32Time service
Restart-Service -Name W32Time

# Check configuration - VMICTimeProvider / Enabled should be "1" now
w32tm.exe /query /configuration

# Create an inbound rule for the Windows Firewall
New-NetFirewallRule -DisplayName "Allow NTP UDP/123 Incomming" -Profile Any -Action Allow -Direction Inbound -LocalPort 123 -Protocol udp -Enabled true
</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://www.hertes.net/2018/06/powershell-windows-client-oder-windows-server-als-ntp-server-benutzen/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>AD Dom&#228;nen Controller: Zeitdifferenz / Time Skew zum PDC-Emulator</title>
		<link>https://www.hertes.net/2016/02/ad-domnen-controller-zeitdifferenz-time-skew-zum-pdc-emulator/</link>
					<comments>https://www.hertes.net/2016/02/ad-domnen-controller-zeitdifferenz-time-skew-zum-pdc-emulator/#respond</comments>
		
		<dc:creator><![CDATA[Haiko]]></dc:creator>
		<pubDate>Mon, 15 Feb 2016 17:13:00 +0000</pubDate>
				<category><![CDATA[ActiveDirectory]]></category>
		<category><![CDATA[System Center]]></category>
		<category><![CDATA[System Center Operations Manager]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[AD]]></category>
		<category><![CDATA[Operations Manager]]></category>
		<category><![CDATA[PDC]]></category>
		<category><![CDATA[SCOM]]></category>
		<category><![CDATA[Uhrzeit]]></category>
		<category><![CDATA[Zeit]]></category>
		<guid isPermaLink="false">http://www.hertes.net/?p=3140</guid>

					<description><![CDATA[Bei der Prüfung von SCOM-Warnungen fiel mir diese hier besonders ins Auge: Die Meldung “The Time Skew latency is above the configured threshold” besagt im Wesentlichen, dass die Zeitdifferenz zwischen einem “normalen” DC und dem PDC-Emulator zu hoch ist, in diesem Fall bei 267 Sekunden liegt und damit über der Warnungs-Schwelle von 5 Sekunden. Und tatsächlich, die Server haben eine sichtbare Zeitdifferenz: Nun ist es ja so, dass alle Server einer Domäne die Uhrzeit beim PDC-Emulator abholen – oder es zumindest sollten. Dieser wiederum sollte so konfiguriert sein, dass er die Zeit von einer gültigen externen Zeitquelle empfängt. Das erreicht&#8230;]]></description>
										<content:encoded><![CDATA[<p>Bei der Prüfung von SCOM-Warnungen fiel mir diese hier besonders ins Auge:</p>
<p><a href="https://www.hertes.net/wp-content/uploads/2016/02/ADTime0.png"><img decoding="async" style="background-image: none; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; margin-right: auto; border-width: 0px;" title="ADTime0" src="https://www.hertes.net/wp-content/uploads/2016/02/ADTime0_thumb.png" alt="ADTime0" width="99%" border="0" /></a></p>
<p><a href="https://www.hertes.net/wp-content/uploads/2016/02/ADTime1.png"><img decoding="async" class="aligncenter" style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="ADTime1" src="https://www.hertes.net/wp-content/uploads/2016/02/ADTime1_thumb.png" alt="ADTime1" width="50%" border="0" /></a></p>
<p>Die Meldung “The Time Skew latency is above the configured threshold” besagt im Wesentlichen, dass die Zeitdifferenz zwischen einem “normalen” DC und dem PDC-Emulator zu hoch ist, in diesem Fall bei 267 Sekunden liegt und damit über der Warnungs-Schwelle von 5 Sekunden. Und tatsächlich, die Server haben eine sichtbare Zeitdifferenz:</p>
<p><a href="https://www.hertes.net/wp-content/uploads/2016/02/ADTime2.png"><img decoding="async" class="aligncenter" style="background-image: none; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; margin-right: auto; border: 0px;" title="ADTime2" src="https://www.hertes.net/wp-content/uploads/2016/02/ADTime2_thumb.png" alt="ADTime2" width="50%" border="0" /></a></p>
<p>Nun ist es ja so, dass alle Server einer Domäne die Uhrzeit beim PDC-Emulator abholen – oder es zumindest sollten. Dieser wiederum sollte so konfiguriert sein, dass er die Zeit von einer gültigen externen Zeitquelle empfängt. Das erreicht man recht einfach mit folgenden Aufrufen:</p>
<blockquote><p><span style="font-family: 'Courier New';">w32tm.exe /config /manualpeerlist:”0.de.pool.ntp.org 1.de.pool.ntp.org 2.de.pool.ntp.org 3.de.pool.ntp.org” /syncfromflags:manual /reliable:YES /update</span></p>
<p><span style="font-family: 'Courier New';">w32tm.exe /config /update</span></p>
<p><span style="font-family: 'Courier New';">PS: Restart-Service w32time</span></p></blockquote>
<p>Im festen Glauben, dass dies auch in meiner Umgebung so ist, habe ich dies dennoch gegengeprüft:</p>
<p>Der Aufruf</p>
<blockquote><p><span style="font-family: 'Courier New';">netdom query fsmo</span></p></blockquote>
<p>liefert die Verteilung der FSMO-Rollen, u.a. erfährt man eben auch, welcher DC aktuell der PDC-Emulator ist.</p>
<p><a href="https://www.hertes.net/wp-content/uploads/2016/02/ADTime3.png"><img fetchpriority="high" decoding="async" style="background-image: none; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; margin-right: auto; border: 0px;" title="ADTime3" src="https://www.hertes.net/wp-content/uploads/2016/02/ADTime3_thumb.png" alt="ADTime3" width="1028" height="287" border="0" /></a></p>
<p>Nun kann man mit</p>
<blockquote><p><span style="font-family: 'Courier New';">w32tm /monitor</span></p></blockquote>
<p>auf einem der DCs prüfen, welcher DC woher seine Zeit bekommt:</p>
<p><a href="https://www.hertes.net/wp-content/uploads/2016/02/ADTime4.png"><img decoding="async" style="background-image: none; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; margin-right: auto; border: 0px;" title="ADTime4" src="https://www.hertes.net/wp-content/uploads/2016/02/ADTime4_thumb.png" alt="ADTime4" width="1028" height="505" border="0" /></a></p>
<p>Und siehe da – die beiden DCs, die nicht PDC-Emulator sind bekommen ihre Zeit von irgend einem Server “frei im Internet”. Dies kann z.B. daran liegen, dass diese DCs früher mal PDC-Emulator waren und daher noch auf die Synchronisierung mit einer externen Quelle eingestellt sind. Dies lässt sich sehr leicht auf den betreffenden DCs (also denjenigen, die kein PDC-Emulator mehr sind) beheben. Dazu ist lediglich der Aufruf</p>
<blockquote><p><span style="font-family: 'Courier New';">w32tm /config /syncfromflags:domhier /update</span></p>
<p><span style="font-family: 'Courier New';">net stop w32time</span></p>
<p><span style="font-family: 'Courier New';">net start w32time</span></p></blockquote>
<p>notwendig:</p>
<p><a href="https://www.hertes.net/wp-content/uploads/2016/02/ADTime5.png"><img decoding="async" style="background-image: none; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; margin-right: auto; border: 0px;" title="ADTime5" src="https://www.hertes.net/wp-content/uploads/2016/02/ADTime5_thumb.png" alt="ADTime5" width="1028" height="359" border="0" /></a></p>
<p>Nach kurzer Zeit sollte die Uhrzeit dann wieder passen. Zur Sicherheit kann man dies nun noch einmal mit</p>
<blockquote><p><span style="font-family: 'Courier New';">w32tm /monitor</span></p></blockquote>
<p>überprüfen:</p>
<p><a href="https://www.hertes.net/wp-content/uploads/2016/02/ADTime6.png"><img loading="lazy" decoding="async" style="background-image: none; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; margin-right: auto; border: 0px;" title="ADTime6" src="https://www.hertes.net/wp-content/uploads/2016/02/ADTime6_thumb.png" alt="ADTime6" width="1028" height="505" border="0" /></a></p>
<p>Jetzt sieht man, dass die beiden ersten DCs (beide kein PDC-Emulator) von HVSRV10 (dem PDC-Emulator) synchronisieren und dieser wiederum von einer externen Zeitquelle (stammt aus dem NTP-Pool).</p>
<p>Nun stimmen auch die Zeiten aller DCs wieder überein:</p>
<p><a href="https://www.hertes.net/wp-content/uploads/2016/02/ADTime7.png"><img loading="lazy" decoding="async" style="background-image: none; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; margin-right: auto; border: 0px;" title="ADTime7" src="https://www.hertes.net/wp-content/uploads/2016/02/ADTime7_thumb.png" alt="ADTime7" width="644" height="343" border="0" /></a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.hertes.net/2016/02/ad-domnen-controller-zeitdifferenz-time-skew-zum-pdc-emulator/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
