SHARE
TWEET

Untitled

a guest Oct 13th, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $wmicOutput = ((wmic path softwarelicensingservice get OA3xOriginalProductKey) | Out-String).Replace("`n", "");
  2.  
  3. $regexMatch = [regex]::Match($wmicOutput, "(?<orgKey>[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+)");
  4.  
  5. if ($regexMatch.Success)
  6. {
  7.     echo "Found Key from UEFI BIOS";
  8.     $key = $regexMatch.Groups["orgKey"];
  9.     Set-Clipboard $key;
  10.     echo "$key; Copied to Clipboard.";
  11. } else {
  12.     echo "No key found.";
  13. }
  14. pause;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top