Invoke-Command create new object

0

I've got a problem to create new object with Invoke-Command:

$a = 'TEST'
Invoke-Command -ComputerName $computer -Credential $cred -ScriptBlock {
    param($a, $b, $c)
    $o = New-Object -ComObject Outlook.Application
    echo $a
} -ArgumentList ($a, $b, $c)

I'm getting the following error:

La récupération de la fabrique de classes COM pour le composant avec le CLSID
{0006F03A-0000-0000-C000-000000000046} a échoué en raison de l'erreur suivante :
80080005 Échec de l'exécution du serveur (Exception de HRESULT : 0x80080005
(CO_E_SERVER_EXEC_FAILURE)).
    + CategoryInfo          : ResourceUnavailable: (:) [New-Object], COMException
    + FullyQualifiedErrorId : NoCOMClassIdentified,Microsoft.PowerShell.Commands.NewObjectCommand

TEST

where the trailing "TEST" is the output of echo $a.

I can't create the new object remotly. can you help me?

powershell
invoke-command
asked on Stack Overflow Nov 10, 2016 by Alex Lum • edited Nov 10, 2016 by Ansgar Wiechers

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0