Windows Server
 Computer >> コンピューター >  >> システム >> Windows Server

CMD、PowerShell、およびGPOを介したWindowsのタイムゾーン設定の変更

タイムゾーン は、時刻と日付とともに、コンピューターの重要なパラメーターの1つです。 Windowsとアプリケーションが正しく機能するには、コンピューターの地理的な場所に応じてタイムゾーンを設定する必要があります。この記事では、GUI、コマンドプロンプト、PowerShell、およびグループポリシーの使用から、Windowsのタイムゾーンを変更する方法について説明します。

新しい設定アプリは、Windows10およびWindowsServer 2019/2016で使用され、日付とタイムゾーンを設定します。 GUIからタイムゾーンを設定するには、システムトレイの時計アイコンを右クリックし、[日付/時刻の調整]を選択します。 。デフォルトでは、Windowsはタイムゾーンを自動的に選択しようとします(タイムゾーンを自動的に設定 オプションが有効になっています)。このオプションを無効にして、ドロップダウンリストで選択することにより、必要なタイムゾーンを手動で設定できます。

CMD、PowerShell、およびGPOを介したWindowsのタイムゾーン設定の変更

CMD、PowerShell、およびGPOを介したWindowsのタイムゾーン設定の変更

ヒント 。従来の「日付と時刻」コントロールパネルアプレットを使用して、Windowsのタイムゾーン設定を変更することもできます。コマンドtimedate.cplを実行します 。

CMD、PowerShell、およびGPOを介したWindowsのタイムゾーン設定の変更

内容:

  • ユーザーによるWindowsのタイムゾーンの変更を許可または禁止する
  • TZUtil.exe:Windows 10 CMDでタイムゾーンを変更するにはどうすればよいですか?
  • PowerShellを介したWindowsタイムゾーンの設定
  • グループポリシーを使用したタイムゾーンの構成
  • Windows Server 2019 / Windows 10でタイムゾーンを変更できない:権限がありません

ユーザーによるWindowsのタイムゾーンの変更を許可または禁止する

デフォルトでは、ユーザーはタイムゾーンを変更するための管理者権限を必要としません(日付/時刻の変更とは異なります)。この動作は、ローカルセキュリティ設定を使用して変更できます コンソール(secpol.msc )。 [セキュリティ設定]->[ローカルポリシー]->[ユーザー権利の割り当て]に移動します 。ポリシーはタイムゾーンの変更と呼ばれます 。ご覧のとおり、タイムゾーンは、システム、管理者、およびすべてのユーザーが変更できます。ユーザーがタイムゾーンを変更できないようにするには、ユーザーを削除します このポリシーのアカウントのリストからグループ化します。

CMD、PowerShell、およびGPOを介したWindowsのタイムゾーン設定の変更

Windows Serverでは、ローカルサービスと管理者のみがタイムゾーンを変更する権限を持っています。

Hyper-VサーバーおよびWindowsServerコアでは、組み込みの sconfigを使用してタイムゾーンを設定できます。 効用。

TZUtil.exe:Windows 10 CMDでタイムゾーンを変更するにはどうすればよいですか?

Windows 11/10/8.1およびWindowsServer2019/2016/2012 R2 /のタイムゾーンを変更するには、特別なコマンドラインツール tzutil.exe (Windowsタイムゾーンユーティリティ)を使用します。これはWindows7で最初に登場しました。ツールの実行可能ファイルは%WINDIR%\System32にあります。 ディレクトリ。

TZUtil.exeツールの機能について考えてみましょう。

コマンドプロンプト(cmd.exe)を実行します )。現在のタイムゾーンとその識別子(TimeZoneID)を確認するには、次のコマンドを実行します。

tzutil /g
CMD、PowerShell、およびGPOを介したWindowsのタイムゾーン設定の変更

この例では、太平洋標準時 は現在のタイムゾーン識別子です。

使用可能なすべてのタイムゾーンのリストを次のように表示します。
tzutil /l
CMD、PowerShell、およびGPOを介したWindowsのタイムゾーン設定の変更

TimeZone Id	 | 	TimeZone  DisplayName
Dateline Standard Time	 | 	(UTC-12:00) International Date Line West
UTC-11	 | 	(UTC-11:00) Coordinated Universal Time-11
Aleutian Standard Time	 | 	(UTC-10:00) Aleutian Islands
Hawaiian Standard Time	 | 	(UTC-10:00) Hawaii
Marquesas Standard Time	 | 	(UTC-09:30) Marquesas Islands
Alaskan Standard Time	 | 	(UTC-09:00) Alaska
UTC-09	 | 	(UTC-09:00) Coordinated Universal Time-09
Pacific Standard Time (Mexico)	 | 	(UTC-08:00) Baja California
UTC-08	 | 	(UTC-08:00) Coordinated Universal Time-08
Pacific Standard Time	 | 	(UTC-08:00) Pacific Time (US & Canada)
US Mountain Standard Time	 | 	(UTC-07:00) Arizona
Mountain Standard Time (Mexico)	 | 	(UTC-07:00) Chihuahua, La Paz, Mazatlan
Mountain Standard Time	 | 	(UTC-07:00) Mountain Time (US & Canada)
Central America Standard Time	 | 	(UTC-06:00) Central America
Central Standard Time	 | 	(UTC-06:00) Central Time (US & Canada)
Easter Island Standard Time	 | 	(UTC-06:00) Easter Island
Central Standard Time (Mexico)	 | 	(UTC-06:00) Guadalajara, Mexico City, Monterrey
Canada Central Standard Time	 | 	(UTC-06:00) Saskatchewan
SA Pacific Standard Time	 | 	(UTC-05:00) Bogota, Lima, Quito, Rio Branco
Eastern Standard Time (Mexico)	 | 	(UTC-05:00) Chetumal
Eastern Standard Time	 | 	(UTC-05:00) Eastern Time (US & Canada)
Haiti Standard Time	 | 	(UTC-05:00) Haiti
Cuba Standard Time	 | 	(UTC-05:00) Havana
US Eastern Standard Time	 | 	(UTC-05:00) Indiana (East)
Turks And Caicos Standard Time	 | 	(UTC-05:00) Turks and Caicos
Paraguay Standard Time	 | 	(UTC-04:00) Asuncion
Atlantic Standard Time	 | 	(UTC-04:00) Atlantic Time (Canada)
Venezuela Standard Time	 | 	(UTC-04:00) Caracas
Central Brazilian Standard Time	 | 	(UTC-04:00) Cuiaba
SA Western Standard Time	 | 	(UTC-04:00) Georgetown, La Paz, Manaus, San Juan
Pacific SA Standard Time	 | 	(UTC-04:00) Santiago
Newfoundland Standard Time	 | 	(UTC-03:30) Newfoundland
Tocantins Standard Time	 | 	(UTC-03:00) Araguaina
E. South America Standard Time	 | 	(UTC-03:00) Brasilia
SA Eastern Standard Time	 | 	(UTC-03:00) Cayenne, Fortaleza
Argentina Standard Time	 | 	(UTC-03:00) City of Buenos Aires
Greenland Standard Time	 | 	(UTC-03:00) Greenland
Montevideo Standard Time	 | 	(UTC-03:00) Montevideo
Magallanes Standard Time	 | 	(UTC-03:00) Punta Arenas
Saint Pierre Standard Time	 | 	(UTC-03:00) Saint Pierre and Miquelon
Bahia Standard Time	 | 	(UTC-03:00) Salvador
UTC-02	 | 	(UTC-02:00) Coordinated Universal Time-02
Mid-Atlantic Standard Time	 | 	(UTC-02:00) Mid-Atlantic - Old
Azores Standard Time	 | 	(UTC-01:00) Azores
Cape Verde Standard Time	 | 	(UTC-01:00) Cabo Verde Is.
UTC	 | 	(UTC) Coordinated Universal Time
Morocco Standard Time	 | 	(UTC+00:00) Casablanca
GMT Standard Time	 | 	(UTC+00:00) Dublin, Edinburgh, Lisbon, London
Greenwich Standard Time	 | 	(UTC+00:00) Monrovia, Reykjavik
W. Europe Standard Time	 | 	(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna
Central Europe Standard Time	 | 	(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague
Romance Standard Time	 | 	(UTC+01:00) Brussels, Copenhagen, Madrid, Paris
Sao Tome Standard Time	 | 	(UTC+01:00) Sao Tome
Central European Standard Time	 | 	(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb
W. Central Africa Standard Time	 | 	(UTC+01:00) West Central Africa
Jordan Standard Time	 | 	(UTC+02:00) Amman
GTB Standard Time	 | 	(UTC+02:00) Athens, Bucharest
Middle East Standard Time	 | 	(UTC+02:00) Beirut
Egypt Standard Time	 | 	(UTC+02:00) Cairo
E. Europe Standard Time	 | 	(UTC+02:00) Chisinau
Syria Standard Time	 | 	(UTC+02:00) Damascus
West Bank Standard Time	 | 	(UTC+02:00) Gaza, Hebron
South Africa Standard Time	 | 	(UTC+02:00) Harare, Pretoria
FLE Standard Time	 | 	(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius
Israel Standard Time	 | 	(UTC+02:00) Jerusalem
Kaliningrad Standard Time	 | 	(UTC+02:00) Kaliningrad
Sudan Standard Time	 | 	(UTC+02:00) Khartoum
Libya Standard Time	 | 	(UTC+02:00) Tripoli
Namibia Standard Time	 | 	(UTC+02:00) Windhoek
Arabic Standard Time	 | 	(UTC+03:00) Baghdad
Turkey Standard Time	 | 	(UTC+03:00) Istanbul
Arab Standard Time	 | 	(UTC+03:00) Kuwait, Riyadh
Belarus Standard Time	 | 	(UTC+03:00) Minsk
Russian Standard Time	 | 	(UTC+03:00) Moscow, St. Petersburg, Volgograd
E. Africa Standard Time	 | 	(UTC+03:00) Nairobi
Iran Standard Time	 | 	(UTC+03:30) Tehran
Arabian Standard Time	 | 	(UTC+04:00) Abu Dhabi, Muscat
Astrakhan Standard Time	 | 	(UTC+04:00) Astrakhan, Ulyanovsk
Azerbaijan Standard Time	 | 	(UTC+04:00) Baku
Russia Time Zone 3	 | 	(UTC+04:00) Izhevsk, Samara
Mauritius Standard Time	 | 	(UTC+04:00) Port Louis
Saratov Standard Time	 | 	(UTC+04:00) Saratov
Georgian Standard Time	 | 	(UTC+04:00) Tbilisi
Caucasus Standard Time	 | 	(UTC+04:00) Yerevan
Afghanistan Standard Time	 | 	(UTC+04:30) Kabul
West Asia Standard Time	 | 	(UTC+05:00) Ashgabat, Tashkent
Ekaterinburg Standard Time	 | 	(UTC+05:00) Ekaterinburg
Pakistan Standard Time	 | 	(UTC+05:00) Islamabad, Karachi
India Standard Time	 | 	(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi
Sri Lanka Standard Time	 | 	(UTC+05:30) Sri Jayawardenepura
Nepal Standard Time	 | 	(UTC+05:45) Kathmandu
Central Asia Standard Time	 | 	(UTC+06:00) Astana
Bangladesh Standard Time	 | 	(UTC+06:00) Dhaka
Omsk Standard Time	 | 	(UTC+06:00) Omsk
Myanmar Standard Time	 | 	(UTC+06:30) Yangon (Rangoon)
SE Asia Standard Time	 | 	(UTC+07:00) Bangkok, Hanoi, Jakarta
Altai Standard Time	 | 	(UTC+07:00) Barnaul, Gorno-Altaysk
W. Mongolia Standard Time	 | 	(UTC+07:00) Hovd
North Asia Standard Time	 | 	(UTC+07:00) Krasnoyarsk
N. Central Asia Standard Time	 | 	(UTC+07:00) Novosibirsk
Tomsk Standard Time	 | 	(UTC+07:00) Tomsk
China Standard Time	 | 	(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi
North Asia East Standard Time	 | 	(UTC+08:00) Irkutsk
Singapore Standard Time	 | 	(UTC+08:00) Kuala Lumpur, Singapore
W. Australia Standard Time	 | 	(UTC+08:00) Perth
Taipei Standard Time	 | 	(UTC+08:00) Taipei
Ulaanbaatar Standard Time	 | 	(UTC+08:00) Ulaanbaatar
North Korea Standard Time	 | 	(UTC+08:30) Pyongyang
Aus Central W. Standard Time	 | 	(UTC+08:45) Eucla
Transbaikal Standard Time	 | 	(UTC+09:00) Chita
Tokyo Standard Time	 | 	(UTC+09:00) Osaka, Sapporo, Tokyo
Korea Standard Time	 | 	(UTC+09:00) Seoul
Yakutsk Standard Time	 | 	(UTC+09:00) Yakutsk
Cen. Australia Standard Time	 | 	(UTC+09:30) Adelaide
AUS Central Standard Time	 | 	(UTC+09:30) Darwin
E. Australia Standard Time	 | 	(UTC+10:00) Brisbane
AUS Eastern Standard Time	 | 	(UTC+10:00) Canberra, Melbourne, Sydney
West Pacific Standard Time	 | 	(UTC+10:00) Guam, Port Moresby
Tasmania Standard Time	 | 	(UTC+10:00) Hobart
Vladivostok Standard Time	 | 	(UTC+10:00) Vladivostok
Lord Howe Standard Time	 | 	(UTC+10:30) Lord Howe Island
Bougainville Standard Time	 | 	(UTC+11:00) Bougainville Island
Russia Time Zone 10	 | 	(UTC+11:00) Chokurdakh
Magadan Standard Time	 | 	(UTC+11:00) Magadan
Norfolk Standard Time	 | 	(UTC+11:00) Norfolk Island
Sakhalin Standard Time	 | 	(UTC+11:00) Sakhalin
Central Pacific Standard Time	 | 	(UTC+11:00) Solomon Is., New Caledonia
Russia Time Zone 11	 | 	(UTC+12:00) Anadyr, Petropavlovsk-Kamchatsky
New Zealand Standard Time	 | 	(UTC+12:00) Auckland, Wellington
UTC+12	 | 	(UTC+12:00) Coordinated Universal Time+12
Fiji Standard Time	 | 	(UTC+12:00) Fiji
Kamchatka Standard Time	 | 	(UTC+12:00) Petropavlovsk-Kamchatsky - Old
Chatham Islands Standard Time	 | 	(UTC+12:45) Chatham Islands
UTC+13	 | 	(UTC+13:00) Coordinated Universal Time+13
Tonga Standard Time	 | 	(UTC+13:00) Nuku'alofa
Samoa Standard Time	 | 	(UTC+13:00) Samoa
Line Islands Standard Time	 | 	(UTC+14:00) Kiritimati Island
MicrosoftのWindowsのタイムゾーンの現在のリストは、こちらから入手できます

https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones。

利用可能なすべてのタイムゾーンをすばやく検索する場合(たとえば、UTC -6 オフセット)、コマンドを実行します:

tzutil /l | find /I "utc-06"を検索します

CMD、PowerShell、およびGPOを介したWindowsのタイムゾーン設定の変更

現在のタイムゾーンを(UTC-05:00)東部標準時(米国およびカナダ)に変更します:
tzutil /s "Eastern Standard Time"
CMD、PowerShell、およびGPOを介したWindowsのタイムゾーン設定の変更

現在のタイムゾーンはWindowsレジストリに保存されます。次のように変更されたことを確認できます:
reg query HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation
CMD、PowerShell、およびGPOを介したWindowsのタイムゾーン設定の変更

特定のタイムゾーンの夏時間を無効にするには、サフィックス _dstoffを付けてタイムゾーン識別子を指定する必要があります 、例:

tzutil /s “Central European Standard Time_dstoff”

このコマンドは、コンピューターのタイムゾーンを変更し、季節の時計の変更を無効にします。

次のように、タイムゾーンと夏時間の設定に関する完全な情報を表示できます。

w32tm /tz

Time zone: Current:TIME_ZONE_ID_UNKNOWN Bias: 480min (UTC=LocalTime+Bias)
[Standard Name:"Pacific Standard Time" Bias:0min Date:(unspecified)]
[Daylight Name:"Pacific Standard Time" Bias:0min Date:(unspecified)]

CMD、PowerShell、およびGPOを介したWindowsのタイムゾーン設定の変更

WindowsXPおよびWindowsServer2003のコマンドプロンプトからタイムゾーンを変更するには、次のコマンドを使用する必要がありました

RunDLL32.exe shell32.dll,Control_RunDLL timedate.cpl,,/Z Central America Standard Time

または:

Control.exe TIMEDATE.CPL,,/Z Central America Standard Time

PowerShellを介したWindowsタイムゾーンの設定

PowerShellコンソールから現在のタイムゾーン設定を取得できます。コマンドを実行します:


[TimeZoneInfo]::Local

または

Get-TimeZone

Id                         : Pacific Standard Time
DisplayName                : (UTC-08:00) Pacific Time (US & Canada)
StandardName               : Pacific Standard Time
DaylightName               : Pacific Standard Time
BaseUtcOffset              : -08:00:00
SupportsDaylightSavingTime : False

CMD、PowerShell、およびGPOを介したWindowsのタイムゾーン設定の変更

Windowsで使用可能なすべてのタイムゾーンを表示するには、PowerShellコマンドを使用できます。

[System.TimeZoneInfo]::GetSystemTimeZones()
または
Get-TimeZone -ListAvailable

CMD、PowerShell、およびGPOを介したWindowsのタイムゾーン設定の変更

タイムゾーンのリストはかなり長いです。必要なタイムゾーンの名前を見つけるには、PowerShellフィルタリングオプションを使用します。

Get-TimeZone -ListAvailable | Where-Object {$_.displayname -like "*canada*"}

または:

Get-TimeZone -ListAvailable | Where-Object {$_.Id -like "*euro*"}

CMD、PowerShell、およびGPOを介したWindowsのタイムゾーン設定の変更

すべてのタイムゾーンをアルファベット順に一覧表示できます:

Get-TimeZone -ListAvailable | Select Id | Sort Id

PowerShellから現在のタイムゾーンを変更するには、コマンドを実行します

Set-TimeZone -Name "US Eastern Standard Time"

これらの例ではPowerShellバージョン5.1が使用されていますが、新しいバージョンでも機能します。 グループポリシーを使用したタイムゾーンの構成

グループポリシーを使用して、ActiveDirectoryドメイン内のコンピューターのタイムゾーンを構成できます。タイムゾーンを構成するための組み込みのポリシーパラメーターはGPOにありません。 GPOを介してタイムゾーンを設定するために最も一般的に使用される2つのオプションは、GPOログオンスクリプトを使用するか、タイムゾーン設定をレジストリにインポートすることです。

GPOログオンスクリプトを使用してタイムゾーンを設定するには、単純なPowerShellスクリプトを使用できます(WindowsXPおよびWindowsServer 2003以降のすべてのバージョンのWindowsで機能します):

$timeZone = "Central Europe Daylight Time"
$WinOSVerReg = Get-Item "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion"
$WinOSVer = $WinOSVerReg.GetValue("CurrentVersion")
if ($WinOSVer -GE 6){
tzutil.exe /s $timeZone
} Else {
$params = "/c Start `"Change timeZone`" /MIN %WINDIR%\System32\Control.exe TIMEDATE.CPL,,/Z "
$params += $timeZone
$proc = [System.Diagnostics.Process]::Start( "CMD.exe", $params )
}

ドメインに参加しているコンピューターのタイムゾーンを設定するもう1つの方法は、 HKLM \ SYSTEM \ CurrentControlSet \ Control \ TimeZoneInformationのコンテンツをインポートすることです。 適切に構成された時間設定を持つ参照コンピューターからGPOを介して他のコンピューターへのレジストリキー。この記事では、グループポリシーを介してレジストリパラメータをインポートする方法について説明します。

レジストリブラウザを使用して、すべてのパラメータとともにこのレジストリキーを選択します。その結果、すべてのタイムゾーン設定がGPOエディターにインポートされます([コンピューターの構成]->[設定]->[Windowsの設定]->[レジストリ])。

CMD、PowerShell、およびGPOを介したWindowsのタイムゾーン設定の変更

Active Directoryサイトごとに異なるタイムゾーン設定を使用する場合は、GPPアイテムレベルのターゲティングを使用します 特定のタイムゾーン設定をADサイトにターゲティングします。

CMD、PowerShell、およびGPOを介したWindowsのタイムゾーン設定の変更

RDSインフラストラクチャを使用していて、ユーザーとRDSHサーバーが異なるタイムゾーンで構成されている場合、サーバー時間はユーザーのRDPセッションに表示されます。便利ではありません。 タイムゾーンのリダイレクトを許可するを使用して、ユーザーのローカルタイムゾーンをRDPセッションにリダイレクトできます。 GPOパラメーター([コンピューターの構成]>[ポリシー]->[管理用テンプレート]->[Windowsコンポーネント]->[リモートデスクトップサービス]->[リモートデスクトップセッションホスト]->[デバイスとリソースのリダイレクト]。

Windows Server 2019 / Windows 10でタイムゾーンを変更できません:権限がありません

Windows Server 2019RTMおよび一部のWindows10ビルドには、GUIを介したタイムゾーン設定に関する厄介なエラーが含まれています。最新の設定アプリまたは従来のコントロールパネルアプレットからタイムゾーンを変更しようとすると、エラーが表示されます:

Date and time
Unable to continue.
You do not have permission to perform this task. Please contact your computer administrator for help.

CMD、PowerShell、およびGPOを介したWindowsのタイムゾーン設定の変更

まず、管理者権限を持つアカウントでWindowsにログインしていることと、管理者であることを確認してください。 グループはタイムゾーンの変更に存在します ローカルセキュリティポリシーの設定。

CMD、PowerShell、およびGPOを介したWindowsのタイムゾーン設定の変更

回避策として、この場合、コマンドラインからタイムゾーンを変更する必要があります:

tzutil /l
tzutil /s "Central Europe Standard Time"

またはPowerShell:

GetTimeZone -ListAvailable|? DisplayName -like "*Berlin*"|Set-TimeZone

グラフィカルインターフェイスからタイムゾーン設定を変更する場合は、timedate.cplを調整する必要があります。 管理者特権のコマンドプロンプトからアプレットを表示するか、サーバーマネージャーからアプレットを開きます([ローカルサーバー]-> [タイムゾーン])。

CMD、PowerShell、およびGPOを介したWindowsのタイムゾーン設定の変更

Exchange(Microsoft 365)メールボックスのタイムゾーンは、Windowsユーザープロファイル設定に従って最初の接続で設定されます。


  1. Windows 10 で日付と時刻を変更する 4 つの方法

    Windows 10 を最近更新した場合、または Windows 10 にアップグレードしたばかりの場合、時刻がわずかに間違っている場合があり、Windows 10 で日付と時刻を構成する必要があります。しかし、心配する必要はありません。 Windows 10 の日付と時刻を簡単に。コントロール パネルまたは Windows 10 の設定で日付と時刻を構成できますが、これらの設定を構成するには、管理者としてサインインする必要があります。時間を無駄にすることなく、以下のチュートリアルを使用して、Windows 10 で日付と時刻を変更する方法を見てみましょう. Windows 10 で日付と

  2. Windows 10 でユーザーによる日付と時刻の変更を許可または禁止する

    ユーザーによるWindows 10 の日付と時刻: ユーザーは必要に応じて日付と時刻をカスタマイズできますが、ユーザーが日付と時刻を変更できないように、管理者がこのアクセスを無効にする必要がある場合があります。たとえば、何千台ものコンピューターがある会社で働いている場合、セキュリティ上の問題を回避するために、管理者がユーザーが日付と時刻を変更できないようにすることは理にかなっています. デフォルトで、すべての管理者が Windows 10 の日付と時刻を変更できるようになりましたが、標準ユーザーにはこれらの権限がありません。通常、上記の設定は問題なく機能しますが、場合によっては、日付と時刻