mkellerman / Invoke-CommandAs

Invoke Command As System/Interactive/GMSA/User on Local/Remote machine & returns PSObjects.
https://www.powershellgallery.com/packages/Invoke-CommandAs/
MIT License
458 stars 70 forks source link

Nothing happens #3

Closed Gobiman closed 6 years ago

Gobiman commented 6 years ago

Nothing happens when I run the command, see below the $error Powershell version is 5.1

Get-Job : The command cannot find the job because the job name bc725259-2000-4917-8639-276a36418032 was not found. Verify the value of the Name parameter, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Invoke-CommandAs\2.0\Invoke-CommandAs.psm1:208 char:36

mkellerman commented 6 years ago

Can you provide more info:

-OS -PSVersion -example of code to reproduce the error -command line use and parameters

Gobiman commented 6 years ago

Hi OS= Win2016 (works locally but not remotely), running as admin on both systems PSVersion= 5.1.14393.2363 Invoke-CommandAs -ComputerName 'ServerName' -ScriptBlock { Get-Process } The output PS C:\local> $Error Get-Job : The command cannot find the job because the job name 47621e7f-6d1f-4265-b011-05eb16fe8705 was not found. Verify the value of the Name parameter, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Invoke-CommandAs\2.0\Invoke-CommandAs.psm1:208 char:36

Get-Job : The command cannot find the job because the job name 47621e7f-6d1f-4265-b011-05eb16fe8705 was not found. Verify the value of the Name parameter, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Invoke-CommandAs\2.0\Invoke-CommandAs.psm1:208 char:36

Thanks

mkellerman commented 6 years ago

Please provide a -Credential when executing against a remote machine.

mkellerman commented 6 years ago

Did this resolve your issue?

Also, try establishing a New-PSSession, and use that instead of ComputerName/Credential. Just to help debug.

Will close this issue until further notice.

mkellerman commented 5 years ago

I fixed some issues in latest release (3.0), maybe worth retesting!