Skip to content

Commit bc8ae03

Browse files
committed
1.7
1 parent d17d749 commit bc8ae03

13 files changed

Lines changed: 3705 additions & 5872 deletions

File tree

MAS/All-In-One-Version/MAS_AIO.cmd

Lines changed: 1784 additions & 3863 deletions
Large diffs are not rendered by default.

MAS/Separate-Files-Version/Activation_Troubleshoot.cmd

Lines changed: 508 additions & 76 deletions
Large diffs are not rendered by default.

MAS/Separate-Files-Version/Change_Edition.cmd

Lines changed: 423 additions & 127 deletions
Large diffs are not rendered by default.

MAS/Separate-Files-Version/Check-Activation-Status-vbs.cmd

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ if not %errorlevel%==0 (
4444
echo:
4545
echo Error: This is not a correct file. It has LF line ending issue.
4646
echo:
47-
echo Press any key to exit...
48-
pause >nul
47+
ping 127.0.0.1 -n 6 > nul
4948
popd
5049
exit /b
5150
)

MAS/Separate-Files-Version/Check-Activation-Status-wmi.cmd

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ if not %errorlevel%==0 (
7272
echo:
7373
echo Error: This is not a correct file. It has LF line ending issue.
7474
echo:
75-
echo Press any key to exit...
76-
pause >nul
75+
ping 127.0.0.1 -n 6 > nul
7776
popd
7877
exit /b
7978
)
@@ -362,7 +361,7 @@ exit /b
362361
function PrintModePerPridFromRegistry
363362
{
364363
$vNextRegkey = "HKCU:\SOFTWARE\Microsoft\Office\16.0\Common\Licensing\LicensingNext"
365-
$vNextPrids = Get-Item -Path $vNextRegkey -ErrorAction Ignore | Select-Object -ExpandProperty 'property' | Where-Object -FilterScript {$_ -Ne 'InstalledGraceKey' -And $_ -Ne 'MigrationToV5Done' -And $_ -Ne 'test' -And $_ -Ne 'unknown'}
364+
$vNextPrids = Get-Item -Path $vNextRegkey -ErrorAction Ignore | Select-Object -ExpandProperty 'property' | Where-Object -FilterScript {$_.ToLower() -like "*retail" -or $_.ToLower() -like "*volume"}
366365
If ($vNextPrids -Eq $null)
367366
{
368367
Write-Host "No registry keys found."
@@ -457,15 +456,20 @@ function PrintLicensesInformation
457456
$license = (Get-Content -Encoding Unicode $_.FullName | ConvertFrom-Json).License
458457
$decodedLicense = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($license)) | ConvertFrom-Json
459458
$licenseType = $decodedLicense.LicenseType
460-
$userId = $decodedLicense.Metadata.UserId
461-
$identitiesRegkey = Get-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Office\16.0\Common\Identity\Identities\${userId}*" -ErrorAction Ignore
459+
If ($null -Ne $decodedLicense.ExpiresOn)
460+
{
461+
$expiry = [DateTime]::Parse($decodedLicense.ExpiresOn, $null, 48)
462+
}
463+
Else
464+
{
465+
$expiry = New-Object DateTime
466+
}
462467
$licenseState = $null
463468
If ((Get-Date) -Gt (Get-Date $decodedLicense.MetaData.NotAfter))
464469
{
465470
$licenseState = "RFM"
466471
}
467-
ElseIf (($decodedLicense.ExpiresOn -Eq $null) -Or
468-
((Get-Date) -Lt (Get-Date $decodedLicense.ExpiresOn)))
472+
ElseIf ((Get-Date) -Lt (Get-Date $expiry))
469473
{
470474
$licenseState = "Licensed"
471475
}
@@ -483,11 +487,11 @@ function PrintLicensesInformation
483487
Acid = $decodedLicense.Acid;
484488
LicenseState = $licenseState;
485489
EntitlementStatus = $decodedLicense.Status;
490+
EntitlementExpiration = $decodedLicense.ExpiresOn;
486491
ReasonCode = $decodedLicense.ReasonCode;
487492
NotBefore = $decodedLicense.Metadata.NotBefore;
488493
NotAfter = $decodedLicense.Metadata.NotAfter;
489494
NextRenewal = $decodedLicense.Metadata.RenewAfter;
490-
Expiration = $decodedLicense.ExpiresOn;
491495
TenantId = $decodedLicense.Metadata.TenantId;
492496
} | ConvertTo-Json
493497
}
@@ -502,11 +506,11 @@ function PrintLicensesInformation
502506
DeviceId = $decodedLicense.Metadata.DeviceId;
503507
LicenseState = $licenseState;
504508
EntitlementStatus = $decodedLicense.Status;
509+
EntitlementExpiration = $decodedLicense.ExpiresOn;
505510
ReasonCode = $decodedLicense.ReasonCode;
506511
NotBefore = $decodedLicense.Metadata.NotBefore;
507512
NotAfter = $decodedLicense.Metadata.NotAfter;
508513
NextRenewal = $decodedLicense.Metadata.RenewAfter;
509-
Expiration = $decodedLicense.ExpiresOn;
510514
TenantId = $decodedLicense.Metadata.TenantId;
511515
} | ConvertTo-Json
512516
}

0 commit comments

Comments
 (0)