Skip to content

Windows Server ​

More in this section:

System info ​

powershell
Get-ComputerInfo -Property OsName, OsVersion, CsName, CsDomain
(Get-Date) - (Get-CimInstance Win32_OperatingSystem).LastBootUpTime   # uptime
Get-WindowsFeature | Where-Object Installed                           # installed roles and features
Get-HotFix | Sort-Object InstalledOn -Descending | Select-Object -First 10

Connectivity ​

powershell
Test-NetConnection server01 -Port 443                      # is the port reachable?
Get-NetTCPConnection -State Listen | Sort-Object LocalPort # what is listening here
Resolve-DnsName server01.corp.example.com
ipconfig /flushdns

Event logs ​

powershell
Get-WinEvent -LogName System -MaxEvents 200 | Where-Object LevelDisplayName -eq 'Error'
Get-WinEvent -FilterHashtable @{LogName='System'; Id=41,6008} -MaxEvents 10   # unexpected shutdowns

Repair Windows files ​

Run DISM first so SFC has good files to repair from:

powershell
DISM /Online /Cleanup-Image /RestoreHealth
sfc /scannow

Licensing ​

powershell
slmgr /dlv                                   # edition, activation status, channel
DISM /Online /Get-CurrentEdition
DISM /Online /Get-TargetEditions             # what it can be converted to
# Evaluation to full version (reboots; not supported on a domain controller)
DISM /Online /Set-Edition:ServerStandard /ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX /AcceptEula

Prefer IPv4 over IPv6 ​

Keeps IPv6 enabled (Microsoft does not support turning it off) but makes Windows try IPv4 first.

powershell
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters" `
  -Name DisabledComponents -PropertyType DWord -Value 0x20 -Force
Restart-Computer
SettingValue
LocationHKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters
NameDisabledComponents
TypeREG_DWORD
Value0x20

To undo, delete the DisabledComponents value and reboot. Avoid 0xFF (fully disabled); it breaks some Windows components.

Account lockouts ​

See Active Directory: find where a lockout comes from.

IT field notes from STL Net Services.