LoginSignup
6
3

はじめに

備忘録記事です。

説明とかも自分が分かる程度に記載しているので結構適当かも知れないです。

Active Directoryサーバの構築

前提

  • Windows サーバ構築済みでRDP接続可能な状態(サーバ名:ad-server)
  • ADにドメイン参加する用のサーバも構築済みでRDP接続可能な状態(サーバ名:user-server-01)

OSバージョン

image.png

Active Directory 構築

まずは ad-server で作業

サーバ情報確認
Primary Dns Suffixは設定なし。

C:\Users\Administrator>ipconfig /all

Windows IP Configuration

   Host Name . . . . . . . . . . . . : ad-server
   Primary Dns Suffix  . . . . . . . :
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No
   DNS Suffix Search List. . . . . . : ap-northeast-1.ec2-utilities.amazonaws.com
                                       ap-northeast-1.compute.internal

Ethernet adapter Ethernet 3:

   Connection-specific DNS Suffix  . : ap-northeast-1.compute.internal
   Description . . . . . . . . . . . : Amazon Elastic Network Adapter
   Physical Address. . . . . . . . . : 06-DE-33-F0-F9-EB
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::2604:2f91:2006:20fc%8(Preferred)
   IPv4 Address. . . . . . . . . . . : 172.31.47.63(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.240.0
   Lease Obtained. . . . . . . . . . : 2023年7月26日 8:11:34
   Lease Expires . . . . . . . . . . : 2023年7月26日 9:11:33
   Default Gateway . . . . . . . . . : 172.31.32.1
   DHCP Server . . . . . . . . . . . : 172.31.32.1
   DHCPv6 IAID . . . . . . . . . . . : 135191149
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-2C-52-21-68-12-60-CF-D4-10-8D
   DNS Servers . . . . . . . . . . . : 172.31.0.2
   NetBIOS over Tcpip. . . . . . . . : E

AD DSインストール

サービスマネージャー
⇒ 役割と機能の追加
image.png

次へ
image.png

次へ
image.png

次へ
image.png

「Active Directory Domain Service」を選択して次へ
image.png

次へ
image.png

次へ
image.png

「必要に応じて対象サーバを自動的に再起動する」にチェックを入れインストール
※本番稼働の場合はメンテナンス時に再起動する必要があるのでチェック入れない
image.png

インストールに完了したら閉じる
image.png

右上の通知アイコンをクリック
image.png

「このサーバをドメインコントローラーに昇格する」をクリック
image.png

「新しいフォレストを追加する」を選択し、ルートドメイン名を入力し次へ
今回はtest-domain.com
image.png

パスワードを入力し次へ
image.png

次へ
image.png

次へ
image.png

次へ
image.png

次へ
image.png

「すべての前提条件のチェックに合格しました。」と表示されていることを確認してインストール
image.png

インストールが完了後に再起動されるので再度ログイン
この時、作成したtest-domainでログインしたいのでTEST-DOMAIN\Administratorでログイン
パスワードは同じ
image.png

確認すると、Primary Dns Suffix . . . . . . . : test-domain.comに変更されている。

C:\Users\Administrator>ipconfig /all

Windows IP Configuration

   Host Name . . . . . . . . . . . . : ad-server
   Primary Dns Suffix  . . . . . . . : test-domain.com
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No
   DNS Suffix Search List. . . . . . : ap-northeast-1.ec2-utilities.amazonaws.com
                                       ap-northeast-1.compute.internal

Ethernet adapter Ethernet 3:

   Connection-specific DNS Suffix  . : ap-northeast-1.compute.internal
   Description . . . . . . . . . . . : Amazon Elastic Network Adapter
   Physical Address. . . . . . . . . : 06-DE-33-F0-F9-EB
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::2604:2f91:2006:20fc%8(Preferred)
   IPv4 Address. . . . . . . . . . . : 172.31.47.63(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.240.0
   Lease Obtained. . . . . . . . . . : 2023年7月26日 8:23:39
   Lease Expires . . . . . . . . . . : 2023年7月26日 9:23:39
   Default Gateway . . . . . . . . . : 172.31.32.1
   DHCP Server . . . . . . . . . . . : 172.31.32.1
   DHCPv6 IAID . . . . . . . . . . . : 135191149
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-2C-52-21-68-12-60-CF-D4-10-8D
   DNS Servers . . . . . . . . . . . : ::1
                                       127.0.0.1
   NetBIOS over Tcpip. . . . . . . . : Enabled

ユーザの追加

サーバーマネージャー
⇒ ツール
⇒ Active Directory ユーザとコンピューター
image.png

test-domain.com
⇒ Users
⇒ 右クリック
⇒ 新規作成
⇒ ユーザ
⇒ 下記の通り入力し次へ
image.png

パスワードを入力し次へ
※「ユーザは次回ログオン時にパスワード変更が必要」のチェックを外しておく
image.png

完了
image.png

一旦 ad-server 側の作業はここまで

ドメイン参加

次に user-server-01 で作業

サーバ情報

C:\Users\Administrator>ipconfig /all

Windows IP Configuration

   Host Name . . . . . . . . . . . . : user-server-01
   Primary Dns Suffix  . . . . . . . :
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No
   DNS Suffix Search List. . . . . . : ap-northeast-1.ec2-utilities.amazonaws.com
                                       ap-northeast-1.compute.internal

Ethernet adapter Ethernet 3:

   Connection-specific DNS Suffix  . : ap-northeast-1.compute.internal
   Description . . . . . . . . . . . : Amazon Elastic Network Adapter
   Physical Address. . . . . . . . . : 06-2A-C5-E8-11-67
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::ea7f:1a68:510d:f7d5%4(Preferred)
   IPv4 Address. . . . . . . . . . . : 172.31.35.14(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.240.0
   Lease Obtained. . . . . . . . . . : 2023年7月26日 9:21:16
   Lease Expires . . . . . . . . . . : 2023年7月26日 10:21:16
   Default Gateway . . . . . . . . . : 172.31.32.1
   DHCP Server . . . . . . . . . . . : 172.31.32.1
   DHCPv6 IAID . . . . . . . . . . . : 134623958
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-2C-52-7F-46-12-60-CF-D4-10-8D
   DNS Servers . . . . . . . . . . . : 172.31.0.2
   NetBIOS over Tcpip. . . . . . . . : Enabled

ドメイン参加

エクスプローラー
⇒ PC
⇒ 右クリック
⇒ プロパティ
image.png

システムの詳細設定
image.png

「コンピュータ名」タブ
⇒ 「変更」クリック
⇒ 所属するグループを「ドメイン」に変更
test-domain.comを入力し次へ
image.png

エラーが発生した場合はドメインコントローラーに接続できませんでしたを参照

先ほど作成したユーザとパスワードを入力するとドメイン参加に成功し「ドメインへようこそ」と表示される
image.png
image.png

再起動する必要があるので再起動を行う。
image.png

再起動後に先ほど作成したtest-user-01でログイン
頭にドメイン名を付けるのを忘れずに
image.png

以下のエラーが発生した場合は接続は拒否されましたを参照
image.png

無事ログインできたので OK

C:\Users\test-user-01>whoami
test-domain\test-user-01

C:\Users\test-user-01>ipconfig /all

Windows IP Configuration

   Host Name . . . . . . . . . . . . : user-server-01
   Primary Dns Suffix  . . . . . . . : test-domain.com
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No
   DNS Suffix Search List. . . . . . : ap-northeast-1.ec2-utilities.amazonaws.com
                                       ap-northeast-1.compute.internal

Ethernet adapter Ethernet 3:

   Connection-specific DNS Suffix  . : ap-northeast-1.compute.internal
   Description . . . . . . . . . . . : Amazon Elastic Network Adapter
   Physical Address. . . . . . . . . : 06-2A-C5-E8-11-67
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::ea7f:1a68:510d:f7d5%4(Preferred)
   IPv4 Address. . . . . . . . . . . : 172.31.35.14(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.240.0
   Lease Obtained. . . . . . . . . . : Wednesday, July 26, 2023 10:00:20 AM
   Lease Expires . . . . . . . . . . : Wednesday, July 26, 2023 11:00:22 AM
   Default Gateway . . . . . . . . . : 172.31.32.1
   DHCP Server . . . . . . . . . . . : 172.31.32.1
   DHCPv6 IAID . . . . . . . . . . . : 134623958
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-2C-52-7F-46-12-60-CF-D4-10-8D
   DNS Servers . . . . . . . . . . . : 172.31.47.63
   NetBIOS over Tcpip. . . . . . . . : Enabled

エラー対応

ドメインコントローラーに接続できませんでした

ドメイン参加時に以下のエラー発生
image.png

メニュー右クリックで「ネットワーク接続」を選択
image.png

「ネットワークと共有センター」を選択
image.png

インターネット(Ethenet 3 の個所)
⇒ プロパティ(左ウィンドウ)
⇒ 「Internet Protocol Version 4」を選択(中央ウィンドウ)
⇒ 「次のDNSサーバのIPアドレスを使う」を選択
⇒ DNSサーバのIPアドレスを入力(今回は ad-server の IP アドレスを入力)
image.png

再度ドメイン参加を試す

接続は拒否されました

test-user-01 のリモート接続が許可されていないので許可する
test-server-01 にログインするのでそちらのサーバに Administrator でログインして作業します。

コントロールパネル
⇒ システムとセキュリティ
⇒ システム
⇒ リモートの設定
⇒ ユーザーの選択
⇒ 追加
test-user-01を入力して「名前の確認」をクリック
image.png

アカウント資格情報を入力
image.png

補完してくれるのでOKをクリック
image.png

再度ログイン

さいごに

6
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
3