Windows Activation and Edition Change

I work for an Oil Services company, and while most of our computers are Domain Joined and connected to our Corporate Network, we have several computers that are Remote and in Workgroups. These computers can't readily talk to our KMS to stay Activated as they are Offline for extended periods of time

The need to create a Scheduled Task to sit on a computer for Activating Windows using a MAK (Multiple Activation Key) is necessary.

Activation Script

Below is a quick PowerShell script to activate Windows 10 Enterprise using a MAK. Simply replace the $MakKey with your own

$TaskName = 'Activate MAK Windows 10 Enterprise'
$MakKey = 'XXXXX-XXXXX-XXXXX-XXXXX-XXXXX'
#======================================================================================
#   Logs
#======================================================================================
$TaskLogs = "$env:SystemRoot\Logs\Activation"
if (!(Test-Path $TaskLogs)) {New-Item $TaskLogs -ItemType Directory -Force | Out-Null}
$TaskLogName = "$((Get-Date).ToString('yyyy-MM-dd-HHmmss'))-$TaskName.log"
Start-Transcript -Path (Join-Path $TaskLogs $TaskLogName)
#======================================================================================
#   Operating System
#======================================================================================
$OSCaption = $((Get-WmiObject -Class Win32_OperatingSystem).Caption).Trim()
$OSArchitecture = $((Get-WmiObject -Class Win32_OperatingSystem).OSArchitecture).Trim()
$OSVersion = $((Get-WmiObject -Class Win32_OperatingSystem).Version).Trim()
$OSBuildNumber = $((Get-WmiObject -Class Win32_OperatingSystem).BuildNumber).Trim()
#======================================================================================
#   Variables
#======================================================================================
Write-Host "OSCaption: $OSCaption" -ForegroundColor Cyan
Write-Host "OSArchitecture: $OSArchitecture" -ForegroundColor Cyan
Write-Host "OSVersion: $OSVersion" -ForegroundColor Cyan
Write-Host "OSBuildNumber: $OSBuildNumber" -ForegroundColor Cyan
#======================================================================================
#   Set SLMGR
#======================================================================================
if (Test-Path "$env:windir\SYSWOW64\slmgr.vbs") {
    $slmgr = "$env:windir\SYSWOW64\slmgr.vbs"
} else {
    $slmgr = "$env:windir\System32\slmgr.vbs"
}
#======================================================================================
#   OS Activation
#======================================================================================
if (Test-Path $slmgr) {
    Write-Host "**********************"
    Write-Host "Display Licensing Information"
    Write-Host "Command Line: cscript //nologo $slmgr /dlv"
    cscript //nologo $slmgr /dlv
    Write-Host "**********************"
    Write-Host "Install Product Key"
    Write-Host "Command Line: cscript //nologo $slmgr /ipk $MakKey"
    cscript //nologo $slmgr /ipk $MakKey
    Write-Host "**********************"
    Write-Host "Activate Windows"
    Write-Host "Command Line: cscript //nologo $slmgr /ato"
    cscript //nologo $slmgr /ato
    Write-Host "**********************"
    Write-Host "Display Licensing Information"
    Write-Host "Command Line: cscript //nologo $slmgr /dlv"
    cscript //nologo $slmgr /dlv
    Write-Host "**********************"
    Write-Host "Display Installation ID for Offline Activation"
    Write-Host "Command Line: cscript //nologo $slmgr /dti"
    cscript //nologo $slmgr /dti
}
Write-Host "**********************"
Write-Warning "Internet access may be required to complete activation"
#======================================================================================
#   Complete
#======================================================================================
Stop-Transcript

Inception

You are going to have to take this script, and put in in your Task Builder script to create the Task so it can be Encoded

Create the Task

Simply execute the script to create the Scheduled Task. In my example, I have created one for Enterprise and Pro as I work with both editions in my environment. Each Edition should have a separate, unique MAK Key

Standard User Testing

So now I'm on the Internet completely disconnected from my Corporate Network and I need to Activate Windows using the MAK, so time to Change Product Key in Windows Settings

Unfortunately I am not an Admin of the computer, so no can do

Time to run the Scheduled Task and wait for it to complete running. Another check into Windows Activation and I am golden.

I'm able to alternate both of my Tasks and switch between Enterprise and Pro

The logging is a plus and very helpful if there are any issues that come up

GitHub

Here's a link to both scripts. Just add your MAK Keys and enjoy

Last updated