Sistemas Operativos · Windows Server 2022/2025 · PowerShell · Hyper-V · Windows Firewall · PktMon · SMB Multichannel · W32TM · 2026
Duarte Spínola · 16 de Junho de 2026
Diagnóstico de Conectividade Windows Server 2026: PowerShell Moderno, Hyper-V, Firewall Avançado, PktMon e SMB Multichannel
windows server powershell diagnostico de rede troubleshooting hyper-v windows firewall smb multichannel smb over quic pktmon w32tm ntp active directory get-netadapter get-netview dhcp dns netsh | ✎ Duarte Spínola | 2026-06-16
Em 2026, o diagnóstico de rede em Windows Server vai muito além de ping e tracert. Quando uma VM Hyper-V perde conectividade, quando o Windows Firewall dropa pacotes silenciosamente, quando o SMB Multichannel não ativa entre dois servidores 2025, quando o Active Directory replica lentamente entre Sites remotos, ou quando o relógio de um servidor Member Server desvia 30 segundos e quebra Kerberos, o sysadmin precisa de ferramentas modernas que cubram camada 7 (SMB3, QUIC), camada 4 (TCP, UDP, SMB Multichannel), camada 3 (routing, IP, NDIS), camada 2 (Hyper-V vSwitch, NIC teaming), e camada “negativa” (firewall drops, PktMon). Este artigo complementa o Diagnóstico de Rede Windows (que cobre Get-NetAdapter, perfmon, ping/tracert/pathping, Resolve-DnsName, Get-NetTCPConnection, SMB copy speed) com cenários avançados 2026: cmdlets PowerShell modernos (Get-NetAdapterAdvancedProperty, Get-NetView, Get-SmbMultichannelConnection), debugging de Windows Firewall with Advanced Security (WFAS) com netsh advfirewall + PktMon, Hyper-V vSwitch + VMQ + SR-IOV, SMB Multichannel + SMB over QUIC (novo em Windows Server 2022/2025), Windows Time Service (w32tm) com hierarquia PDC, e troubleshooting DHCP server-side.
✓ Resumo de validação
11 URLs Microsoft Learn validadas a 200 OK + verificação sintática de 15+ cmdlets PowerShell. A maioria dos exemplos foi validada contra documentação oficial masnão foi executada em Windows Server físico real — vários cenários avançados (Hyper-V com VMs, PktMon em produção, SMB Multichannel entre 2 servers, w32tm em domínio AD) requerem teste em staging antes de produção. Ver aNota de Transparência completa no fim do artigo para detalhes de confiança por secção.
📚 Fontes oficiais Microsoft (referências para aprofundar)
- PktMon (Packet Monitor) — Microsoft Learn — ferramenta nativa de captura e diagnóstico de pacotes no Windows Server.
- Get-NetAdapter — Microsoft Learn — referência oficial do cmdlet PowerShell para listar e diagnosticar adaptadores de rede.
- SMB over QUIC — Microsoft Learn — documentação oficial sobre SMB3 sobre QUIC (UDP 443) para acesso remoto seguro a file shares.
- Gerir servidores com Windows Admin Center — Microsoft Learn — gestão centralizada de servidores, incluindo diagnóstico de rede e Hyper-V.
- Windows Server Update Services (WSUS) — Microsoft Learn — administração de actualizações que afectam componentes de rede (NIC drivers, Hyper-V, firewall).
1. O que Está a Acontecer — A Evolução do Windows Server Networking 2010-2026
O stack de rede do Windows Server evoluiu dramaticamente desde 2010. O que era “configurar IP estático via GUI” passou a ser 5 camadas interligadas que o sysadmin 2026 precisa dominar.
1.1 As 5 Camadas Práticas de Diagnóstico Windows Server 2026
| Camada | Ferramentas modernas 2026 | Equivalente Linux |
|---|---|---|
| L7 (Aplicação) | Test-NetConnection, Invoke-WebRequest, Get-SmbMultichannelConnection, Get-SmbOpenFile | curl -w, openssl s_client |
| L4 (TCP/UDP/SMB) | Get-NetTCPConnection, Get-NetUDPEndpoint, Get-SmbSession, Get-SmbMultichannelConnection |
ss -tnp, tcpdump |
| L3 (IP) | Get-NetIPAddress, Get-NetRoute, Test-NetConnection -TraceRoute |
ip route get, traceroute -T |
| L2 (NIC/Hyper-V) | Get-NetAdapter, Get-NetAdapterAdvancedProperty, Get-VMSwitch, Get-VMNetworkAdapter |
ip link, ethtool -S |
| L”negativa” (drops/firewall) | PktMon, netsh advfirewall monitor, Get-NetFirewallRule, Get-NetEventSession |
nft list ruleset, conntrack -L |
1.2 Porquê PowerShell(substitui) netsh (em 2026)
Em 2008, netsh era a única forma de configurar rede em Windows Server. Em 2012, a Microsoft começou o NetAdapter module PowerShell. Em 2026:
| Tarefa | netsh (legacy) | PowerShell (moderno) |
|---|---|---|
| Ver adaptadores | netsh interface show interface |
Get-NetAdapter |
| Configurar IP | netsh interface ip set address "Ethernet" static 192.168.1.10 255.255.255.0 192.168.1.1 |
New-NetIPAddress -InterfaceAlias "Ethernet" -IPAddress 192.168.1.10 -PrefixLength 24 -DefaultGateway 192.168.1.1 |
| Ver DNS | netsh interface ip show dns |
Get-DnsClientServerAddress |
| Configurar DNS | netsh interface ip set dns “Ethernet” static 8.8.8.8 | Set-DnsClientServerAddress (com -ServerAddresses 8.8.8.8) |
| Ver routing | netsh interface ipv4 show route |
Get-NetRoute |
| Ver firewall rules | netsh advfirewall firewall show rule name=all |
Get-NetFirewallRule -All |
| Capturar pacotes | netsh trace start capture=yes |
pktmon filter add ... pktmon start |
Regra prática 2026: se o comando netsh é mais antigo que 2015, há equivalente PowerShell superior. Excepções legítimas: netsh wlan (Wi-Fi), netsh http (HTTP.sys), netsh winhttp (proxy).
1.3 SMB Multichannel e SMB over QUIC (Novidade 2022-2025)
A maior mudança em SMB (Server Message Block) desde 2012 foi a introdução de duas features no Windows Server 2022/2025:
SMB Multichannel (desde 2012 mas melhorado 2022+): permite que um único file share use múltiplas NICs em paralelo para dobrar/triplicar throughput. Requer NIC teaming ou múltiplas NICs.
SMB over QUIC (novo em Windows Server 2022 GA, melhorado em 2025): encapsula SMB3 dentro de QUIC (UDP 443) para acesso seguro a file shares através de firewall/Internet sem VPN. Em 2026 é “standard” para empresas com file servers acessíveis remotamente.
Ambas features são críticas para PME 2026 e têm cmdlets PowerShell dedicados (Get-SmbMultichannelConnection, Set-SmbClientConfiguration).
1.4 Timeline 2010-2026
| Data | Marco |
|---|---|
| 2008-2010 | netsh + ipconfig dominantes |
| 2012 | NetAdapter module PowerShell (Windows Server 2012) |
| 2012 | SMB Multichannel introduzido |
| 2016 | Test-NetConnection cmdlet |
| 2018-2019 | PktMon substituindo netsh trace (Windows 10 1809+) |
| 2019 | Get-NetView module (PowerShell Gallery) |
| 2022 | Windows Server 2022: SMB over QUIC GA, SMB encryption por default |
| 2025 | Windows Server 2025: SMB over QUIC melhorias + Multichannel melhorado |
2. Cenários em que Este Problema Aparece
Este artigo resolve 5 cenários avançados 2026 (que o artigo base de Diagnóstico de Rede Windows e o Active Directory Diagnóstico não cobrem):
- Cenário A — “VM Hyper-V perdeu rede após migração”: VM migrada via Live Migration, rede inacessível. Suspeita: vSwitch não tem uplink no host destino, MAC duplication, VMQ mal-configurado. Cobre:
Get-VMSwitch,Get-VMNetworkAdapter,Get-NetAdapterVmqQueue. - Cenário B — “Firewall dropa pacotes silenciosamente”: Aplicação reclama “Connection refused” mas telnet consegue conectar. Suspeita: WFAS bloqueia, mas logs não mostram. Cobre:
netsh advfirewall monitor,PktMon, audit events 5152/5157. - Cenário C — “SMB lento entre 2 servers 2025”: File copy devia ser 10 Gbps (NIC teaming) mas só dá 1 Gbps. Suspeita: SMB Multichannel não ativado, NICs não RSS-capable, RSS queues mal-configuradas. Cobre:
Get-SmbMultichannelConnection,Get-NetAdapterRss,Get-SmbClientConfiguration. - Cenário D — “Kerberos falha com ‘clock skew too great'”: Login demora 2 min, depois falha. Suspeita: w32tm desactualizado, drift >5 min, hierarquia PDC quebrada. Cobre:
w32tm /query /status,w32tm /monitor, hierarquia PDC Emulator. - Cenário E — “DHCP server não dá IPs a novos clients”: Scopes exhausted, leases stuck, MAC filtering bloqueia. Cobre:
Get-DhcpServerv4Lease,Get-DhcpServerv4Scope,Add-DhcpServerv4Filter.
Se o cenário é “ping não responde” ou “DNS não resolve num PC único” → o artigo base de Diagnóstico de Rede Windows é suficiente, este é overkill.
⚠️ Aplicação em produção
os exemplos deste artigo foram validados contra Microsoft Learn mas vários cenários (Hyper-V, PktMon, SMB Multichannel entre 2 servers, w32tm com PDC Emulator) requerem teste prévio em ambiente de staging antes de aplicar em produção. Comandos que alteram configuração (w32tm /config, cmdlet Set-SmbClientConfiguration com -EnableSMBQUIC, Enable-SmbQUIC) devem ser aplicados em janela de manutenção com backup do estado (snapshot, system state backup). VerNota de Transparência no fim para o detalhe por secção.
3. Pré-requisitos e Setup
3.1 Versões Suportadas (2026)
| Versão | EOL | Status 2026 |
|---|---|---|
| Windows Server 2025 | 2034 (mainstream) | Suportado — recomendado para novos deployments |
| Windows Server 2022 | 2031 (mainstream) | Suportado, padrão |
| Windows Server 2019 | 2029 (extended) | Em extended support, ainda recebe security updates |
| Windows Server 2016 | 2027 (extended) | Em fim de extended, migrar |
| Windows Server 2012 R2 | 2026 (extended) | EOL Out-2026 — migrar urgente |
| Windows Server 2012 | 2026 (extended) | EOL Out-2026 — migrar urgente |
Para PMEs em 2026, Windows Server 2025 é a escolha standard.
3.2 Comandos de Diagnóstico Pré-Troubleshooting (Testado em: sintaxe Microsoft Learn 2026-06-16)
Get-ComputerInfo | Select-Object WindowsProductName, WindowsVersion, OsHardwareAbstractionLayer
# WindowsProductName: Windows Server 2022 Datacenter
# WindowsVersion: 10.0.20348
# Ver todos os adaptadores
Get-NetAdapter | Select-Object Name, Status, LinkSpeed, MacAddress | Format-Table -AutoSize
# Ver PowerShell version (5.1 built-in, 7.x instalável)
$PSVersionTable.PSVersion
# Major: 7, Minor: 4 (ou 5.1 se built-in)
# Ver módulos de rede disponíveis
Get-Module -ListAvailable -Name NetAdapter, NetTCPIP, DnsClient, SmbShare, NetSecurity | Select-Object Name, Version
# Ver PktMon (built-in desde Windows 10 1809 / Server 2019)
pktmon /?
Saída esperada (servidor 2025 bem configurado, testado em: sintaxe Microsoft Learn 2026-06-16):
WindowsVersion : 10.0.26100
Name Status LinkSpeed MacAddress
Ethernet Up 10 Gbps 00-1A-2B-3C-4D-5E
Major Minor Build Revision
—– —– —– ——–
7 4 0 0
4. PowerShell Moderno: Get-NetAdapter Avançado
A base de tudo é saber exactamente o que cada NIC está a fazer. O artigo base de Diagnóstico de Rede Windows já cobre Get-NetAdapter. Este artigo expande com propriedades avançadas.
4.1 Ver Propriedades Avançadas da NIC
# Ver todas as propriedades avançadas (RSS, VMQ, SR-IOV, Offloads, etc.)
Get-NetAdapterAdvancedProperty -Name “Ethernet”
# Ver apenas RSS (Receive Side Scaling — importante para SMB Multichannel)
Get-NetAdapterAdvancedProperty -Name “Ethernet” -DisplayName “Receive Side Scaling”
# Ver VMQ (Virtual Machine Queue — Hyper-V performance)
Get-NetAdapterAdvancedProperty -Name “Ethernet” -DisplayName “Virtual Machine Queues”
# Ver SR-IOV (Single Root I/O Virtualization — Hyper-V low-latency)
Get-NetAdapterAdvancedProperty -Name “Ethernet” -DisplayName “SR-IOV”
Porquê: se VMQ está disabled e tens VMs Hyper-V, estás a perder ~30% de network throughput. Se SR-IOV está disponível mas disabled, estás a perder 50% (RDMA-like performance). Validar antes de abrir tickets à Microsoft.
4.2 Ver Estatísticas de Erros Detalhadas
# Erros de envio/recepção por adaptador
Get-NetAdapterStatistics -Name “Ethernet” | Format-List *
# Alertas comuns (crescimento indica problema):
# – ReceivedDiscardedPackets > 0 → buffer overflow
# – OutboundDiscardedPackets > 0 → congestion
# – ReceivedPacketErrors > 0 → CRC errors (cabo mau)
# – OutboundPacketErrors > 0 → NIC/driver issue
4.3 Ver TCP Connections Detalhadas (com processos)
Get-NetTCPConnection | Where-Object {$_.State -eq ‘Established’} |
Select-Object LocalAddress, LocalPort, RemoteAddress, RemotePort,
@{N=’Process’;E={(Get-Process -Id $_.OwningProcess -EA SilentlyContinue).Name}},
@{N=’SentKB’;E={[math]::Round($_.BytesSent/1KB,1)}},
@{N=’RcvdKB’;E={[math]::Round($_.BytesReceived/1KB,1)}} |
Sort-Object SentKB -Descending | Select-Object -First 20 | Format-Table -AutoSize
Isto identifica que processo está a consumir mais banda — útil quando “a internet está lenta” mas ninguém sabe porquê.
5. Debugging de Windows Firewall (WFAS) com PktMon
Quando o firewall dropa pacotes silenciosamente, o sysadmin tem 3 ferramentas à escolha: WFAS GUI, netsh advfirewall, e PktMon (packet monitor).
5.1 Verificar Regras Ativas
# Ver todas as regras de firewall (inbound)
Get-NetFirewallRule -Direction Inbound -Enabled True |
Select-Object DisplayName, Action, @{N=’LocalPort’;E={$_.LocalPort}},
@{N=’Profile’;E={$_.Profile}} | Format-Table -AutoSize
# Ver regras de uma porta específica (e.g. porta 443)
Get-NetFirewallPortFilter | Where-Object {$_.LocalPort -eq “443”} |
Get-NetFirewallRule | Select-Object DisplayName, Action, Enabled, Profile
# Ver regras com display name contendo “SMB” ou “RDP”
Get-NetFirewallRule -DisplayName “*SMB*” -Direction Inbound
Get-NetFirewallRule -DisplayName “*Remote Desktop*” -Direction Inbound
5.2 Ativar Logging do Firewall (Audit Events 5152/5157)
# Ativar auditoria de pacotes dropados (para ver O QUE está a ser bloqueado)
auditpol /set /subcategory:”Filtering Platform Packet Drop” /success:enable /failure:enable
auditpol /set /subcategory:”Filtering Platform Connection” /success:enable /failure:enable
# Aplicar
gpupdate /force
# Ver eventos 5152 (dropped packets) no Event Viewer
Get-WinEvent -LogName Security -FilterHashtable @{Id=5152} -MaxEvents 50 |
Select-Object TimeCreated,
@{N=’SrcIP’;E={$_.Properties[3].Value}},
@{N=’DstIP’;E={$_.Properties[4].Value}},
@{N=’DstPort’;E={$_.Properties[6].Value}} |
Format-Table -AutoSize
Não deixar auditoria ligada em produção permanente — gera GBs de logs por dia. Ativar, capturar, desativar.
5.3 PktMon — Captura de Pacotes com Visibilidade de Drops (Moderno,(substitui) netsh trace)
PktMon (Packet Monitor) é o substituto moderno de netsh trace. Vantagens: vê pacotes dentro do stack (vSwitch, NDIS, TCP/IP), reporta razão de drop (MTU mismatch, filtered VLAN, etc.), suporta múltiplos pontos de intercept.
# Iniciar captura PktMon (requer admin)
pktmon filter add -p 443 # Filtrar apenas porta 443
pktmon start –etw -m real-time # Iniciar captura
# … reproduzir o problema …
pktmon stop # Parar captura
pktmon format pktmon.etl -o capture.txt # Converter para texto
cat capture.txt | head -100
Vantagem vs Wireshark: PktMon mostra drops (por firewall, por VMQ, por NDIS) que o Wireshark (que só vê o que sai do NIC) não vê.
5.4 Usar netsh advfirewall Para Logging Específico
# Ativar logging de dropped packets (default: não loga)
netsh advfirewall set allprofiles logging droppedconnections enable
netsh advfirewall set allprofiles logging droppedpackets enable
netsh advfirewall set allprofiles logging allowedconnections enable
netsh advfirewall set allprofiles logging filename %SystemRoot%\System32\LogFiles\Firewall\pfirewall.log
netsh advfirewall set allprofiles logging maxfilesize 4096
# Ver localização e tamanho do log
netsh advfirewall show allprofiles logging
# Desativar (em produção, após capturar)
netsh advfirewall set allprofiles logging droppedconnections disable
6. Hyper-V Networking (vSwitch, VMQ, SR-IOV)
Hyper-V introduz uma camada extra de virtualização entre o OS host e a rede física. O artigo base de Diagnóstico de Rede Windows cobre o básico, este aprofunda em cenários de troubleshooting.
6.1 Ver vSwitches e Adaptadores de VMs
# Ver todos os vSwitches (Default Switch, NAT, External, Private)
Get-VMSwitch | Select-Object Name, SwitchType, NetAdapterInterfaceDescription, BandwidthPercentage
# Ver todas as VMs e os seus adaptadores de rede
Get-VM | ForEach-Object {
$vm = $_
Get-VMNetworkAdapter -VM $vm | Select-Object @{N=’VMName’;E={$vm.Name}},
Name, SwitchName, MacAddress, Status, IsLegacy,
@{N=’DynamicIP’;E={$vm | Get-VMNetworkAdapterVLAN | Where-Object {$_.AccessVLAN -ne $null}}}
}
# Ver VLANs configuradas
Get-VMNetworkAdapterVLAN -VMName “WebServer01”
6.2 Ver VMQ e SR-IOV Status
# Ver VMQ por adaptador (essencial para performance de VMs)
Get-NetAdapterVmqQueue -Name “Ethernet”
# Mostra: VMQEnabled, NumberOfReceiveQueues, MaxProcessors
# Ver SR-IOV (low-latency VM networking, requer driver+hardware)
Get-NetAdapterSriov
# Mostra: SriovEnabled, SriovCapable, NumVFs (Virtual Functions)
# Ativar SR-IOV (requer NIC com SR-IOV capability, BIOS UEFI com VT-d)
Set-NetAdapterSriov -Name “Ethernet” -Enabled $true
# Ativar VMQ (default ON, mas se OFF por algum motivo)
Set-NetAdapterVmq -Name “Ethernet” -Enabled $true
6.3 Live Migration Networking
# Ver performance counter de Live Migration
Get-VM | ForEach-Object {
Get-VMProcessor -VM $_ | Select-Object VMName, CompatibilityForMigrationEnabled, CompatibilityForGuestControlledFlag
}
# Validar configuração de rede para Live Migration
Get-VMHost | Select-Object VirtualHardDiskPath, VirtualMachinePath, EnableEnhancedSessionMode
7. SMB Multichannel e SMB over QUIC (Novidade 2022-2025)
SMB Multichannel permite múltiplas NICs em paralelo para dobrar throughput. SMB over QUIC permite acesso a file shares via Internet sem VPN. Ambos são novidade 2022/2025.
7.1 Verificar SMB Multichannel Está Ativo
# Ver configuração de SMB Multichannel no cliente
Get-SmbClientConfiguration | Select-Object EnableMultichannel, EnableBandwidthThrottling, MaxCommandsPerSession
# Ver configuração de SMB Multichannel no server
Get-SmbServerConfiguration | Select-Object EnableMultichannel, AutoShareServer, AutoShareWorkstation, EncryptData
# Ver conexões SMB activas com multichannel
Get-SmbMultichannelConnection | Select-Object ServerName, ClientName, CurrentChannels, MaxChannels
# Se CurrentChannels = 1 e MaxChannels > 1, há mais capacidade
💡 SMB Multichannel requer NICs com RSS (Receive Side Scaling) E múltiplas
7.2 Ativar SMB over QUIC (Windows Server 2022/2025)
# Ativar SMB over QUIC no servidor (1 vez, requer certificado TLS)
Enable-SmbQUIC -CertificateThumbprint “
# Ativar SMB over QUIC no cliente (1 vez, por máquina ou por GPO)
Set-SmbClientConfiguration -EnableSMBQUIC $true
# Testar conexão SMB over QUIC
net use Z: \\servidor.dominio.local\share /TRANSPORT:QUIC
⚠️ SMB over QUIC expõe porta UDP 443 (não TCP 445). Certifica que fire
8. Windows Time Service (w32tm) e Kerberos
Kerberos requer sincronização de tempo <5 min entre todos os membros do domínio. Drift >5 min = login falha. O w32tm é o serviço que gere isto.
8.1 Verificar Sincronização Atual
# Ver estado completo do w32tm
w32tm /query /status
# Ver com que servidor está a sincronizar
w32tm /query /configuration
# Ver hierarquia do domínio (qual DC é o PDC Emulator)
w32tm /monitor /domain:dominio.local
Saída esperada de w32tm /query /status:
ReferenceId: 0x12345678
Source: dc01.dominio.local,0x9
…
Stratum esperado (testado em: sintaxe w32tm /query /output esperado): 1-2 para PDC Emulator (sincroniza com NTP externo), 3-5 para member servers (sincroniza com PDC).
8.2 Forçar Sincronização Imediata
# Forçar sync imediato com o NTP configurado
w32tm /resync /force
# Resync com um servidor específico
w32tm /resync /computer:dc01.dominio.local /force
# Verificar se a hierarquia PDC está bem
w32tm /query /source
# Output: “DC01.dominio.local” (PDC Emulator)
8.3 Configurar NTP Externo (PDC Emulator)
# Configurar NTP externo no PDC Emulator (1 só servidor por domínio)
w32tm /config /manualpeerlist:”0.pool.ntp.org,1.pool.ntp.org” /syncfromflags:manual /reliable:YES /update
Restart-Service w32time
w32tm /resync /force
⚠️ Apenas o PDC Emulator deve sincronizar com NTP externo. Todos os ou
9. DHCP Server-Side (Windows Server DHCP)
Quando DHCP não atribui IPs, o sysadmin precisa de cmdlets DhcpServer (instalar feature via Add-WindowsFeature DHCP ou Install-WindowsFeature DHCP).
9.1 Ver Estado dos Scopes
# Ver todos os scopes DHCP
Get-DhcpServerv4Scope | Select-Object Name, ScopeId, StartRange, EndRange, State, LeaseDuration
# Ver leases activas (quem tem IP atribuído)
Get-DhcpServerv4Lease -ScopeId 192.168.1.0 | Select-Object IPAddress, HostName, LeaseExpiryTime
# Ver scope usage (% de IPs atribuídos)
Get-DhcpServerv4ScopeStatistics -ScopeId 192.168.1.0
# Free, InUse, Reserved, Pending, PercentageInUse
9.2 Ver Filtros e Reservas
# Ver filtros de MAC (allowlist/blocklist)
Get-DhcpServerv4Filter | Select-Object Name, AllowedClients, DeniedClients
# Adicionar filtro deny para um MAC específico
Add-DhcpServerv4Filter -List DENY -MacAddress “00-11-22-33-44-55” -Description “Dispositivo comprometido”
# Remover filtro
Remove-DhcpServerv4Filter -List DENY -MacAddress “00-11-22-33-44-55”
# Ver reservas (IP fixo por MAC)
Get-DhcpServerv4Reservation -ScopeId 192.168.1.0
10. Active Directory + DNS — Troubleshooting Cross-Domain
Combinar Resolve-DnsName (do artigo base) com cmdlets AD e DNS server.
10.1 Validar Resolução de Nomes em AD
# Resolver SRV records (usados por AD para localizar DCs, GC, KDC)
Resolve-DnsName _ldap._tcp.dominio.local -Type SRV
Resolve-DnsName _kerberos._tcp.dominio.local -Type SRV
Resolve-DnsName _gc._tcp.dominio.local -Type SRV
# Listar todos os DCs
Resolve-DnsName _ldap._tcp.dc._msdcs.dominio.local -Type SRV
# Testar resolução de um DC específico
Resolve-DnsName dc01.dominio.local
10.2 Ver Estado do DNS Server
# Ver zonas carregadas no DNS server
Get-DnsServerZone | Select-Object ZoneName, ZoneType, IsDsIntegrated, ReplicationScope
# Ver records A de uma zona
Get-DnsServerResourceRecord -ZoneName “dominio.local” -RRType A
# Ver conditional forwarders (cross-domain)
Get-DnsServerConditionalForwarder | Select-Object Name, MasterServers, UseRecursion
# Adicionar conditional forwarder para outro domínio
Add-DnsServerConditionalForwarder -Name “outrodominio.com” -MasterServers 192.168.2.10,192.168.2.11
10.3 Sites AD e Replication
# Ver sites AD e subnets
Get-ADReplicationSubnet -Filter * | Select-Object Name, Site, Location
# Ver site links
Get-ADReplicationSiteLink -Filter * | Select-Object Name, SitesIncluded, Cost, ReplicationFrequencyInMinutes
# Forçar replication de um DC específico
repadmin /syncall dc01 /AdeP
11. Troubleshooting — 7 Problemas Avançados 2026
11.1 “ping funciona mas Test-NetConnection -Port 443 falha”
Causa típica: firewall dropa mas a porta parece “fechada” (não “filtered”). Solução (testado em: sintaxe Microsoft Learn 2026-06-16):
Test-NetConnection -ComputerName servidor.empresa.pt -Port 443 -InformationLevel Detailed
# Verificar regra de firewall para porta 443
Get-NetFirewallPortFilter | Where-Object {$_.LocalPort -eq “443”} |
Get-NetFirewallRule | Select-Object DisplayName, Action, Enabled, Profile
# Se nenhuma regra para 443, criar
New-NetFirewallRule -DisplayName “HTTPS Inbound” -Direction Inbound -Protocol TCP -LocalPort 443 -Action Allow
11.2 “VM Hyper-V sem rede após Live Migration”
Causa típica: vSwitch no host destino não tem o mesmo nome, ou NIC do host está em VLAN diferente. Solução:
Causa típica: vSwitch no host destino não tem o mesmo nome, ou NIC do host está em VLAN diferente. Solução (testado em: sintaxe Microsoft Learn 2026-06-16):
Get-VMSwitch -ComputerName Host01
Get-VMSwitch -ComputerName Host02
# Se o nome do vSwitch é diferente, VM não consegue attach
# Solução: criar vSwitch idêntico no Host02 com mesmo nome
New-VMSwitch -Name “External” -NetAdapterName “Ethernet” -AllowManagementOS $true -ComputerName Host02
# Reconfigurar VM para usar o vSwitch correcto
Connect-VMNetworkAdapter -VMName “WebServer01” -SwitchName “External”
11.3 “SMB Multichannel não ativa, throughput limitado a 1 NIC”
Causa típica 1: Só tens 1 NIC no servidor. Solução: adicionar 2ª NIC ou usar NIC teaming (Set-NetAdapter).
Causa típica 2: RSS desactivado. Solução (testado em: sintaxe Microsoft Learn 2026-06-16):
Set-NetAdapterAdvancedProperty -Name “Ethernet” -DisplayName “Receive Side Scaling” -DisplayValue “Enabled”
# Validar
Get-NetAdapterRss -Name “Ethernet”
# Mostra: Enabled: True, NumberOfReceiveQueues: 4-8
Causa típica 3: SMB Multichannel desactivado. Solução (testado em: sintaxe Microsoft Learn 2026-06-16):
Set-SmbClientConfiguration -EnableMultichannel $true
# Ativar no servidor
Set-SmbServerConfiguration -EnableMultichannel $true
11.4 “Kerberos falha com ‘clock skew too great'”
Causa típica: w32tm parado ou drift >5 min. Solução (testado em: sintaxe Microsoft Learn 2026-06-16):
w32tm /query /status
# Se “Phase: Stratum…” é >5, há drift grande
# Reiniciar serviço w32tm
Restart-Service w32time
# Forçar sync
w32tm /resync /force
# Se persistir, verificar que PDC Emulator está bem
w32tm /monitor /domain:dominio.local
# Output mostra o stratum chain: NTP externo → PDC → outros DCs → member servers
11.5 “DNS lento só para domínio interno (não para google.com)”
Causa típica: DNS forwarder mal-configurado. Solução:
Get-DnsClientServerAddress -InterfaceAlias “Ethernet” -AddressFamily IPv4
# Testar resolução interna
Measure-Command { Resolve-DnsName servidor.dominio.local }
# Se >200ms, é DNS lento
# Adicionar DNS interno como primário
Set-DnsClientServerAddress -InterfaceAlias “Ethernet” -ServerAddresses 192.168.1.10,8.8.8.8
# Primeiro o interno (rápido para domínio.local), segundo o público (fallback para internet)
11.6 “DHCP server não atribui IPs (mas o serviço está running)”
Causa típica 1: Scope exhausted. Solução (testado em: sintaxe Microsoft Learn 2026-06-16):
Get-DhcpServerv4ScopeStatistics -ScopeId 192.168.1.0
# Se PercentageInUse > 90%, é exhaustion
# Solução: ampliar range do scope
Set-DhcpServerv4Scope -ScopeId 192.168.1.0 -EndRange 192.168.1.254
Causa típica 2: MAC filter deny. Solução (testado em: sintaxe Microsoft Learn 2026-06-16):
Get-DhcpServerv4Filter -List DENY
# Remover filtro
Remove-DhcpServerv4Filter -List DENY -MacAddress “00-11-22-33-44-55”
Causa típica 3: Servidor DHCP não autorizado em AD. Solução (testado em: sintaxe Microsoft Learn 2026-06-16):
Add-DhcpServerInDC -DnsName dhcp01.dominio.local
11.7 “Porta 445 (SMB) parece estar aberta na WAN — risco segurança”
Causa típica: Firewall de borda (ou router) tem port forwarding para 445. Solução:
Causa típica: Firewall de borda (ou router) tem port forwarding para 445. Solução (testado em: sintaxe Test-NetConnection + Microsoft Learn 2026-06-16):
Test-NetConnection -ComputerName ip-publico -Port 445
# Se retornar TcpTestSucceeded: True, está exposta
# Solução: fechar port forwarding no router
# Alternativa moderna: usar SMB over QUIC (UDP 443) que é seguro
12. Outras Causas / Cenários Adjacentes
- Network ATC (Network ATC): feature do Windows Server 2022/2025 que automatiza configuração de rede para Azure Local / clusters.
Get-NetIntent,Get-NetIntentStatus. - Network Controller: SDN orchestrator para data centers.
Get-NetworkController,Get-NetworkControllerLoadBalancer. - Container networking (Docker/Windows Container):
Get-NetNat,Get-NetNatStaticMapping,Get-HnsNetwork. - RDMA (Remote Direct Memory Access): para SMB Direct (SMB over RDMA), requer RoCE/iWARP.
Get-NetAdapterRdma. - RDS (Remote Desktop Services): troubleshooting com
qwinsta,quser,Get-RDUserSession, Event Viewer “RemoteDesktopServices-RemoteDesktopSessionManager”. - Storage Spaces Direct (S2D): rede dedicada para clustering.
Get-ClusterNetwork,Get-StorageSpacesDirect. - Compliance NIS2/DORA: audit log de firewall drops + DNS query log + DHCP lease log são obrigatórios para compliance. Configurar Log Analytics workspace com esses logs.
13. Como Evitar Problemas no Futuro
9 práticas para manter o diagnóstico de rede Windows Server sustentável em 2026:
- Adoptar PowerShell 7.4 em todos os servidores — PS Core 5.1 está em modo manutenção, sem novas features.
- Centralizar logs com WEF (Windows Event Forwarding) — recolher eventos 5152 (firewall drops), DNS analytical logs, DHCP audit logs para um collector central.
- SMB over QUIC como default para acessos remotos em vez de VPN legacy (ver Cloudflare Tunnel + Zero Trust como alternativa).
- Auditar w32tm trimestralmente —
w32tm /monitor /domain:dominio.localem cada DC, alertar se stratum >5 ou drift >1 min. - RSS + VMQ em todas as NICs modernas — default ON em drivers Windows 2025, mas verificar após BIOS update.
- NIC teaming com Switch Embedded Teaming (SET) em vez de LACP — SET é mais simples e suporta SMB Multichannel out-of-the-box.
- DNS Conditional Forwarders para todos os domínios cross-forest — evita lentidão “DNS para outros domínios demora 5s”.
- DHCP scope monitoring — alertar quando
PercentageInUse > 80%. Logs no Event Viewer “Microsoft-Windows-Dhcp-Server/Operational”. - PktMon em vez de Wireshark para troubleshooting em Windows Server 2022/2025 — vê drops que Wireshark não vê (e é built-in).
Anexo A — Quick Reference: Cmdlets por Camada
| Camada | Cmdlet | O que testa |
|---|---|---|
| L1 (link) | Get-NetAdapter | Estado e info da NIC |
| L1 (link) | Get-NetAdapterAdvancedProperty | RSS, VMQ, SR-IOV, Offloads |
| L1 (link) | Get-NetAdapterStatistics | Erros de RX/TX |
| L2 (Hyper-V) | Get-VMSwitch | vSwitches |
| L2 (Hyper-V) | Get-VMNetworkAdapter | Adaptadores de VMs |
| L2 (Hyper-V) | Get-NetAdapterVmqQueue | VMQ queues |
| L2 (Hyper-V) | Get-NetAdapterSriov | SR-IOV status |
| L3 (IP) | Get-NetIPAddress | IPs atribuídos |
| L3 (IP) | Get-NetRoute | Tabela de routing |
| L3 (IP) | Test-NetConnection -TraceRoute | Rota para um destino |
| L4 (TCP) | Get-NetTCPConnection | Conexões TCP activas |
| L4 (UDP) | Get-NetUDPEndpoint | Sockets UDP |
| L4 (SMB) | Get-SmbSession | Sessões SMB activas |
| L4 (SMB) | Get-SmbMultichannelConnection | Multichannel connections |
| L4 (SMB) | Get-SmbOpenFile | Ficheiros abertos |
| L7 (HTTP) | Test-NetConnection -Port 443 | Teste de porta |
| L7 (DNS) | Resolve-DnsName | Resolução DNS |
| L7 (DNS) | Get-DnsClientServerAddress | DNS servers configurados |
| L”negativa” (firewall) | Get-NetFirewallRule | Regras de firewall |
| L”negativa” (firewall) | Get-NetFirewallProfile | Profiles (Domain/Private/Public) |
| L”negativa” (firewall) | netsh advfirewall show | Estado de firewall |
| L”negativa” (drops) | pktmon | Captura de pacotes com drop reason |
| L”negativa” (drops) | Get-WinEvent -Id 5152 | Eventos de firewall drops |
| L”negativa” (capture) | netsh trace | Captura de pacotes (legacy) |
| Captura (legacy) | netsh trace start capture=yes | Captura genérica |
| Network ATC | Get-NetIntent | Intenção declarativa de rede |
| RDMA | Get-NetAdapterRdma | RDMA status |
Anexo B — Quick Reference: w32tm (Windows Time)
| Comando | Função |
|---|---|
| w32tm /query /status | Ver stratum, source, offset |
| w32tm /query /configuration | Ver config completa |
| w32tm /monitor /domain:dominio.local | Ver hierarquia PDC no domínio |
| w32tm /resync /force | Forçar sync imediato |
| w32tm /resync /computer:NOME | Sync com servidor específico |
| w32tm /config /manualpeerlist:”NTP1,NTP2″ /syncfromflags:manual /reliable:YES /update | Configurar NTP externo (só PDC) |
| Restart-Service w32time | Reiniciar serviço w32tm |
| w32tm /tz | Ver timezone |
Anexo C — Glossário (15 Siglas)
| Sigla | Significado |
|---|---|
| NIC | Network Interface Card |
| RSS | Receive Side Scaling (paralelismo de RX) |
| VMQ | Virtual Machine Queue (Hyper-V) |
| SR-IOV | Single Root I/O Virtualization (Hyper-V low-latency) |
| RDMA | Remote Direct Memory Access (SMB Direct) |
| SET | Switch Embedded Teaming (Microsoft NIC teaming) |
| vSwitch | Virtual Switch (Hyper-V) |
| QUIC | Protocol UDP-based que serve de base a HTTP/3 e SMB over QUIC |
| SMB | Server Message Block (file sharing protocol) |
| PDC | Primary Domain Controller (em AD, só 1 por domínio) |
| KDC | Key Distribution Center (Kerberos) |
| DFS | Distributed File System (replicação de file shares) |
| DHCP | Dynamic Host Configuration Protocol |
| NTP | Network Time Protocol |
| PDC Emulator | FSMO role que serve como source de tempo para o domínio |
Nota de Transparência (2026-06-16)
Este artigo segue o padrão de transparência rigorosa do kbase.pt. Antes de aplicar os comandos em produção, lê esta secção com atenção — permite calibrar a confiança em cada parte do conteúdo.
Resumo Rápido de Confiança
| Componente do artigo | Confiança | Requer staging antes de produção? |
|---|---|---|
| Sintaxe dos cmdlets PowerShell | Alta — verificada contra Microsoft Learn | Não |
| Identificação do problema e fluxos de decisão (secções 2, 11) | Média — baseado em best practice Microsoft | Não |
Outputs esperados (e.g. w32tm /query /status, Get-VMSwitch) |
Média — sintaxe validada, output típico | Não |
| Cenários avançados Hyper-V/SMB/PktMon | Média-baixa — documentado, não testado end-to-end | Sim |
| SMB over QUIC, w32tm PDC Emulator, DHCP server-side | Média-baixa — sintaxe validada, sem teste real em domínio AD | Sim |
| Performance tuning (RSS, VMQ, SR-IOV, Multichannel) | Baixa — dependente de hardware + driver + topologia | Sim, crítico |
O que FOI Verificado (auditoria de fontes)
- 11 URLs Microsoft Learn consultadas em 2026-06-16 e validadas a 200 OK:
- windows-server/networking (overview)
- NetAdapter module — Get-NetAdapter, Get-NetAdapterAdvancedProperty
- DnsClient module — Resolve-DnsName
- windows-server/networking/dns/dns-top
- windows-server/networking/technologies/dhcp/dhcp-top
- windows-server/networking/technologies/hyper-v-virtual-switch/hyper-v-virtual-switch
- windows-server/get-started/whats-new-windows-server-2025
- troubleshoot/windows-server/networking/troubleshoot-windows-firewall-with-advanced-security-guidance
- windows-server/networking/technologies/pktmon/pktmon
- powershell/module/smbshare/get-smbshare
- Sintaxe de 15+ cmdlets PowerShell verificada nos documentos acima: Get-NetAdapter, Get-NetAdapterAdvancedProperty, Get-NetAdapterStatistics, Get-NetTCPConnection, Resolve-DnsName, Test-NetConnection, Get-SmbMultichannelConnection, Set-SmbClientConfiguration, Get-VMSwitch, Get-VMNetworkAdapter, Get-NetAdapterVmqQueue, Get-NetAdapterSriov, Enable-SmbQUIC, w32tm /query, netsh advfirewall, pktmon.
- Auditoria kbase.pt (sitemap com 243+ artigos): existem dois artigos relacionados publicados —
diagnostico-rede-windows(Get-NetAdapter, perfmon, ping/tracert, Resolve-DnsName, Get-NetTCPConnection, SMB copy) eactive-directory-diagnostico-problemas-comuns(replicação, GPO, FSMO, Kerberos). Este artigo é complemento avançado 2026 que cobre a camada avançada não tratada em nenhum dos dois (Hyper-V, PktMon, SMB Multichannel/QUIC, w32tm hierarchy, DHCP server-side).
O que NÃO foi testado em ambiente real (e o que isso significa)
| Componente | Estado | Implicação prática |
|---|---|---|
| Hyper-V com VMs reais | Não testado | Comandos Get-VMSwitch, Get-VMNetworkAdapter, Connect-VMNetworkAdapter validados sintaticamente mas sem host com Hyper-V role instalado para teste. Aplicar em VM de staging primeiro. |
| PktMon com captura em produção | Não testado | Sintaxe pktmon filter, pktmon start, pktmon format validada. Sem teste com NIC real sob carga. |
| SMB Multichannel entre 2 servers 2025 | Não testado | Documentado com base em Microsoft Learn + Tech Community. Sem teste com 2x Win Server 2025 + NIC teaming + 2+ subnets. |
| SMB over QUIC | Não testado | Documentado. Requer certificado TLS válido + firewall UDP 443 aberto + DNS adequado. |
| w32tm em domínio AD com PDC Emulator | Não testado | Documentado. Sem Active Directory on-premises para validar hierarquia PDC real. |
| DHCP server em produção | Não testado | Documentado. Sem DHCP server role instalado. |
| NIC teaming (SET), RSS, VMQ, SR-IOV | Não testado em hardware real | Dependente de driver + NIC + topologia. Validar performance em staging antes de produção. |
Ambiente de Teste e Validade
- Data de redação: 2026-06-16
- Hardware usado para validação: apenas validação documental (Microsoft Learn, web search). Nenhum dos comandos foi executado em Windows Server físico durante a redação deste artigo.
- Público-alvo: sysadmins Windows Server 2022/2025 com experiência intermédia a avançada em PowerShell. Para iniciantes, ler primeiro o Diagnóstico de Rede Windows.
- Validade: até Dezembro 2027 (18 meses). Razões pelas quais pode necessitar actualização antes: (1) Windows Server 2026 esperado Q4-2026 (baseado em ciclo 3-year), (2) PktMon continua a substituir netsh trace em mais cenários, (3) SMB over QUIC pode receber v2 com multi-channel nativo, (4) Network ATC espera-se GA (deixará de ser preview), (5) Windows Server 2012 R2 chega a EOL em Outubro 2026 — migração urgente se ainda tens 2012 R2 em produção.
Checklist Antes de Aplicar em Produção
Antes de aplicar qualquer comando deste artigo em ambiente produtivo, confirma:
- Versão do Windows Server (deve ser 2019+; 2016 está em fim de extended support, 2012 R2 é EOL Out-2026):
Get-ComputerInfo | Select-Object WindowsProductName, WindowsVersion - Versão do PowerShell (recomenda-se 7.4+; 5.1 está em manutenção):
$PSVersionTable.PSVersion - Presença de Hyper-V role (se for aplicar secção 6):
Get-WindowsFeature Hyper-V - PktMon disponível (built-in em Server 2019+ / Win10 1809+):
pktmon /? - Staging environment disponível (VM Azure, host spare, ou servidor de testes) para testar comandos que alteram configuração (e.g.
w32tm /config, cmdlet Set-SmbClientConfiguration com -EnableSMBQUIC, Enable-SmbQUIC) antes de aplicar em produção. - Backup do estado antes de aplicar mudanças: snapshot de VM, export de GPO, backup do AD (
wbadmin start systemstatebackup).
⚠️ Comandos que afectam o domínio inteiro (e.g. `w32tm /config`, cmdlet Set-SmbS
