Sau khi tải và cài đặt Windows Server 2019, bạn sẽ đi tới quá trình thiết lập ban đầu. Cùng tìm hiểu chi tiết qua bài viết sau đây nhé!

Thêm người dùng cục bộ

1. Chạy PowerShell với quyền admin và cấu hình như sau:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

# for example, add [Serverworld] user
# [P@ssw0rd01] ⇒ the password you set (replace it you like)
# [PasswordNeverExpires] ⇒ set password never expire(if set default expiration, do not specify this option)
PS C:\Users\Administrator> New-LocalUser -Name "Serverworld" `
-FullName "Server World" `
-Description "Administrator of this Computer" `
-Password (ConvertTo-SecureString -AsPlainText "P@ssw0rd01" -Force) `
-PasswordNeverExpires `
-AccountNeverExpires 

Name        Enabled Description
----        ------- -----------
Serverworld True    Administrator of this Computer

# add [Serverworld] user to [Administrators] group
PS C:\Users\Administrator> Add-LocalGroupMember -Group "Administrators" -Member "Serverworld" 

# verify
PS C:\Users\Administrator> Get-LocalUser -Name Serverworld 

Name        Enabled Description
----        ------- -----------
Serverworld True    Administrator of this Computer

PS C:\Users\Administrator> Get-LocalGroupMember -Group "Administrators" 

ObjectClass Name               PrincipalSource
----------- ----               ---------------
User        RX-7\Administrator Local
User        RX-7\Serverworld   Local

# if remove an user, do like follows
PS C:\Users\Administrator> Remove-LocalUser -Name "Serverworld" 

2. Chạy Server Manager và mở Tools > Computer Management.

Mở Tools > Computer Management

3. Nhấp chuột phải vào Users bên dưới Local Users and Groups ở bên trái và chọn New User.

Chọn New User

4. Nhập Username và Password cho người dùng mới, rồi nhấp vào nút Create. Các mục khác là tùy chọn để thiết lập.

Nhập Username và Password cho người dùng mới

5. Sau khi tạo, người dùng mới được hiển thị trên danh sách như sau.

Người dùng mới được hiển thị trên danh sách

6. Nếu bạn muốn đặt quyền admin cho người dùng mới, hãy nhấp chuột phải vào người dùng và mở Properties.

Mở Properties

7. Di chuyển đến tab Member of và nhấp vào nút Add.

Nhấp vào nút Add

8. Chỉ định nhóm Administrators như sau.

Chỉ định nhóm Administrators

9. Đảm bảo rằng nhóm Administrators được thêm vào danh sách và nhấp vào nút OK để hoàn tất cài đặt.

Nhấp vào nút OK để hoàn tất cài đặt

Thay đổi username admin

Nếu muốn thay đổi tên tài khoản admin vì một số lý do như bảo mật, bạn có thể thay đổi như sau.

1. Chạy PowerShell với quyền admin và cấu hình như sau:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

# for example, change the name [Administrator] to [ServerworldAdmin]
PS C:\Users\Administrator> Rename-LocalUser -Name "Administrator" -NewName "ServerworldAdmin" 

PS C:\Users\Administrator> Get-LocalUser 

# changed
Name               Enabled Description
----               ------- -----------
DefaultAccount     False   A user account managed by the system.
Guest              False   Built-in account for guest access to the computer/domain
Serverworld        True    Administrator of this Computer
ServerworldAdmin   True    Built-in account for administering the computer/domain
sshd               True
WDAGUtilityAccount False   A user account managed and used by the system for Windows Defender Application Guard scen...

2. Chạy Server Manager và mở Tools > Computer Management.

3. Mở Local Users and Groups > Users ở bên trái và nhấp chuột phải vào Administrator, rồi chọn Rename ở bên phải. Sau đó, thay đổi bất kỳ tên nào bạn thích.

Nhấp chuột phải vào Administrator, rồi chọn Rename ở bên phải

4. Tên Admin vừa được thay đổi.

Tên Admin được thay đổi

Thay đổi tên máy tính

Tên máy tính được gán tự động theo mặc định, vì vậy hãy thay đổi nó.

1. Chạy PowerShell với quyền admin và cấu hình như sau:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

# for example, change Computer Name to [RX-7]
PS C:\Users\Administrator> Rename-Computer -NewName RX-7 -Force -PassThru 

HasSucceeded OldComputerName           NewComputerName
------------ ---------------           ---------------
True         RX-7                      RX-9
WARNING: The changes will take effect after you restart the computer RX-7.

# for example, change Primary DNS Suffix to [srv.world]
PS C:\Users\Administrator> Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\" –Name "NV Domain" –Value "srv.world" -PassThru 

NV Domain    : srv.world
PSPath       : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip
PSChildName  : Parameters
PSDrive      : HKLM
PSProvider   : Microsoft.PowerShell.Core\Registry

# restart Computer to apply changes
PS C:\Users\Administrator> Restart-Computer -Force 

# verify
PS C:\Users\Administrator> (ipconfig /all)[0..9] 

Windows IP Configuration

   Host Name . . . . . . . . . . . . : RX-7
   Primary Dns Suffix  . . . . . . . : srv.world
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No
   DNS Suffix Search List. . . . . . : srv.world

2. Chạy Server Manager và chọn Local Server ở bên trái, rồi kích vào phần Computer Name ở bên phải.

Kích vào phần Computer Name ở bên phải

3. Di chuyển đến tab Computer Name và kích vào nút Change.

Di chuyển đến tab Computer Name

4. Nhập bất kỳ tên máy tính nào bạn thích vào trường Computer Name và nhấp vào nút More…

Nhập bất kỳ tên máy tính nào bạn thích vào trường Computer Name

5. Nhập tên domain mà máy tính này đang thuộc về.

Nhập tên domain

6. Việc khởi động lại máy tính là bắt buộc để áp dụng các thay đổi.

Khởi động lại máy tính

7. Tên máy tính được thay đổi bình thường.

Tên máy tính được thay đổi