You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
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.
The text was updated successfully, but these errors were encountered: