From Installation Freezes to PowerShell Automation: My Windows Server 2019 Journey.
Source: Dev.to
Introduction: The Challenge
I recently tackled a comprehensive lab project: deploying a functional Windows Server 2019 environment from scratch. The goal wasn’t just to install the OS, but to configure it like a real‑world sysadmin using automation to handle users, groups, and secure file sharing.
While I started this project feeling like a beginner, by the end I was writing multi‑line PowerShell scripts to manage the infrastructure.
Phase 1: The Setup and “The Freeze”
My lab environment ran on Oracle VirtualBox. The installation process taught me my first major lesson in virtualization troubleshooting.
Initially, the Windows Server installation kept freezing at the “spinning dots” boot screen. After digging into the VM settings, I realized that a modern server OS requires specific virtualization hardware features.
The Fix
The VM configuration was missing a critical processor feature. I enabled PAE/NX in the VirtualBox processor settings and increased the video memory. Once those tweaks were applied, the installation sailed through to the desktop experience.
Phase 2: Base Configuration (The Manual Stuff)
After logging in as the Administrator, the first step was giving the server an identity.
In a real network, servers need static addresses so they can always be found. I configured the network adapter with a static IPv4 address suitable for my lab environment (10.0.2.15).
I also renamed the computer from its generic Windows name to something meaningful: WIN‑SERVER‑01. While I could have used the GUI, I used PowerShell for a quick rename and restart:
Rename-Computer -NewName "WIN-SERVER-01" -Restart
Phase 3: The Power of Automation (The Cool Stuff)
The requirement was to create multiple users (Alice, Bob, Charlie), assign them to departments (HR, IT), and ensure they changed their passwords on first login. Doing this manually involves dozens of clicks, so I wrote a PowerShell script to handle it in seconds.
The Scripting Approach
I used ISE to write a script that utilized loops and conditionals. It checked if a user or group existed before trying to create it, making the script idempotent (safe to run multiple times).
# Automating User Creation
$users = @("Alice", "Bob", "Charlie")
foreach ($user in $users) {
# Create the user
New-LocalUser -Name $user -Password $securePassword -Description "Staff"
# Force password change at next login
$userObj = [ADSI]"WinNT://$env:COMPUTERNAME/$user,user"
$userObj.PasswordExpired = 1
$userObj.SetInfo()
}

Phase 4: Permissions and Hardening
The final step was securing the environment.
File Sharing
I created restricted folders HRDocs and ITDocs. PowerShell was used to ensure only the appropriate group could access its documents, enforcing the principle of least privilege.
Security Hardening
As a basic security measure, I disabled the built‑in Guest account to prevent anonymous access. PowerShell made this easy to verify.

Conclusion and Lessons Learned
This project was a great crash course in Windows Server administration. The biggest takeaway wasn’t just knowing what to configure, but knowing how to do it efficiently.
While GUIs are helpful for learning, PowerShell is essential for scalable, repeatable system administration. Overcoming the initial installation hurdles and seeing my scripts successfully deploy the environment felt like a massive win.