Automating the Identification of Windows 10 Machines and Transition to Windows 11

As businesses prepare for the transition from Windows 10 to Windows 11, it is crucial to ensure that all users are on the latest operating system. With Windows 10 reaching its End of Life (EOL) in October 2025, IT teams need to track and migrate all users to Windows 11 ahead of this deadline. One effective way to manage this transition is by automating the identification of computers still running Windows 10.

Why Automation is Key

Manually identifying users and systems running outdated operating systems can be time-consuming and error-prone. As the deadline for Windows 10 support looms, it becomes even more essential for IT departments to have a clear understanding of which devices are still using Windows 10. Automation simplifies this process, providing quick insights that are both accurate and scalable.

The PowerShell script provided below helps identify all computers still using Windows 10 by pulling data from Active Directory (AD), allowing IT teams to easily track and manage the transition.

PowerShell Script for Identifying Windows 10 Machines

The following PowerShell script identifies all computers running Windows 10 from Active Directory, checks the last logon timestamp for each machine, and exports the results into a CSV file. This can be very useful for reporting, troubleshooting, and planning the migration to Windows 11.

powershellCopy# Get all computers running Windows 10 from AD
$computers = Get-ADComputer -Filter {OperatingSystem -like "Windows 10*"} -Property Name, OperatingSystem

# Create an array to hold the results
$results = foreach ($computer in $computers) {
    # Get the LastLogonTimestamp (replicated across domain controllers)
    $lastLogon = (Get-ADComputer $computer.Name -Properties LastLogonTimestamp).LastLogonTimestamp

    # Convert LastLogonTimestamp to a readable format if it's not null
    if ($lastLogon) {
        $lastLogonDate = [DateTime]::FromFileTime($lastLogon)
    } else {
        $lastLogonDate = "Never Logged On"
    }

    # Output the computer name, operating system, and last logon date
    [PSCustomObject]@{
        Name            = $computer.Name
        OperatingSystem = $computer.OperatingSystem
        LastLogonDate   = $lastLogonDate
    }
}

# Export the results to CSV for further analysis
$results | Export-Csv -Path "C:\Windows10_Users.csv" -NoTypeInformation

Steps to Run the Script:

  1. Install the Active Directory Module: Before running the script, ensure you have the Active Directory module installed on your PowerShell environment. This can be done by running Install-WindowsFeature RSAT-AD-PowerShell in PowerShell.
  2. Run the Script: Execute the script provided above on your server or computer where you manage Active Directory. This will generate a list of all computers running Windows 10, along with their last logon timestamp.
  3. Export the Results: The script automatically exports the results to a CSV file, which you can save and analyze for your reporting and migration purposes. You can open this CSV file in Excel or another tool for further manipulation or review.

Benefits of Automating the Windows 10 to Windows 11 Transition:

  • Time-Saving: The automation saves valuable time by identifying all affected users in one run.
  • Error-Free: Automation ensures the accuracy of the data, eliminating the possibility of human error.
  • Scalable: As your organization grows, this automated script scales to meet the increasing number of devices that need to be tracked.
  • Real-Time Reporting: Exporting the data to a CSV allows for easy reporting and can be shared with other teams for review.
  • Planning for Windows 11 Migration: With this automation, you can plan your Windows 11 upgrade in a more structured and timely manner, ensuring that all devices are ready before the Windows 10 EOL date.

Conclusion

Automating the identification of Windows 10 machines is a simple yet powerful way to manage your migration to Windows 11. By using PowerShell to generate detailed reports, IT teams can act quickly, ensure accurate reporting, and prevent any issues from falling through the cracks. As we approach the Windows 10 EOL, automation becomes not just helpful, but necessary for a seamless transition to the next-generation operating system.


This blog outlines the PowerShell script to automate the identification of Windows 10 machines and why automation is crucial in preparing for Windows 11 migration.

4o mini

error: Content is protected !!