Thanks for your answer !
I am executing that command just like what the book I am learning shows ,but it can’t work.So I am
very confused.That‘s the last command I doesn’t success to execute .I hope I can figure out one day .
What book is it? If it’s a kind of up to date it should at least recommend to use Get-CimInstance instead of Get-WmiObject
You should always read the complete help for the cmdlets you’re about to use to learn how to use them. In the case of Get-WmiObject it is the first sentence of the description paragraph where you can read …
Starting in PowerShell 3.0, this cmdlet has been superseded by Get-CimInstance .
And BTW:
PowerShell version 3.0 has been released 2012 - that’s more than 10 Years ago.
And BTW:
Maybe 10 years ago the situation was just like now !
Maybe only when two of PC are in the same domain, "Get-WmiObject -ComputerName -AsJob " would work.That is the explain I give to make me not feel so confused .
No I’m 99.9998% confident this is not the case. The issue is trying to pass custom credentials through a job and then a remote session. If the calling account (even in workgroup) had rights, then it would work fine. With the Start-Job command the entire scriptblock is running as the specific credentials, it’s not trying to pass them again. This is my interpretation of the test results. Case in point, my PC at home and my children’s computers all have an identical user account for me so I can use remoting without specifying credentials. This is a workgroup config. The Get-WmiObject and Get-CimInstance both work without specifying credentials manually as well as when running the scriptblock with Start-Job. However trying to pass these same credentials through Get-WmiObject as a job hit the same issue you did.