Sửa lỗi kết nối máy in share: 0x0000011b, 0x00000709, 0x0000007c
Script xử lý các lỗi "Windows cannot connect to the printer" phổ biến khi kết nối máy in chia sẻ trong LAN — chạy trên máy chủ chia sẻ hoặc máy con.
- Nhấp đúp file
sua-loi-ket-noi-may-in-share-11b-709.cmd. Chọn Yes khi Windows hỏi quyền Administrator. - Nếu hiện Windows protected your PC: bấm More info → Run anyway (file tải từ Internet).
- Dùng bản
.ps1? Máy đặt ExecutionPolicy AllSigned/Restricted sẽ chặn (mở lên rồi tắt). Chạy bằng lệnh:powershell -ExecutionPolicy Bypass -File .\sua-loi-ket-noi-may-in-share-11b-709.ps1
⚠ Đọc kỹ nội dung script trước khi chạy — nội dung đầy đủ ở khung bên dưới.
# Sửa lỗi kết nối máy in chia sẻ — cần quyền Administrator
# Nhấp đúp bản .cmd để chọn chế độ, hoặc chạy trực tiếp:
# .\sua-loi-ket-noi-may-in-share-11b-709.ps1 -Role Client -Printer \\PC-KETOAN\Canon2900
param(
[ValidateSet('Client', 'Server')] [string] $Role,
[string] $Printer
)
if (-not $Role) {
Write-Host "=== SỬA LỖI KẾT NỐI MÁY IN SHARE ===" -ForegroundColor Cyan
Write-Host "1) Máy CON không kết nối được máy in (lỗi 0x00000709 / 0x0000007c)"
Write-Host "2) Máy đang CHIA SẺ máy in (các máy con báo lỗi 0x0000011b)"
$Role = if ((Read-Host "Chọn 1 hoặc 2") -eq '2') { 'Server' } else { 'Client' }
if ($Role -eq 'Client') {
$Printer = Read-Host "Đường dẫn máy in, vd \\PC-KETOAN\Canon2900 (Enter để bỏ qua)"
}
}
if ($Role -eq 'Server') {
Write-Host "[Server] Sửa lỗi 0x0000011b..." -ForegroundColor Cyan
New-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\Print' -Name RpcAuthnLevelPrivacyEnabled `
-PropertyType DWord -Value 0 -Force | Out-Null
Write-Host "[Server] Bật chia sẻ file & máy in trên tường lửa (Private/Domain)..."
Get-NetFirewallRule -Group '@FirewallAPI.dll,-28502' -ErrorAction SilentlyContinue |
Where-Object { $_.Profile -match 'Private|Domain|Any' } | Enable-NetFirewallRule
}
else {
Write-Host "[Client] Sửa lỗi 0x00000709 / 0x0000007c (RPC qua Named Pipes)..." -ForegroundColor Cyan
$rpc = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Printers\RPC'
New-Item $rpc -Force | Out-Null
New-ItemProperty $rpc -Name RpcUseNamedPipeProtocol -PropertyType DWord -Value 1 -Force | Out-Null
New-ItemProperty $rpc -Name RpcAuthentication -PropertyType DWord -Value 0 -Force | Out-Null
}
Write-Host "Khởi động lại Print Spooler..."
Restart-Service Spooler -Force
if ($Printer) {
try { Add-Printer -ConnectionName $Printer -ErrorAction Stop; Write-Host "Đã kết nối $Printer" -ForegroundColor Green }
catch { Write-Host "Chưa kết nối được: $($_.Exception.Message)" -ForegroundColor Yellow }
}
Write-Host "Xong. Nếu vẫn lỗi, khởi động lại cả 2 máy rồi thử lại." -ForegroundColor Green
Read-Host "`nNhấn Enter để đóng"
Chọn đúng chế độ
| Lỗi | Chạy ở đâu | Lệnh |
|---|---|---|
| 0x0000011b | Máy đang chia sẻ máy in | .\sua-loi... .ps1 -Role Server |
| 0x00000709, 0x0000007c (Windows 11 22H2+) | Máy cần kết nối | .\sua-loi... .ps1 -Role Client |
| Kết nối luôn sau khi sửa | Máy con | thêm -Printer \\TEN-MAY\TenMayIn |
Script thay đổi gì?
- Server: đặt
RpcAuthnLevelPrivacyEnabled = 0, bật luật tường lửa File and Printer Sharing (mạng Private/Domain) - Client: bật chính sách RPC qua Named Pipes (
RpcUseNamedPipeProtocol = 1) - Khởi động lại Print Spooler
⚠️ RpcAuthnLevelPrivacyEnabled = 0 làm giảm mức bảo mật RPC mà Microsoft đã siết lại — chỉ dùng trong mạng nội bộ tin cậy. Cách bền vững là dùng máy chủ in / kết nối máy in qua IP (TCP/IP port) thay vì share từ máy cá nhân.
Xem thêm bài Lỗi kết nối máy in chia sẻ trong mạng LAN để xử lý các trường hợp khác.
Bài liên quan
Quét các IP đang hoạt động trong mạng LAN
Ping song song cả dải /24 trong vài giây, hiển thị IP đang online kèm tên máy (nếu phân giải được).
param([string]$Subnet = "192.168.1", [int]$Timeout = 500)
$tasks = 1..254 | ForEach-Object {
$ip = "$Subnet.$_"
Reset toàn bộ kết nối mạng Windows (.bat)
Một file .bat xử lý 80% lỗi mất mạng: reset Winsock, TCP/IP, xoá cache DNS, xin lại IP từ DHCP.
@echo off title Reset mang Windows net session >nul 2>&1 || (echo Hay chay voi quyen Administrator! & pause & exit /b)
Tool phân tích lỗi màn hình xanh (BSOD)
Liệt kê các lần màn hình xanh gần đây, mã lỗi (bugcheck), các lần tắt máy đột ngột, file minidump và gợi ý cách xử lý theo từng mã lỗi.
# Phân tích màn hình xanh (BSOD) — chạy với quyền Administrator để đọc đủ nhật ký
$tips = [ordered]@{
'0x000000ef' = 'CRITICAL_PROCESS_DIED — file hệ thống hỏng: chạy sfc /scannow và DISM /Online /Cleanup-Image /RestoreHealth'
Tool quét virus bằng Microsoft Defender (có menu)
Cập nhật mẫu virus, chọn quét nhanh / toàn bộ / USB / quét ngoại tuyến, rồi liệt kê mối đe doạ đã phát hiện — dùng Defender có sẵn trên Windows, miễn phí.
# Quét virus bằng Microsoft Defender — chạy với quyền Administrator
if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole('Administrators')) {
Start-Process powershell "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit
Bình luận (0)