%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}"
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 20)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}"
exit /b
exit /b
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
if%_wmic%EQU 1 set"chkedi=for /f "tokens=2 delims=="%%a in ('"wmic path %spp% where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' AND LicenseDependsOn is NULL) get LicenseFamily /VALUE"%nul6%')"
if%_wmic%EQU 0 set"chkedi=for /f "tokens=2 delims=="%%a in ('%psc%"(([WMISEARCHER]'SELECT LicenseFamily FROM %spp% WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f'' AND LicenseDependsOn is NULL').Get()).LicenseFamily ^|%% {echo ('LicenseFamily='+$_)}"%nul6%')"
:: For Windows 10/11 editions, HWID key is listed where ever possible, in Server versions, KMS key is listed where ever possible.
:: For Windows 10/11 editions, HWID key is listed where ever possible, in Server versions, KMS key is listed where ever possible.
:: For Windows, generic keys are mentioned till 22000 and for Server, generic keys are mentioned till 17763, later ones are extracted from the pkeyhelper.dll
:: Only RS3 and older version Generic keys are stored here, later ones are extracted from the pkeyhelper.dll itself
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}"
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 20)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}"
exit /b
exit /b
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}"
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 20)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}"
exit /b
exit /b
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}"
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 20)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}"
exit /b
exit /b
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}"
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 20)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}"
exit /b
exit /b
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}"
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 20)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}"
exit /b
exit /b
:: Common lines used in PowerShell reflection code
:: Common lines used in PowerShell reflection code
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}"
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 20)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}"
exit /b
exit /b
:: Common lines used in PowerShell reflection code
:: Common lines used in PowerShell reflection code
:: For Windows 10/11 editions, HWID key is listed where ever possible, in Server versions, KMS key is listed where ever possible.
:: For Windows 10/11 editions, HWID key is listed where ever possible, in Server versions, KMS key is listed where ever possible.
:: For Windows, generic keys are mentioned till 22000 and for Server, generic keys are mentioned till 17763, later ones are extracted from the pkeyhelper.dll
:: Only RS3 and older version Generic keys are stored here, later ones are extracted from the pkeyhelper.dll itself