mirror of
https://github.com/massgravel/Microsoft-Activation-Scripts.git
synced 2025-12-07 01:03:24 +08:00
Compare commits
3 Commits
82f7cfe5f4
...
55cc6d95d1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
55cc6d95d1 | ||
|
|
f4e08dac3d | ||
|
|
979dfb750b |
@ -2127,7 +2127,9 @@ call :dk_color %Gray% "Checking SLC/WMI SKU [Difference Found
|
||||
|
||||
:: This "WLMS" service was included in previous Eval editions (which were activable) to automatically shut down the system every hour after the evaluation period expired and prevent SPPSVC from stopping.
|
||||
|
||||
if exist "%SysPath%\wlms\wlms.exe" (
|
||||
sc query wlms %nul%
|
||||
|
||||
if %errorlevel% NEQ 1060 (
|
||||
echo Checking Eval WLMS Service [Found]
|
||||
)
|
||||
|
||||
@ -14965,6 +14967,7 @@ function DetectSubscription {
|
||||
function DetectAdbaClient
|
||||
{
|
||||
$propADBA | foreach { set $_ (SlGetInfoSku $licID $_) }
|
||||
DetectActType
|
||||
CONOUT "`nAD Activation client information:"
|
||||
CONOUT " Object Name: $ADActivationObjectName"
|
||||
CONOUT " Domain Name: $ADActivationObjectDN"
|
||||
@ -15055,17 +15058,18 @@ function DetectKmsHost
|
||||
if ($null -NE $KeyManagementServiceNotificationRequests) {CONOUT " Notification: $KeyManagementServiceNotificationRequests"}
|
||||
}
|
||||
|
||||
function DetectKmsClient
|
||||
{
|
||||
if ($win8)
|
||||
function DetectActType
|
||||
{
|
||||
$VLType = strGetRegistry ($SPKeyPath + '\' + $strApp + '\' + $licID) "VLActivationType"
|
||||
if ($null -EQ $VLType) {$VLType = strGetRegistry ($SPKeyPath + '\' + $strApp) "VLActivationType"}
|
||||
if ($null -EQ $VLType) {$VLType = strGetRegistry ($SPKeyPath) "VLActivationType"}
|
||||
if ($null -EQ $VLType -Or $VLType -GT 3) {$VLType = 0}
|
||||
}
|
||||
if ($null -NE $VLType) {CONOUT "Configured Activation Type: $($VLActTypes[$VLType])"}
|
||||
}
|
||||
|
||||
function DetectKmsClient
|
||||
{
|
||||
if ($win8) {DetectActType}
|
||||
CONOUT "`r"
|
||||
if ($LicenseStatus -NE 1) {
|
||||
CONOUT "Please activate the product in order to update KMS client information values."
|
||||
@ -15313,6 +15317,7 @@ function GetResult($strSLP, $strApp, $entry)
|
||||
|
||||
if ($win8 -And $VLActivationType -EQ 1) {
|
||||
DetectAdbaClient
|
||||
$cKmsClient = $null
|
||||
}
|
||||
|
||||
if ($winID -And $null -NE $cAvmClient) {
|
||||
@ -16258,7 +16263,7 @@ call :dk_color %Blue% "Rebuilding ClipSVC Licenses..."
|
||||
echo:
|
||||
|
||||
if %winbuild% LSS 10240 (
|
||||
echo ClipSVC license rebuilding is supported only on Windows 10/11 and their Server equivalents.
|
||||
echo ClipSVC license rebuilding is supported only on Windows 10/11.
|
||||
echo Skipping...
|
||||
goto :rebuildspptok
|
||||
)
|
||||
@ -16269,6 +16274,40 @@ echo Skipping...
|
||||
goto :rebuildspptok
|
||||
)
|
||||
|
||||
set _partial=
|
||||
set _keymatch=
|
||||
for /f "tokens=2 delims==" %%# in ('%psc% "(([WMISEARCHER]'SELECT PartialProductKey FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f'' AND PartialProductKey IS NOT NULL AND LicenseDependsOn is NULL').Get()).PartialProductKey | %% {echo ('PartialProductKey='+$_)}" %nul6%') do set "_partial=%%#"
|
||||
for %%# in (8HV2C QPFCT 3V66T PKCKT WXCHW 8TYMD 6F4BT 8HVX7 KD72Y 7CFBY DRR8H P39PB DYJWX MDWWW 9HKR4 M7V2X 2YV77 WT2RQ MHBPB QPF8P 2YV66 VMJ2C DJ4F6 CKFFD YY74H J8JXD BHDCD T6R4W D32MH RRK69 3PJBP) do if /i "%_partial%"=="%%#" set _keymatch=1
|
||||
|
||||
if not defined _keymatch (
|
||||
echo HWID activation key is not installed.
|
||||
echo Skipping...
|
||||
goto :rebuildspptok
|
||||
)
|
||||
|
||||
%psc% "If([Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]'{DCB00C01-570F-4A9B-8D69-199FDBA5723B}')).IsConnectedToInternet){Exit 0}Else{Exit 1}"
|
||||
if errorlevel 1 (
|
||||
echo Internet is not connected.
|
||||
echo Skipping...
|
||||
goto :rebuildspptok
|
||||
)
|
||||
|
||||
set resfail=
|
||||
for %%# in (
|
||||
licensing.mp.microsoft.com/v7.0/licenses/content
|
||||
login.live.com/ppsecure/deviceaddcredential.srf
|
||||
purchase.mp.microsoft.com/v7.0/users/me/orders
|
||||
) do if not defined resfail (
|
||||
%psc% "try { [Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12; irm https://%%# -Method POST } catch { if ($_.Exception.Response -eq $null) { Write-Host """"[%%#] $($_.Exception.Message)"""" -ForegroundColor Red -BackgroundColor Black; exit 3 } }"
|
||||
if !errorlevel!==3 set resfail=1
|
||||
)
|
||||
|
||||
if defined resfail (
|
||||
echo Failed to connect to licensing servers.
|
||||
echo Skipping...
|
||||
goto :rebuildspptok
|
||||
)
|
||||
|
||||
echo Stopping ClipSVC service...
|
||||
%psc% Stop-Service ClipSVC -force %nul%
|
||||
timeout /t 2 %nul%
|
||||
|
||||
@ -1820,7 +1820,9 @@ call :dk_color %Gray% "Checking SLC/WMI SKU [Difference Found
|
||||
|
||||
:: This "WLMS" service was included in previous Eval editions (which were activable) to automatically shut down the system every hour after the evaluation period expired and prevent SPPSVC from stopping.
|
||||
|
||||
if exist "%SysPath%\wlms\wlms.exe" (
|
||||
sc query wlms %nul%
|
||||
|
||||
if %errorlevel% NEQ 1060 (
|
||||
echo Checking Eval WLMS Service [Found]
|
||||
)
|
||||
|
||||
|
||||
@ -2506,7 +2506,9 @@ call :dk_color %Gray% "Checking SLC/WMI SKU [Difference Found
|
||||
|
||||
:: This "WLMS" service was included in previous Eval editions (which were activable) to automatically shut down the system every hour after the evaluation period expired and prevent SPPSVC from stopping.
|
||||
|
||||
if exist "%SysPath%\wlms\wlms.exe" (
|
||||
sc query wlms %nul%
|
||||
|
||||
if %errorlevel% NEQ 1060 (
|
||||
echo Checking Eval WLMS Service [Found]
|
||||
)
|
||||
|
||||
|
||||
@ -3569,7 +3569,9 @@ call :dk_color %Gray% "Checking SLC/WMI SKU [Difference Found
|
||||
|
||||
:: This "WLMS" service was included in previous Eval editions (which were activable) to automatically shut down the system every hour after the evaluation period expired and prevent SPPSVC from stopping.
|
||||
|
||||
if exist "%SysPath%\wlms\wlms.exe" (
|
||||
sc query wlms %nul%
|
||||
|
||||
if %errorlevel% NEQ 1060 (
|
||||
echo Checking Eval WLMS Service [Found]
|
||||
)
|
||||
|
||||
|
||||
@ -3579,7 +3579,9 @@ call :dk_color %Gray% "Checking SLC/WMI SKU [Difference Found
|
||||
|
||||
:: This "WLMS" service was included in previous Eval editions (which were activable) to automatically shut down the system every hour after the evaluation period expired and prevent SPPSVC from stopping.
|
||||
|
||||
if exist "%SysPath%\wlms\wlms.exe" (
|
||||
sc query wlms %nul%
|
||||
|
||||
if %errorlevel% NEQ 1060 (
|
||||
echo Checking Eval WLMS Service [Found]
|
||||
)
|
||||
|
||||
|
||||
@ -518,6 +518,7 @@ function DetectSubscription {
|
||||
function DetectAdbaClient
|
||||
{
|
||||
$propADBA | foreach { set $_ (SlGetInfoSku $licID $_) }
|
||||
DetectActType
|
||||
CONOUT "`nAD Activation client information:"
|
||||
CONOUT " Object Name: $ADActivationObjectName"
|
||||
CONOUT " Domain Name: $ADActivationObjectDN"
|
||||
@ -608,17 +609,18 @@ function DetectKmsHost
|
||||
if ($null -NE $KeyManagementServiceNotificationRequests) {CONOUT " Notification: $KeyManagementServiceNotificationRequests"}
|
||||
}
|
||||
|
||||
function DetectKmsClient
|
||||
{
|
||||
if ($win8)
|
||||
function DetectActType
|
||||
{
|
||||
$VLType = strGetRegistry ($SPKeyPath + '\' + $strApp + '\' + $licID) "VLActivationType"
|
||||
if ($null -EQ $VLType) {$VLType = strGetRegistry ($SPKeyPath + '\' + $strApp) "VLActivationType"}
|
||||
if ($null -EQ $VLType) {$VLType = strGetRegistry ($SPKeyPath) "VLActivationType"}
|
||||
if ($null -EQ $VLType -Or $VLType -GT 3) {$VLType = 0}
|
||||
}
|
||||
if ($null -NE $VLType) {CONOUT "Configured Activation Type: $($VLActTypes[$VLType])"}
|
||||
}
|
||||
|
||||
function DetectKmsClient
|
||||
{
|
||||
if ($win8) {DetectActType}
|
||||
CONOUT "`r"
|
||||
if ($LicenseStatus -NE 1) {
|
||||
CONOUT "Please activate the product in order to update KMS client information values."
|
||||
@ -866,6 +868,7 @@ function GetResult($strSLP, $strApp, $entry)
|
||||
|
||||
if ($win8 -And $VLActivationType -EQ 1) {
|
||||
DetectAdbaClient
|
||||
$cKmsClient = $null
|
||||
}
|
||||
|
||||
if ($winID -And $null -NE $cAvmClient) {
|
||||
|
||||
@ -619,7 +619,7 @@ call :dk_color %Blue% "Rebuilding ClipSVC Licenses..."
|
||||
echo:
|
||||
|
||||
if %winbuild% LSS 10240 (
|
||||
echo ClipSVC license rebuilding is supported only on Windows 10/11 and their Server equivalents.
|
||||
echo ClipSVC license rebuilding is supported only on Windows 10/11.
|
||||
echo Skipping...
|
||||
goto :rebuildspptok
|
||||
)
|
||||
@ -630,6 +630,40 @@ echo Skipping...
|
||||
goto :rebuildspptok
|
||||
)
|
||||
|
||||
set _partial=
|
||||
set _keymatch=
|
||||
for /f "tokens=2 delims==" %%# in ('%psc% "(([WMISEARCHER]'SELECT PartialProductKey FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f'' AND PartialProductKey IS NOT NULL AND LicenseDependsOn is NULL').Get()).PartialProductKey | %% {echo ('PartialProductKey='+$_)}" %nul6%') do set "_partial=%%#"
|
||||
for %%# in (8HV2C QPFCT 3V66T PKCKT WXCHW 8TYMD 6F4BT 8HVX7 KD72Y 7CFBY DRR8H P39PB DYJWX MDWWW 9HKR4 M7V2X 2YV77 WT2RQ MHBPB QPF8P 2YV66 VMJ2C DJ4F6 CKFFD YY74H J8JXD BHDCD T6R4W D32MH RRK69 3PJBP) do if /i "%_partial%"=="%%#" set _keymatch=1
|
||||
|
||||
if not defined _keymatch (
|
||||
echo HWID activation key is not installed.
|
||||
echo Skipping...
|
||||
goto :rebuildspptok
|
||||
)
|
||||
|
||||
%psc% "If([Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]'{DCB00C01-570F-4A9B-8D69-199FDBA5723B}')).IsConnectedToInternet){Exit 0}Else{Exit 1}"
|
||||
if errorlevel 1 (
|
||||
echo Internet is not connected.
|
||||
echo Skipping...
|
||||
goto :rebuildspptok
|
||||
)
|
||||
|
||||
set resfail=
|
||||
for %%# in (
|
||||
licensing.mp.microsoft.com/v7.0/licenses/content
|
||||
login.live.com/ppsecure/deviceaddcredential.srf
|
||||
purchase.mp.microsoft.com/v7.0/users/me/orders
|
||||
) do if not defined resfail (
|
||||
%psc% "try { [Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12; irm https://%%# -Method POST } catch { if ($_.Exception.Response -eq $null) { Write-Host """"[%%#] $($_.Exception.Message)"""" -ForegroundColor Red -BackgroundColor Black; exit 3 } }"
|
||||
if !errorlevel!==3 set resfail=1
|
||||
)
|
||||
|
||||
if defined resfail (
|
||||
echo Failed to connect to licensing servers.
|
||||
echo Skipping...
|
||||
goto :rebuildspptok
|
||||
)
|
||||
|
||||
echo Stopping ClipSVC service...
|
||||
%psc% Stop-Service ClipSVC -force %nul%
|
||||
timeout /t 2 %nul%
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user