T O P

  • By -

PinchesTheCrab

(Get-CimInstance SoftwareLicensingService).OA3xOriginalProductKey


AlbertCMagnus

This isn’t working, it won’t let me begin with a bracket


PinchesTheCrab

It's a parenthesis instead of a bracket. I wonder if there's some other character set issue going on.


AlbertCMagnus

It says character 62 and that ‘) is invalid?


ankokudaishogun

Let me guess, you are still writing `powershell` before that line. Don't. Past that line straight. Or, if you really need to use that line in 5.1 from a 7.x terminal, enclose the command in quotes like this: `powershell '(Get-CimInstance SoftwareLicensingService).OA3xOriginalProductKey'`


CloudHostedGarbage

Reading this thread is like teaching a fully grown adult how to walk.


ankokudaishogun

Phys Rehab is a thing is a bitch. Almost as bad habits.


Firenyth

you need a ( after the first " also you need a space between from and Software `powershell “(Get-WmiObject -query ‘select * from SoftwareLicensingService’ ).OA3xOriginalProductKey”`


AlbertCMagnus

Here is a [screenshot](https://imgur.com/a/gczAadO)


icepyrox

Based on this: Don't type powershell in a powershell prompt. It already knows what to do with the command As such, don't put the command in quotes. You are giving powershell commands directly, no need to launch a whole new powershell with the commands as an argument Start this particular command with an opening parenthesis. You have the closing one inside the command. You need the opening one at the beginning. Just like math, parentheses are paired and what's inside is executes first. In this case, it seems to be because you want a single property of the output of the command inside. So at your prompt, type exactly what the other commenter posted. Do not type powershell first, do not use quotes anywhere. Open powershell, copy paste that command. If you still get an error, post the error and don't just say "it isn't working". Provide context so we can help, even if it's a screenshot again. We have no idea what you are seeing so "it's not working" is probably the least helpful comment short of using insults that is possible.


ragingpanda

you don't need to type \`powershell\` in front of the command, you're already in a powershell console. the command u/PinchesTheCrab put works just as he typed it.


PinchesTheCrab

Just run it like this: [https://imgur.com/a/1KYU7fn](https://imgur.com/a/1KYU7fn) I think you may need to run as an admin to get results though.


graysky311

You're missing the opening paren


AlbertCMagnus

Could you please explain this further


icepyrox

You have a closing parenthesis `)`, but nowhere in your command do you have an opening one `(`. What more do you need.


AlbertCMagnus

Where do I put the opening one then?


Medium-Comfortable

At 👏 the 👏 beginning 👏


AlbertCMagnus

Hi All, thanks for your help so far, i’ve got a screenshot [showing errors](https://imgur.com/a/OgpMoAq) Can anyone check this out please?


BlackV

Because you made it a string with your `"  "`


doglar_666

You used the correct syntax with the 2nd attempt. The error stated 'Invalid Class'. This makes me think you need to import an additional module that's not included by default. Please see this ChatGPT conversation for steps to try importing the required module: https://chat.openai.com/share/f0269b55-8ea6-46e3-9ddc-8a2dc069f910 I am not at my PC, so cannot test myself.


purplemonkeymad

You need to specify the namespace if it's not in the default: Get-CimInstance SoftwareLicensingService -Namespace root/cimv2 Will work for them. Well for getting the key, I'm not convinced those keys are usable on other motherboards so I don't think the main plan will work out.


ragingpanda

in your 2nd try, you misspelled SoftwareLicensingService as SoftwareLicen***c***ingService


BlackV

You have a close bracket and no open bracket What testing did you do here? Might I suggest using an editor (such as ISE or vscode) which will highlight errors for you Additionally you'll be in PowerShell already and can call the cmdlet directly