WindowsLab is a PowerShell module designed to simplify the administration of computer labs with Windows PCs (10 or 11) connected to the same LAN.
- Start, restart, or stop all PCs remotely
- Synchronize date and time across all PCs
- Create and manage generic user accounts
- Update passwords for generic accounts
- Disconnect users from all PCs
- Deploy files to all PCs
Note: A generic account is a local account that exists on all lab PCs with identical username and password, typically used for standard, non-administrative purposes.
AdminPC:
The single administrator PC used for lab management.
LabPC:
PCs used by lab users (e.g., students) with similar hardware and software configurations.
LabAdmin:
An administrator local account present on both the AdminPC and all LabPCs, configured with identical username and password across all machines.
LabUser:
Generic accounts for lab users present on each LabPC. Multiple accounts can exist with usernames like Student, Teacher, or User.
Note: In addition to LabAdmin and LabUser accounts, other account types can exist, such as personal user accounts or specialized administrator accounts for different tasks.
Before installing WindowsLab, follow these steps:
-
Create the LabAdmin account on both the AdminPC and all LabPCs:
- Use identical username and password across all machines
- Grant administrator privileges
- Example username: LabAdmin
-
For easier management, rename LabPCs using a numbered system (e.g., PC01, PC02, PC03). While optional, this naming convention simplifies lab administration.
-
On each PC, log in to the LabAdmin account and complete these tasks:
- Install PowerShell 7 or higher
- Set the network to "Private" in Windows settings
- Open PowerShell as Administrator and run:
Enable-PSRemoting
-
On the AdminPC only, perform the above steps plus:
Set-Item -Path WSMan:\localhost\client\TrustedHosts -Value *
Note: You can automate the configuration steps using the GettingLabReady.ps1 script:
- Download the script from this repository
- Open Windows PowerShell as administrator
- Navigate to the script's directory
- Execute:
powershell -ExecutionPolicy Bypass -File GettingLabReady.ps1
Security Warning: Ensure the AdminPC is properly secured and use a strong, unique password for the LabAdmin account.
WindowsLab requires the NtpTime module for internet time synchronization. Install both modules on the AdminPC only.
- Log in as LabAdmin on the AdminPC
- Install the required modules:
Install-Module -Name NtpTime Install-Module -Name WindowsLab
- Restart your PowerShell session to ensure the modules are properly loaded and verify the installation:
A list of available cmdlets indicates successful installation.
Get-Command -Module WindowsLab
-
Disconnect-User
Disconnects all active users from LabPCs. -
Deploy-Item
Deploys files or folders to specified LabUser desktops across all LabPCs. -
New-LabUser
Creates new generic accounts (LabUsers) on all LabPCs. -
Remove-LabUser
Removes specified generic accounts from all LabPCs. -
Set-LabUser
Updates LabUser passwords and privileges across all LabPCs. -
Start-LabPc
Powers on all WoL-capable LabPCs simultaneously. -
Stop-LabPc
Shuts down or restarts all LabPCs. Can schedule daily automatic shutdowns. -
Sync-LabPcDate
Synchronizes date and time across all LabPCs using internet time servers. -
Test-LabPcPrompt
Verifies remote command connectivity between AdminPC and LabPCs. -
Set-LabPcName
Launches a GUI for managing multiple labs, where you can define LabPC names and discover their MAC addresses. The stored configuration enables other cmdlets to identify lab PCs and supports WoL functionality.
WindowsLab utilizes PowerShell remoting to execute commands on remote LabPCs. Commands run on the remote machines with results returned to the AdminPC, enabling centralized management.
WoL enables remote power-on functionality via wired Ethernet. It's preferred over Wake-on-Wireless LAN (WoWLAN) for:
- Higher reliability
- Better security
- Broader hardware compatibility
To use the Start-LabPC cmdlet's WoL features:
- Verify WoL support in each LabPC's BIOS/UEFI settings
- Enable WoL if supported
I developed and actively use this module to manage computer labs at the school where I work as an IT assistant.