From Installation Freezes to PowerShell Automation: My Windows Server 2019 Journey.

Published: (January 15, 2026 at 12:35 PM EST)
3 min read
Source: Dev.to

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()
}

Users scripts

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.

Security Hardening

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.

Back to Blog

Related posts

Read more »

𝗗𝗲𝘀𝗶𝗴𝗻𝗲𝗱 𝗮 𝗣𝗿𝗼𝗱𝘂𝗰𝘁𝗶𝗼𝗻‑𝗥𝗲𝗮𝗱𝘆 𝗠𝘂𝗹𝘁𝗶‑𝗥𝗲𝗴𝗶𝗼𝗻 𝗔𝗪𝗦 𝗔𝗿𝗰𝗵𝗶𝘁𝗲𝗰𝘁𝘂𝗿𝗲 𝗘𝗞𝗦 | 𝗖𝗜/𝗖𝗗 | 𝗖𝗮𝗻𝗮𝗿𝘆 𝗗𝗲𝗽𝗹𝗼𝘆𝗺𝗲𝗻𝘁𝘀 | 𝗗𝗥 𝗙𝗮𝗶𝗹𝗼𝘃𝗲𝗿

!Architecture Diagramhttps://dev-to-uploads.s3.amazonaws.com/uploads/articles/p20jqk5gukphtqbsnftb.gif I designed a production‑grade multi‑region AWS architectu...