Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Get-WMIObject #61

Open
JAProvencher opened this issue Feb 25, 2019 · 1 comment
Open

Issue with Get-WMIObject #61

JAProvencher opened this issue Feb 25, 2019 · 1 comment

Comments

@JAProvencher
Copy link

JAProvencher commented Feb 25, 2019

When I try to use Invoke-Parallel with Get-WMIObject, I get an access denied on every object.
I trimmed down the scriptblock to be just:
$scriptblock={
Get-WMIObject -Class Win32_OperatingSystem -ComputerName $_ -Credential $credential
}

I've tried with with and without $credential (simply my credentials for accessing servers via Get-Credential).

The command line used is: Invoke-Parallel -Scriptblock $scriptblock -InputObject $servers -Verbose

Might I be missing something? FWIW, a scriptblock that calls Test-Connection works fine.

@INRIX-Mark-Gershaft
Copy link

Have you tried other commands that only privileged user could do? I.e. access file shares. It could be that $credential is not passed to ScriptBlock and you have to pass it via -Parameter / $parameter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants