Cài đặt và Quản trị Windows Server

60 phút

Cài đặt và Quản trị Windows Server

Cài đặt và Quản trị Windows Server

Giới thiệu Windows Server

Các phiên bản

Windows Server 2016 (Standard, Datacenter)
Windows Server 2019 (Standard, Datacenter)
Windows Server 2022 (Standard, Datacenter) ← Hiện tại
Windows Server 2025 (sắp ra)

Editions

Standard:
- Cho môi trường ảo hóa nhẹ
- 2 OSE (Operating System Environments)
- Tối đa 64 sockets
- RAM tối đa 24TB

Datacenter:
- Cho môi trường ảo hóa cao
- Unlimited OSE
- Storage Spaces Direct
- Software Defined Networking
- Shielded VMs

Yêu cầu Hệ thống

Minimum

CPU: 1.4 GHz 64-bit
RAM: 512 MB (GUI) / 2 GB
Disk: 32 GB
Network: Gigabit Ethernet

Recommended

CPU: 2 GHz 64-bit (2+ cores)
RAM: 8 GB+ (16 GB for AD)
Disk: 100 GB+ SSD
Network: 10 Gbps

Cài đặt Windows Server

Các bước

1. Mount ISO vào VM/Physical
2. Boot từ ISO
3. Chọn Language, Time, Keyboard
4. Install now
5. Chọn Edition (Standard/Datacenter)
6. Chấp nhận License
7. Custom installation
8. Chọn Disk
9. Chờ cài đặt
10. Đặt password Administrator

Installation Options

Server Core:
- Không có GUI
- Ít bảo mật hơn
- Nhẹ hơn, nhanh hơn
- Quản lý qua PowerShell/RSAT

Desktop Experience:
- Có GUI đầy đủ
- Dễ dùng cho người mới
- Nặng hơn

Chuyển đổi Core ↔ GUI

# Xem tính năng hiện tại
Get-WindowsFeature Server-Gui-Shell

# Cài GUI từ Core
Install-WindowsFeature Server-Gui-Mgmt-Infra, Server-Gui-Shell -Restart

# Xóa GUI về Core
Uninstall-WindowsFeature Server-Gui-Mgmt-Infra, Server-Gui-Shell -Restart

Cấu hình sau cài đặt

Đổi tên máy tính

Rename-Computer -NewName "DC01" -Restart

Cấu hình Network

# Xem adapter
Get-NetAdapter

# Đặt IP tĩnh
New-NetIPAddress -InterfaceAlias "Ethernet" `
    -IPAddress 192.168.1.10 `
    -PrefixLength 24 `
    -DefaultGateway 192.168.1.1

# Đặt DNS
Set-DnsClientServerAddress -InterfaceAlias "Ethernet" `
    -ServerAddresses 192.168.1.10, 8.8.8.8

Windows Update

# Kiểm tra updates
Get-WindowsUpdate

# Cài updates
Install-WindowsUpdate -AcceptAll -AutoReboot

Time Zone

Set-TimeZone -Id "SE Asia Standard Time"

Quản trị với Server Manager

Các phần chính

1. Dashboard - Tổng quan
2. Local Server - Cấu hình local
3. All Servers - Quản lý nhiều server
4. File and Storage Services
5. Tools - Công cụ quản trị

Add Roles and Features

# Cài role AD DS
Install-WindowsFeature -Name AD-Domain-Services `
    -IncludeManagementTools

# Cài DNS
Install-WindowsFeature -Name DNS -IncludeManagementTools

# Cài DHCP
Install-WindowsFeature -Name DHCP -IncludeManagementTools

# Cài Web Server (IIS)
Install-WindowsFeature -Name Web-Server `
    -IncludeManagementTools

PowerShell cơ bản

Cmdlets quan trọng

# System info
Get-ComputerInfo
Get-CimInstance Win32_OperatingSystem
Get-CimInstance Win32_Processor

# Services
Get-Service
Get-Service -Name "DNS"
Start-Service DNS
Stop-Service DNS
Restart-Service DNS

# Processes
Get-Process
Get-Process -Name "svchost"
Stop-Process -Name "notepad"

# Files
Get-ChildItem C:\
New-Item -ItemType Directory -Path "C:\Test"
Remove-Item "C:\Test" -Recurse

# Users
Get-LocalUser
New-LocalUser -Name "TestUser" -Password (ConvertTo-SecureString "P@ssw0rd" -AsPlainText -Force)
Add-LocalGroupMember -Group "Administrators" -Member "TestUser"

Remote Management

# Enable PS Remoting
Enable-PSRemoting -Force

# Remote session
Enter-PSSession -ComputerName "Server01" -Credential (Get-Credential)

# Invoke command remotely
Invoke-Command -ComputerName "Server01" -ScriptBlock {
    Get-Service
}

# Multiple computers
$servers = "Server01", "Server02", "Server03"
Invoke-Command -ComputerName $servers -ScriptBlock {
    Get-Service -Name "DNS"
}

Windows Admin Center

Cài đặt

Download từ: https://aka.ms/WACDownload
Cài đặt trên Windows 10/11 hoặc Server
Truy cập: https://localhost:6516

Tính năng

  • Quản lý server qua web browser
  • Quản lý Hyper-V, Storage
  • Quản lý AD, DNS, DHCP
  • Cập nhật, backup
  • Không cần GUI đầy đủ

Backup và Recovery

Windows Server Backup

# Cài feature
Install-WindowsFeature Windows-Server-Backup

# Backup System State
wbadmin start systemstatebackup -backuptarget:D:

# Backup Full Server
wbadmin start backup -backupTarget:D: -allCritical -quiet

# Restore
wbadmin get versions
wbadmin start recovery -version:01/01/2024-10:00 -itemType:Volume -items:C:

System Restore Points

# Enable
Enable-ComputerRestore -Drive "C:\"

# Create point
Checkpoint-Computer -Description "Before update" `
    -RestorePointType "MODIFY_SETTINGS"

# List points
Get-ComputerRestorePoint

# Restore
Restore-Computer -RestorePoint 1

Monitoring và Performance

Performance Monitor

Các counter quan trọng:
- Processor(_Total)\% Processor Time
- Memory\Available MBytes
- PhysicalDisk(_Total)\% Disk Time
- Network Interface\Bytes Total/sec

Event Viewer

# Xem event logs
Get-EventLog -LogName System -Newest 10
Get-EventLog -LogName Application -EntryType Error

# Tìm event
Get-WinEvent -FilterHashtable @{LogName='System'; Level=2} -MaxEvents 20

Task Manager

  • Processes, Performance, Users, Details, Services

Resource Monitor

  • CPU, Memory, Disk, Network

Bài tập thực hành

Hãy cài đặt và cấu hình Windows Server!

Bài tập 1