Techzone/Windows Server — Complete Admin Guide

Windows Server — Complete Admin Guide

8 min readArticle

Current Versions

Version Release Mainstream Support End Extended Support End
Windows Server 2025 2024 2029 2034
Windows Server 2022 2021 2026 2031
Windows Server 2019 2018 2024 2029
Windows Server 2016 2016 2022 2027
Windows Server 2012 R2 2013 2018 2023 (EOL)

Installation options: Desktop Experience (GUI) or Server Core (no GUI — recommended for security and smaller footprint). Server Core is managed remotely via PowerShell, RSAT, or Windows Admin Center.


Server Roles Overview

Role Description
AD DS Active Directory Domain Services — directory, authentication, Group Policy, Kerberos/NTLM
DNS Server Name resolution for the domain; AD-integrated zones for secure dynamic updates
DHCP Server IP address assignment; failover pairs for HA; lease reservations for servers
IIS Internet Information Services — web server for internal and external apps
File Server SMB shares; DFS (Distributed File System) for namespace and replication
Print Server Centralized printer management and driver deployment
Hyper-V Type-1 hypervisor for VM hosting; live migration, failover clustering
WSUS Windows Server Update Services — centralized patch management for domain clients
NPS (RADIUS) Network Policy Server — 802.1X, VPN authentication, RADIUS proxy
ADCS (CA) Active Directory Certificate Services — internal PKI, cert issuance and revocation
Remote Desktop Services RDS — session-based remote desktops and RemoteApp publishing

Active Directory Essentials

Core Tools

  • ADUC (dsa.msc) — Active Directory Users and Computers. GUI for managing users, computers, groups, OUs.
  • ADSI Edit (adsiedit.msc) — Low-level AD attribute editor. Use to view/edit attributes not exposed in ADUC. Handle with care.
  • GPMC (gpmc.msc) — Group Policy Management Console. Create, link, edit, back up, and model GPOs.
  • Active Directory Sites and Services (dssite.msc) — Manage replication topology and site links.
  • AD Administrative Center (dsac.exe) — Modern GUI with fine-grained password policies and Recycle Bin.

PowerShell (Active Directory Module — requires RSAT or AD DS role)

powershell
# Users
Get-ADUser -Identity jsmith -Properties *
Get-ADUser -Filter {Enabled -eq $true} | Select Name, SamAccountName, LastLogonDate
New-ADUser -Name "Jane Smith" -SamAccountName jsmith -UserPrincipalName [email protected] `
  -AccountPassword (ConvertTo-SecureString "P@ssw0rd1!" -AsPlainText -Force) -Enabled $true
Set-ADUser -Identity jsmith -Title "IT Admin" -Department "IT"
Disable-ADAccount -Identity jsmith
Enable-ADAccount -Identity jsmith

# Computers
Get-ADComputer -Filter * | Select Name, IPv4Address, OperatingSystem, LastLogonDate
Get-ADComputer -Identity PC001 -Properties *

# Groups
Get-ADGroup -Identity "Domain Admins"
Get-ADGroupMember -Identity "Domain Admins" -Recursive
Add-ADGroupMember -Identity "IT Admins" -Members jsmith, bday
Remove-ADGroupMember -Identity "IT Admins" -Members jsmith -Confirm:$false

# Locked-out and password searches
Search-ADAccount -LockedOut | Select Name, SamAccountName, LockedOut
Unlock-ADAccount -Identity jsmith
Search-ADAccount -PasswordExpired | Select Name, SamAccountName
Search-ADAccount -AccountDisabled | Select Name, SamAccountName

# OU management
Get-ADOrganizationalUnit -Filter * | Select Name, DistinguishedName
New-ADOrganizationalUnit -Name "Workstations" -Path "DC=corp,DC=local"
Move-ADObject -Identity "CN=PC001,CN=Computers,DC=corp,DC=local" `
  -TargetPath "OU=Workstations,DC=corp,DC=local"

Group Policy

Group Policy applies settings hierarchically using the LSDOU order of precedence (later overrides earlier):

  1. Local — local computer policy (gpedit.msc)
  2. Site — GPOs linked to the AD site
  3. Domain — GPOs linked to the domain root
  4. OU — GPOs linked to the OU containing the object (most specific wins)

Within each level, multiple GPOs are processed in link order (lower link order number = higher priority).

Special overrides:

  • Enforced (No Override) — forces a GPO to apply regardless of child OU settings; overrides Block Inheritance.
  • Block Inheritance — prevents GPOs from parent containers from applying (except Enforced GPOs).
powershell
# GPO management
Get-GPO -All                                          # List all GPOs in domain
Get-GPO -Name "Default Domain Policy"
New-GPO -Name "Workstation Security Baseline"
New-GPLink -Name "Workstation Security Baseline" -Target "OU=Workstations,DC=corp,DC=local"
Get-GPInheritance -Target "OU=Workstations,DC=corp,DC=local"

# Resultant Set of Policy — what actually applies to a user/computer
gpresult /H C:\Temp\gp-report.html /F             # HTML report for current user/computer
gpresult /Scope Computer /V                        # Verbose computer policy results
gpupdate /force                                    # Force immediate policy refresh

Key Server PowerShell

powershell
# Roles and features
Get-WindowsFeature | Where Installed                      # List installed features
Get-WindowsFeature AD-Domain-Services                     # Check specific feature
Install-WindowsFeature AD-Domain-Services -IncludeManagementTools
Install-WindowsFeature DHCP, DNS -IncludeManagementTools
Uninstall-WindowsFeature Telnet-Client

# Disk and volume management
Get-Disk                                                  # Physical disks
Initialize-Disk -Number 1 -PartitionStyle GPT
New-Partition -DiskNumber 1 -UseMaximumSize -AssignDriveLetter
Format-Volume -DriveLetter D -FileSystem NTFS -NewFileSystemLabel "Data"
Get-Volume                                                # All volumes and free space

# SMB shares
Get-SmbShare                                              # List all shares
New-SmbShare -Name "Data" -Path "D:\Data" -FullAccess "corp\IT Admins" -ReadAccess "corp\Domain Users"
Set-SmbShare -Name "Data" -Description "Department Data Share"
Remove-SmbShare -Name "Data" -Force

# Domain controller
Get-ADDomainController -Discover                          # Find a DC
Get-ADDomainController -Filter *                          # List all DCs
Test-ComputerSecureChannel                                # Check secure channel to domain
Test-ComputerSecureChannel -Repair -Credential corp\admin # Repair broken secure channel

Health and Monitoring

powershell
# Domain controller diagnostics (run on or targeting a DC)
dcdiag                                    # Full DC health check
dcdiag /test:replications                 # AD replication test only
dcdiag /test:netlogons                    # Netlogon service test

# AD replication
repadmin /showrepl                        # Show replication status for all partners
repadmin /replsummary                     # Summarized replication health
repadmin /syncall /AdeP                   # Force sync all partitions

# NETLOGON log — authentication events, secure channel issues
# Path: %SystemRoot%\debug\netlogon.log (and netlogon.bak)

# DC discovery and DNS
nltest /dsgetdc:corp.local                # Find a DC for the domain
nltest /dclist:corp.local                 # List all DCs
nslookup _ldap._tcp.corp.local            # Verify SRV records exist

# Event log queries
Get-EventLog -LogName System -Newest 50
Get-WinEvent -FilterHashtable @{LogName='System'; Level=2} -MaxEvents 50  # Errors only

Security Hardening

powershell
# Disable SMBv1 (WannaCry/EternalBlue vector — must disable)
Set-SmbServerConfiguration -EnableSMB1Protocol $false -Force
Get-SmbServerConfiguration | Select EnableSMB1Protocol  # Verify

# Enable SMB signing (prevents relay attacks)
Set-SmbServerConfiguration -RequireSecuritySignature $true -Force

# LSA protection — prevents non-PPL processes from reading LSASS memory
New-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa" `
  -Name RunAsPPL -Value 1 -PropertyType DWORD -Force

# Restrict anonymous enumeration
Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa" `
  -Name RestrictAnonymous -Value 1

# Disable legacy protocols
Disable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol  # On desktop OS

# Enable Windows Firewall on all profiles
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled True

Tiered Administration Model: Tier 0 = Domain Controllers and AD (highest privilege). Tier 1 = Member servers. Tier 2 = Workstations. Admin accounts for each tier should be separate credentials — a Tier 2 admin account should never log into a Tier 0 system.


Key Attack Awareness

Understanding these attacks is critical for defensive monitoring and hardening:

Attack Description Detection/Mitigation
Kerberoasting Request service tickets for SPN-registered accounts, crack hash offline with hashcat Monitor 4769 events with RC4 encryption; use strong, unique service account passwords; managed service accounts (MSA/gMSA)
AS-REP Roasting Request TGT for accounts with "Do not require Kerberos pre-auth" — no password needed Monitor 4768 with pre-auth type 0; audit and disable that flag on all accounts
DCSync Mimic DC replication (DRS protocol) using accounts with Replicating Directory Changes All right Monitor for 4662 events with replication GUIDs from non-DC IPs; restrict replication rights
Pass-the-Hash Reuse captured NTLM hash without knowing the plaintext password Credential Guard, Protected Users group, disable NTLM where possible
Golden Ticket Forge Kerberos TGT using the KRBTGT hash (stolen from DC) — valid for 10+ years Reset KRBTGT password twice after compromise; monitor for anomalous ticket lifetimes
Silver Ticket Forge service ticket using service account hash — bypasses DC entirely Service account password rotation; monitor for events without corresponding TGT request
NTDS.dit extraction Copy the AD database (ntdsutil, Volume Shadow Copy, DCSYNC) to dump all hashes Restrict access to C:\Windows\NTDS\; monitor VSS operations on DCs

Backup and Recovery

powershell
# Windows Server Backup — install feature first
Install-WindowsFeature Windows-Server-Backup

# Backup system state (includes AD, registry, boot files)
wbadmin start systemstatebackup -backuptarget:\\fileserver\backup -quiet

# List backups
wbadmin get versions

# Restore system state
wbadmin start systemstaterecovery -version:MM/DD/YYYY-HH:MM -quiet

# Authoritative restore of deleted AD objects (from DSRM mode)
# 1. Boot to DSRM, 2. Restore system state, 3. Run:
ntdsutil "activate instance ntds" "authoritative restore" "restore subtree OU=Deleted,DC=corp,DC=local" quit quit

# AD Recycle Bin — restore without DSRM (must be enabled first)
Enable-ADOptionalFeature -Identity "Recycle Bin Feature" -Scope ForestOrConfigurationSet -Target "corp.local"
Get-ADObject -Filter {isDeleted -eq $true} -IncludeDeletedObjects | Select Name, Deleted, WhenChanged
Restore-ADObject -Identity "<objectGUID>"

Important Event IDs

Event ID Description Significance
4624 Successful logon Baseline; filter by logon type (3=network, 10=RemoteInteractive)
4625 Failed logon Brute force detection; watch for rapid sequential failures
4648 Logon with explicit credentials (runas) Lateral movement indicator
4672 Special privileges assigned at logon Admin logon — monitor for unexpected accounts
4728 / 4732 / 4756 Member added to security-enabled group (Global/Local/Universal) Privilege escalation — especially Domain Admins
4768 Kerberos TGT request Pre-auth type 0 = AS-REP roasting target
4769 Kerberos service ticket request RC4 encryption = Kerberoasting attempt
4771 Kerberos pre-auth failure Failed Kerberos auth — brute force or bad password
4776 NTLM authentication attempt NTLM still in use — monitor for relay attack position
7045 New service installed Common persistence/lateral movement technique
4698 / 4702 Scheduled task created/modified Persistence mechanism
techzonesite.comUnlock Your IT Potential