mirror of
https://github.com/massgravel/Microsoft-Activation-Scripts.git
synced 2025-04-12 02:18:22 +00:00
Compare commits
No commits in common. "8f3f3925177b26cf21b8dbd5cad6debf0e3b2e19" and "63045afc708028e867f02a3cd135c6e7ebe5fa53" have entirely different histories.
8f3f392517
...
63045afc70
@ -876,13 +876,11 @@ if !errorlevel!==3 set resfail=1
|
|||||||
if defined resfail (
|
if defined resfail (
|
||||||
set error=1
|
set error=1
|
||||||
for %%# in (
|
for %%# in (
|
||||||
live.com
|
|
||||||
microsoft.com
|
|
||||||
login.live.com
|
login.live.com
|
||||||
purchase.mp.microsoft.com
|
purchase.mp.microsoft.com
|
||||||
licensing.mp.microsoft.com
|
licensing.mp.microsoft.com
|
||||||
) do (
|
) do (
|
||||||
findstr /i "%%#" "%SysPath%\drivers\etc\hosts" %nul1% && set "hosfail= [%%# Blocked in Hosts]"
|
findstr /i "%%#" "%SysPath%\drivers\etc\hosts" %nul1% && set "hosfail= [Blocked in Hosts]"
|
||||||
)
|
)
|
||||||
call :dk_color %Red% "Checking Licensing Servers [Failed to Connect]!hosfail!"
|
call :dk_color %Red% "Checking Licensing Servers [Failed to Connect]!hosfail!"
|
||||||
set fixes=%fixes% %mas%licensing-servers-issue
|
set fixes=%fixes% %mas%licensing-servers-issue
|
||||||
@ -6568,6 +6566,21 @@ if ($winbuild -LT 2600) {
|
|||||||
ExitScript 1
|
ExitScript 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$SysPath = "$env:SystemRoot\System32"
|
||||||
|
if (Test-Path "$env:SystemRoot\Sysnative\reg.exe") {
|
||||||
|
$SysPath = "$env:SystemRoot\Sysnative"
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Test-Path "$SysPath\sppc.dll") {
|
||||||
|
$SLdll = 'sppc.dll'
|
||||||
|
} elseif (Test-Path "$SysPath\slc.dll") {
|
||||||
|
$SLdll = 'slc.dll'
|
||||||
|
} else {
|
||||||
|
"==== ERROR ====`r`n"
|
||||||
|
"Software Licensing Client Dll is not detected."
|
||||||
|
ExitScript 1
|
||||||
|
}
|
||||||
|
|
||||||
if ($All.IsPresent)
|
if ($All.IsPresent)
|
||||||
{
|
{
|
||||||
$isAll = {CONOUT "`r"}
|
$isAll = {CONOUT "`r"}
|
||||||
@ -6962,7 +6975,7 @@ function GetResult($strSLP, $strSLS, $strID)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($winPR -And $Dlv -And $NT7 -And $null -EQ $RemainingAppReArmCount) {
|
if ($winPR -And $Dlv -And $null -EQ $RemainingAppReArmCount) {
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$tmp = [wmisearcher]"SELECT RemainingWindowsReArmCount FROM $strSLS"
|
$tmp = [wmisearcher]"SELECT RemainingWindowsReArmCount FROM $strSLS"
|
||||||
@ -7031,9 +7044,14 @@ function GetResult($strSLP, $strSLS, $strID)
|
|||||||
$objSvc = New-Object PSObject
|
$objSvc = New-Object PSObject
|
||||||
$wmiSvc = [wmisearcher]"SELECT * FROM $strSLS"
|
$wmiSvc = [wmisearcher]"SELECT * FROM $strSLS"
|
||||||
$wmiSvc.Options.Rewindable = $false
|
$wmiSvc.Options.Rewindable = $false
|
||||||
$wmiSvc.Get() | select -Expand Properties -EA 0 | foreach { if (-Not [String]::IsNullOrEmpty($_.Value)) {$objSvc | Add-Member 8 $_.Name $_.Value} }
|
$wmiSvc.Get() | select -Expand Properties -EA 0 | foreach {
|
||||||
|
if (-Not [String]::IsNullOrEmpty($_.Value))
|
||||||
|
{
|
||||||
|
$objSvc | Add-Member 8 $_.Name $_.Value
|
||||||
|
if ($null -EQ $IsKeyManagementServiceMachine) {set $_.Name $_.Value}
|
||||||
|
}
|
||||||
|
}
|
||||||
$wmiSvc.Dispose()
|
$wmiSvc.Dispose()
|
||||||
if ($null -EQ $IsKeyManagementServiceMachine) {$objSvc.PSObject.Properties | foreach {set $_.Name $_.Value}}
|
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@ -7144,7 +7162,12 @@ function PrintSharedComputerLicensing
|
|||||||
{
|
{
|
||||||
$tokenFiles = Get-ChildItem -Path $tokenPath -Filter "*authString*" -Recurse | Where-Object { !$_.PSIsContainer }
|
$tokenFiles = Get-ChildItem -Path $tokenPath -Filter "*authString*" -Recurse | Where-Object { !$_.PSIsContainer }
|
||||||
}
|
}
|
||||||
If ($null -Eq $tokenFiles -Or $tokenFiles.Length -Eq 0)
|
If ($null -Eq $tokenFiles)
|
||||||
|
{
|
||||||
|
CONOUT "No tokens found."
|
||||||
|
Return
|
||||||
|
}
|
||||||
|
If ($tokenFiles.Length -Eq 0)
|
||||||
{
|
{
|
||||||
CONOUT "No tokens found."
|
CONOUT "No tokens found."
|
||||||
Return
|
Return
|
||||||
@ -7493,11 +7516,6 @@ if ($All.IsPresent) {
|
|||||||
if (!$Pass.IsPresent) {clear;}
|
if (!$Pass.IsPresent) {clear;}
|
||||||
}
|
}
|
||||||
|
|
||||||
$SysPath = "$env:SystemRoot\System32"
|
|
||||||
if (Test-Path "$env:SystemRoot\Sysnative\reg.exe") {
|
|
||||||
$SysPath = "$env:SystemRoot\Sysnative"
|
|
||||||
}
|
|
||||||
|
|
||||||
$wslp = "SoftwareLicensingProduct"
|
$wslp = "SoftwareLicensingProduct"
|
||||||
$wsls = "SoftwareLicensingService"
|
$wsls = "SoftwareLicensingService"
|
||||||
$oslp = "OfficeSoftwareProtectionProduct"
|
$oslp = "OfficeSoftwareProtectionProduct"
|
||||||
|
@ -639,13 +639,11 @@ if !errorlevel!==3 set resfail=1
|
|||||||
if defined resfail (
|
if defined resfail (
|
||||||
set error=1
|
set error=1
|
||||||
for %%# in (
|
for %%# in (
|
||||||
live.com
|
|
||||||
microsoft.com
|
|
||||||
login.live.com
|
login.live.com
|
||||||
purchase.mp.microsoft.com
|
purchase.mp.microsoft.com
|
||||||
licensing.mp.microsoft.com
|
licensing.mp.microsoft.com
|
||||||
) do (
|
) do (
|
||||||
findstr /i "%%#" "%SysPath%\drivers\etc\hosts" %nul1% && set "hosfail= [%%# Blocked in Hosts]"
|
findstr /i "%%#" "%SysPath%\drivers\etc\hosts" %nul1% && set "hosfail= [Blocked in Hosts]"
|
||||||
)
|
)
|
||||||
call :dk_color %Red% "Checking Licensing Servers [Failed to Connect]!hosfail!"
|
call :dk_color %Red% "Checking Licensing Servers [Failed to Connect]!hosfail!"
|
||||||
set fixes=%fixes% %mas%licensing-servers-issue
|
set fixes=%fixes% %mas%licensing-servers-issue
|
||||||
|
@ -103,6 +103,21 @@ if ($winbuild -LT 2600) {
|
|||||||
ExitScript 1
|
ExitScript 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$SysPath = "$env:SystemRoot\System32"
|
||||||
|
if (Test-Path "$env:SystemRoot\Sysnative\reg.exe") {
|
||||||
|
$SysPath = "$env:SystemRoot\Sysnative"
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Test-Path "$SysPath\sppc.dll") {
|
||||||
|
$SLdll = 'sppc.dll'
|
||||||
|
} elseif (Test-Path "$SysPath\slc.dll") {
|
||||||
|
$SLdll = 'slc.dll'
|
||||||
|
} else {
|
||||||
|
"==== ERROR ====`r`n"
|
||||||
|
"Software Licensing Client Dll is not detected."
|
||||||
|
ExitScript 1
|
||||||
|
}
|
||||||
|
|
||||||
if ($All.IsPresent)
|
if ($All.IsPresent)
|
||||||
{
|
{
|
||||||
$isAll = {CONOUT "`r"}
|
$isAll = {CONOUT "`r"}
|
||||||
@ -497,7 +512,7 @@ function GetResult($strSLP, $strSLS, $strID)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($winPR -And $Dlv -And $NT7 -And $null -EQ $RemainingAppReArmCount) {
|
if ($winPR -And $Dlv -And $null -EQ $RemainingAppReArmCount) {
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$tmp = [wmisearcher]"SELECT RemainingWindowsReArmCount FROM $strSLS"
|
$tmp = [wmisearcher]"SELECT RemainingWindowsReArmCount FROM $strSLS"
|
||||||
@ -566,9 +581,14 @@ function GetResult($strSLP, $strSLS, $strID)
|
|||||||
$objSvc = New-Object PSObject
|
$objSvc = New-Object PSObject
|
||||||
$wmiSvc = [wmisearcher]"SELECT * FROM $strSLS"
|
$wmiSvc = [wmisearcher]"SELECT * FROM $strSLS"
|
||||||
$wmiSvc.Options.Rewindable = $false
|
$wmiSvc.Options.Rewindable = $false
|
||||||
$wmiSvc.Get() | select -Expand Properties -EA 0 | foreach { if (-Not [String]::IsNullOrEmpty($_.Value)) {$objSvc | Add-Member 8 $_.Name $_.Value} }
|
$wmiSvc.Get() | select -Expand Properties -EA 0 | foreach {
|
||||||
|
if (-Not [String]::IsNullOrEmpty($_.Value))
|
||||||
|
{
|
||||||
|
$objSvc | Add-Member 8 $_.Name $_.Value
|
||||||
|
if ($null -EQ $IsKeyManagementServiceMachine) {set $_.Name $_.Value}
|
||||||
|
}
|
||||||
|
}
|
||||||
$wmiSvc.Dispose()
|
$wmiSvc.Dispose()
|
||||||
if ($null -EQ $IsKeyManagementServiceMachine) {$objSvc.PSObject.Properties | foreach {set $_.Name $_.Value}}
|
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@ -679,7 +699,12 @@ function PrintSharedComputerLicensing
|
|||||||
{
|
{
|
||||||
$tokenFiles = Get-ChildItem -Path $tokenPath -Filter "*authString*" -Recurse | Where-Object { !$_.PSIsContainer }
|
$tokenFiles = Get-ChildItem -Path $tokenPath -Filter "*authString*" -Recurse | Where-Object { !$_.PSIsContainer }
|
||||||
}
|
}
|
||||||
If ($null -Eq $tokenFiles -Or $tokenFiles.Length -Eq 0)
|
If ($null -Eq $tokenFiles)
|
||||||
|
{
|
||||||
|
CONOUT "No tokens found."
|
||||||
|
Return
|
||||||
|
}
|
||||||
|
If ($tokenFiles.Length -Eq 0)
|
||||||
{
|
{
|
||||||
CONOUT "No tokens found."
|
CONOUT "No tokens found."
|
||||||
Return
|
Return
|
||||||
@ -1028,11 +1053,6 @@ if ($All.IsPresent) {
|
|||||||
if (!$Pass.IsPresent) {clear;}
|
if (!$Pass.IsPresent) {clear;}
|
||||||
}
|
}
|
||||||
|
|
||||||
$SysPath = "$env:SystemRoot\System32"
|
|
||||||
if (Test-Path "$env:SystemRoot\Sysnative\reg.exe") {
|
|
||||||
$SysPath = "$env:SystemRoot\Sysnative"
|
|
||||||
}
|
|
||||||
|
|
||||||
$wslp = "SoftwareLicensingProduct"
|
$wslp = "SoftwareLicensingProduct"
|
||||||
$wsls = "SoftwareLicensingService"
|
$wsls = "SoftwareLicensingService"
|
||||||
$oslp = "OfficeSoftwareProtectionProduct"
|
$oslp = "OfficeSoftwareProtectionProduct"
|
||||||
|
Loading…
Reference in New Issue
Block a user